mainform.cs

来自「C#简单练习进销存代码」· CS 代码 · 共 532 行 · 第 1/2 页

CS
532
字号
			this.menuItem12.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					   this.menuItem19,
																					   this.menuItem20,
																					   this.menuItem13,
																					   this.menuItem18});
			this.menuItem12.Text = "Inventory";
			// 
			// menuItem19
			// 
			this.menuItem19.Index = 0;
			this.menuItem19.Text = "IN010 Inventory Changes";
			this.menuItem19.Click += new System.EventHandler(this.menuItem19_Click);
			// 
			// menuItem20
			// 
			this.menuItem20.Index = 1;
			this.menuItem20.Text = "-";
			// 
			// menuItem13
			// 
			this.menuItem13.Index = 2;
			this.menuItem13.Text = "IN020 Inventory Change List";
			this.menuItem13.Click += new System.EventHandler(this.menuItem13_Click);
			// 
			// menuItem18
			// 
			this.menuItem18.Index = 3;
			this.menuItem18.Text = "IN030 Check Inventory";
			this.menuItem18.Click += new System.EventHandler(this.menuItem18_Click);
			// 
			// menuItem3
			// 
			this.menuItem3.Index = 4;
			this.menuItem3.MdiList = true;
			this.menuItem3.Text = "Window";
			// 
			// wmMain
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(512, 186);
			this.IsMdiContainer = true;
			this.Menu = this.mainMenu1;
			this.Name = "wmMain";
			this.Text = "MainForm";
			this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
			this.Load += new System.EventHandler(this.wmMain_Load);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new wmMain());
		}

		private void wmMain_Load(object sender, System.EventArgs e)
		{
			this.Text="Main Window";
			db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" + Application.StartupPath + @"\star.mdb;Mode=Share Deny None;Extended Properties='';Jet OLEDB:System database='';Jet OLEDB:Registry Path='';Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False";
			try{
				 db.Open();
			}catch( System.Exception ex) {
				MessageBox.Show("Failed to connect to data source, details info:"+ex.Message );
			}finally{
				db.Close();
			}
        }

		private void menuItem2_Click(object sender, System.EventArgs e)
		{
			if(WmPre1==null)
				WmPre1=new BA.BA010();
			else if(WmPre1.MdiParent==null)
				WmPre1=new BA.BA010();
			WmPre1.MdiParent=this;
			WmPre1.Show ();

		}

		private void oleDbConnection1_InfoMessage(object sender, System.Data.OleDb.OleDbInfoMessageEventArgs e)
		{
		
		}

		private void dbCon_InfoMessage(object sender, System.Data.OleDb.OleDbInfoMessageEventArgs e)
		{
		
		}

		private void menuItem4_Click(object sender, System.EventArgs e)
		{
			if(BA0201==null)
				BA0201=new BA.BA020();
			else if(BA0201.MdiParent==null)
				BA0201=new BA.BA020();
			BA0201.MdiParent=this;
			BA0201.Show ();
		}

		private void menuItem8_Click(object sender, System.EventArgs e)
		{
			if(BA0601==null)
				BA0601=new BA.BA060();
			else if(BA0601.MdiParent==null)
				BA0601=new BA.BA060();
			BA0601.MdiParent=this;
			BA0601.Show ();
		}

		private void menuItem6_Click(object sender, System.EventArgs e)
		{
			if(BA0301==null)
				BA0301=new BA.BA030();
			else if(BA0301.MdiParent==null)
				BA0301=new BA.BA030();
			BA0301.MdiParent=this;
			BA0301.Show ();
		}

		private void menuItem5_Click(object sender, System.EventArgs e)
		{
			if(BA0401==null)
				BA0401=new BA.BA040();
			else if(BA0401.MdiParent==null)
				BA0401=new BA.BA040();
			BA0401.MdiParent=this;
			BA0401.Show ();
		}

		private void menuItem9_Click(object sender, System.EventArgs e)
		{
			(new Public.SimpleList()).Show();

		}

		private void menuItem7_Click(object sender, System.EventArgs e)
		{
			if(BA0501==null)
				BA0501=new BA.BA050();
			else if(BA0501.MdiParent==null)
				BA0501=new BA.BA050();
			BA0501.MdiParent=this;
			BA0501.Show ();
		
		}

		private void menuItem9_Click_1(object sender, System.EventArgs e)
		{
			if(PR0101==null)
				PR0101=new PR.PR010();
			else if(PR0101.MdiParent==null)
				PR0101=new PR.PR010();
			PR0101.MdiParent=this;
			PR0101.Show ();
		
		}

		private void menuItem15_Click(object sender, System.EventArgs e)
		{
			new star.PR.PRO20 ().ShowDialog (this);
		}

		private void menuItem16_Click(object sender, System.EventArgs e)
		{
			if(SA0101==null)
				SA0101=new SA.SA010();
			else if(SA0101.MdiParent==null)
				SA0101=new SA.SA010();
			SA0101.MdiParent=this;
			SA0101.Show ();
			
			
		}

		private void menuItem19_Click(object sender, System.EventArgs e)
		{
			if(IN0101==null)
				IN0101=new IN.IN010();
			else if(IN0101.MdiParent==null)
				IN0101=new IN.IN010();
			IN0101.MdiParent=this;
			IN0101.Show ();
			
		}

		private void menuItem23_Click(object sender, System.EventArgs e)
		{
			new star.test().ShowDialog (this);
		}

		private void menuItem24_Click(object sender, System.EventArgs e)
		{
			/*if(PR0311==null)
				PR0311=new PR.PR031();
			else if(PR0311.MdiParent==null)
				PR0311=new PR.PR031();
			PR0311.MdiParent=this;
			PR0311.Show ();
			*/
			new PR.PR030 ().ShowDialog(this);
		}

		private void menuItem26_Click(object sender, System.EventArgs e)
		{
			new PR.PR040().ShowDialog(this);
		}

		private void menuItem28_Click(object sender, System.EventArgs e)
		{
			new SA.SA020().ShowDialog(this);
		}

		private void menuItem31_Click(object sender, System.EventArgs e)
		{
			//new SA.SA031().ShowDialog(this);
		}

		private void menuItem32_Click(object sender, System.EventArgs e)
		{
			//new SA.SA032().ShowDialog(this);
		}

		private void menuItem21_Click(object sender, System.EventArgs e)
		{
		
		}

		private void menuItem13_Click(object sender, System.EventArgs e)
		{
			new star.IN.IN020().ShowDialog(this);
		}

		private void menuItem25_Click(object sender, System.EventArgs e)
		{
			new PR.PR030 ().ShowDialog(this);
		}

		private void menuItem27_Click(object sender, System.EventArgs e)
		{
			new PR.PR040 ().ShowDialog(this);
		}

		private void menuItem26_Click_1(object sender, System.EventArgs e)
		{
			new SA.SA030().ShowDialog(this);
		}

		private void menuItem30_Click(object sender, System.EventArgs e)
		{
			new SA.SA040().ShowDialog(this);
		}

		private void menuItem18_Click(object sender, System.EventArgs e)
		{
			new IN.IN030().ShowDialog(this);
		}

		

	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?