亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? form1.cs

?? c#標(biāo)準(zhǔn)教程適合與處于不同學(xué)習(xí)階段的人
?? CS
字號(hào):
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using T = System.Diagnostics.Trace;
using SD=System.Data;            // general DB classes
using MSA=System.Data.OleDb;     // OleDB databases, e.g. MS Access
using SWF=System.Windows.Forms;

namespace BankCustomerApp
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.TextBox txtFirstName;
		private System.Windows.Forms.TextBox txtLastName;
		private System.Windows.Forms.TextBox txtBalance;
		private System.Windows.Forms.ListBox lstCustomers;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.TextBox txtAmount;
		private System.Windows.Forms.Button cmdDeposit;
		private System.Windows.Forms.Button cmdWithdrawal;
		private System.Windows.Forms.MainMenu mainMenu1;
		private System.Windows.Forms.MenuItem mnuFile;
		private System.Windows.Forms.MenuItem mnuFileFindByID;
		private System.Windows.Forms.MenuItem mnuFileDeleteSelected;
		private System.Windows.Forms.MenuItem menuItem4;
		private System.Windows.Forms.MenuItem mnuFileExit;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Form1()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.lstCustomers = new System.Windows.Forms.ListBox();
			this.txtFirstName = new System.Windows.Forms.TextBox();
			this.txtLastName = new System.Windows.Forms.TextBox();
			this.txtBalance = new System.Windows.Forms.TextBox();
			this.label1 = new System.Windows.Forms.Label();
			this.txtAmount = new System.Windows.Forms.TextBox();
			this.cmdDeposit = new System.Windows.Forms.Button();
			this.cmdWithdrawal = new System.Windows.Forms.Button();
			this.mainMenu1 = new System.Windows.Forms.MainMenu();
			this.mnuFile = new System.Windows.Forms.MenuItem();
			this.mnuFileFindByID = new System.Windows.Forms.MenuItem();
			this.mnuFileDeleteSelected = new System.Windows.Forms.MenuItem();
			this.menuItem4 = new System.Windows.Forms.MenuItem();
			this.mnuFileExit = new System.Windows.Forms.MenuItem();
			this.SuspendLayout();
			// 
			// lstCustomers
			// 
			this.lstCustomers.ItemHeight = 24;
			this.lstCustomers.Location = new System.Drawing.Point(24, 24);
			this.lstCustomers.Name = "lstCustomers";
			this.lstCustomers.Size = new System.Drawing.Size(184, 316);
			this.lstCustomers.Sorted = true;
			this.lstCustomers.TabIndex = 0;
			this.lstCustomers.TabStop = false;
			this.lstCustomers.SelectedIndexChanged += new System.EventHandler(this.lstCustomers_SelectedIndexChanged);
			// 
			// txtFirstName
			// 
			this.txtFirstName.Location = new System.Drawing.Point(248, 32);
			this.txtFirstName.Name = "txtFirstName";
			this.txtFirstName.ReadOnly = true;
			this.txtFirstName.Size = new System.Drawing.Size(176, 29);
			this.txtFirstName.TabIndex = 1;
			this.txtFirstName.Text = "";
			// 
			// txtLastName
			// 
			this.txtLastName.Location = new System.Drawing.Point(248, 72);
			this.txtLastName.Name = "txtLastName";
			this.txtLastName.ReadOnly = true;
			this.txtLastName.Size = new System.Drawing.Size(176, 29);
			this.txtLastName.TabIndex = 2;
			this.txtLastName.Text = "";
			// 
			// txtBalance
			// 
			this.txtBalance.Location = new System.Drawing.Point(248, 112);
			this.txtBalance.Name = "txtBalance";
			this.txtBalance.ReadOnly = true;
			this.txtBalance.Size = new System.Drawing.Size(176, 29);
			this.txtBalance.TabIndex = 3;
			this.txtBalance.Text = "";
			// 
			// label1
			// 
			this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.label1.Location = new System.Drawing.Point(248, 176);
			this.label1.Name = "label1";
			this.label1.TabIndex = 4;
			this.label1.Text = "amount:";
			// 
			// txtAmount
			// 
			this.txtAmount.Location = new System.Drawing.Point(248, 208);
			this.txtAmount.Name = "txtAmount";
			this.txtAmount.Size = new System.Drawing.Size(168, 29);
			this.txtAmount.TabIndex = 5;
			this.txtAmount.Text = "";
			// 
			// cmdDeposit
			// 
			this.cmdDeposit.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.cmdDeposit.Location = new System.Drawing.Point(256, 256);
			this.cmdDeposit.Name = "cmdDeposit";
			this.cmdDeposit.Size = new System.Drawing.Size(152, 32);
			this.cmdDeposit.TabIndex = 6;
			this.cmdDeposit.Text = "Deposit";
			this.cmdDeposit.Click += new System.EventHandler(this.cmdDeposit_Click);
			// 
			// cmdWithdrawal
			// 
			this.cmdWithdrawal.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.cmdWithdrawal.Location = new System.Drawing.Point(256, 304);
			this.cmdWithdrawal.Name = "cmdWithdrawal";
			this.cmdWithdrawal.Size = new System.Drawing.Size(152, 32);
			this.cmdWithdrawal.TabIndex = 7;
			this.cmdWithdrawal.Text = "Withdrawal";
			this.cmdWithdrawal.Click += new System.EventHandler(this.cmdWithdrawal_Click);
			// 
			// mainMenu1
			// 
			this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					  this.mnuFile});
			// 
			// mnuFile
			// 
			this.mnuFile.Index = 0;
			this.mnuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					this.mnuFileDeleteSelected,
																					this.mnuFileFindByID,
																					this.menuItem4,
																					this.mnuFileExit});
			this.mnuFile.Text = "&File";
			// 
			// mnuFileFindByID
			// 
			this.mnuFileFindByID.Index = 1;
			this.mnuFileFindByID.Text = "&Find by ID...";
			this.mnuFileFindByID.Click += new System.EventHandler(this.mnuFileFindByID_Click);
			// 
			// mnuFileDeleteSelected
			// 
			this.mnuFileDeleteSelected.Index = 0;
			this.mnuFileDeleteSelected.Text = "&Delete selected";
			this.mnuFileDeleteSelected.Click += new System.EventHandler(this.mnuFileDeleteSelected_Click);
			// 
			// menuItem4
			// 
			this.menuItem4.Index = 2;
			this.menuItem4.Text = "-";
			// 
			// mnuFileExit
			// 
			this.mnuFileExit.Index = 3;
			this.mnuFileExit.Text = "E&xit";
			this.mnuFileExit.Click += new System.EventHandler(this.mnuFileExit_Click);
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(10, 22);
			this.ClientSize = new System.Drawing.Size(446, 367);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.cmdWithdrawal,
																		  this.cmdDeposit,
																		  this.txtAmount,
																		  this.label1,
																		  this.txtBalance,
																		  this.txtLastName,
																		  this.txtFirstName,
																		  this.lstCustomers});
			this.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
			this.MaximizeBox = false;
			this.Menu = this.mainMenu1;
			this.Name = "Form1";
			this.Text = "Bank Customer App";
			this.Load += new System.EventHandler(this.Form1_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void Form1_Load(object sender, System.EventArgs e)
		{
			MSA.OleDbConnection  dbConn = null;
			MSA.OleDbDataReader  dbReader = null;

			try
			{
				string  sConnect;
				sConnect = string.Format("Provider={0};Data Source={1}{2}",
					"Microsoft.Jet.OLEDB.4.0;",
					System.AppDomain.CurrentDomain.BaseDirectory,
					"Sales.mdb");

				dbConn = new MSA.OleDbConnection(sConnect);
				dbConn.Open();

				SWF.MessageBox.Show( dbConn.State.ToString() );

				string  sql;  BankCustomer  c;
				sql = "Select * From Customers Order By LastName Asc, FirstName Asc;";

				MSA.OleDbCommand  dbCmd;
				dbCmd = new MSA.OleDbCommand(sql, dbConn);

				dbReader = dbCmd.ExecuteReader();

				while (dbReader.Read()) // retrieve records 1-by-1...
				{
					c = new BankCustomer(dbReader["FirstName"].ToString(),
						dbReader["LastName"].ToString(),
						System.Convert.ToDecimal(dbReader["AcctBalance"]));

					Globals.Customers.Add(c);
				}
			}
			catch(Exception ex)
			{
				throw ex;
			}
			finally 
			{
				try{ dbReader.Close(); }  catch{}
				try{ dbConn.Close();   }  catch{}
			}

			SWF.MessageBox.Show( dbConn.State.ToString() );

			// bind customers to list box for display
			this.lstCustomers.DataSource = Globals.Customers;
			this.lstCustomers.SelectedIndex = -1;
		}

		private void lstCustomers_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			BankCustomer  bc;
			bc = (BankCustomer) this.lstCustomers.SelectedItem;
			if (bc == null)
				return;

			T.WriteLineIf(Globals.Trace, "User selected '" + bc.ToString() + ".");
			T.Flush();

			//
			// bind selected object to text boxes for access...
			//
			this.txtFirstName.DataBindings.Clear();
			this.txtLastName.DataBindings.Clear();
			this.txtBalance.DataBindings.Clear();

			this.txtFirstName.DataBindings.Add("Text", bc, "FirstName");
			this.txtLastName.DataBindings.Add("Text", bc, "LastName");
			this.txtBalance.DataBindings.Add("Text", bc, "FormattedBalance");
		}

		private void cmdDeposit_Click(object sender, System.EventArgs e)
		{
			BankCustomer  bc;
			bc = (BankCustomer) this.lstCustomers.SelectedItem;

			if (bc == null)
			{
				MessageBox.Show("Please select a customer first.");
				return;
			}

			decimal  amt;
			amt = decimal.Parse( this.txtAmount.Text );

			T.Indent();
			T.WriteLineIf(Globals.Trace, "About to deposit " + amt.ToString());
			T.Flush();

			bc.Deposit(amt);
			this.txtBalance.Text = bc.GetFormattedBalance();

			T.WriteLineIf(Globals.Trace, "New balance: " + bc.GetFormattedBalance());
			T.Flush();
			T.Unindent();

			MessageBox.Show("Deposited.");
		}

		private void cmdWithdrawal_Click(object sender, System.EventArgs e)
		{
			BankCustomer  bc;
			bc = (BankCustomer) this.lstCustomers.SelectedItem;

			if (bc == null)
			{
				MessageBox.Show("Please select a customer first.");
				return;
			}

			decimal  amt;
			amt = decimal.Parse( this.txtAmount.Text );

			T.Indent();
			T.WriteLineIf(Globals.Trace, "About to withdraw " + amt.ToString());
			T.Flush();

			bc.Withdraw(amt);
			this.txtBalance.Text = bc.GetFormattedBalance();

			T.WriteLineIf(Globals.Trace, "New balance: " + bc.GetFormattedBalance());
			T.Flush();
			T.Unindent();

			MessageBox.Show("Withdrawn.");
		}

		private void cmdFindByID_Click(object sender, System.EventArgs e)
		{
			// show form modally, then have .NET dispose for us...
			using (FormInputID frm = new FormInputID())
			{
				DialogResult  dr;
				int           id;

				dr = frm.ShowDialog();
				if (dr == DialogResult.OK)
				{
					id = frm.CustomerID;
					MessageBox.Show("Simulating search for customer " + id + "...", "Bank Customer App", MessageBoxButtons.OK, MessageBoxIcon.Information);
				}
			}
		}

		private void mnuFileExit_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void mnuFileFindByID_Click(object sender, System.EventArgs e)
		{
			// show form modally, then have .NET dispose for us...
			using (FormInputID frm = new FormInputID())
			{
				DialogResult  dr;
				int           id;

				dr = frm.ShowDialog();
				if (dr == DialogResult.OK)
				{
					id = frm.CustomerID;
					MessageBox.Show("Simulating search for customer " + id + "...", "Bank Customer App", MessageBoxButtons.OK, MessageBoxIcon.Information);
				}
			}
		}

		private void mnuFileDeleteSelected_Click(object sender, System.EventArgs e)
		{
			BankCustomer  bc;
			bc = (BankCustomer) this.lstCustomers.SelectedItem;
			if (bc == null)
			{
				MessageBox.Show("Please select a customer to delete...");
				return;
			}

			MSA.OleDbConnection  dbConn = null;

			try
			{
				string  sConnect;
				sConnect = string.Format("Provider={0};Data Source={1}{2}",
					"Microsoft.Jet.OLEDB.4.0;",
					System.AppDomain.CurrentDomain.BaseDirectory,
					"Sales.mdb");

				dbConn = new MSA.OleDbConnection(sConnect);

				//
				// be sure to escape values when working with text fields!
				//
				string  sql;
				sql = string.Format("Delete from Customers where FirstName='{0}' and LastName='{1}';",
					bc.FirstName.Replace("'", "''"),
					bc.LastName.Replace("'", "''"));

				MSA.OleDbCommand  dbCmd;
				dbCmd = new MSA.OleDbCommand(sql, dbConn);

				int  rows;
				
				dbConn.Open();
				 rows = dbCmd.ExecuteNonQuery();
				dbConn.Close();

				if (rows != 1)
					throw new System.ApplicationException("Delete failed?!");

				// update global collection and rebind to list box...
				Globals.Customers.Remove(bc);
				this.resetGUI();

				MessageBox.Show("Deleted!");
			}
			catch(Exception ex)
			{
				throw ex;
			}
			finally 
			{
				try{ dbConn.Close(); } 
				catch{}
			}
		}

		private void resetGUI()
		{
			this.lstCustomers.DataSource = null;
			this.lstCustomers.DataSource = Globals.Customers;

			foreach (Control c in this.Controls)
				if (c is TextBox)
					((TextBox)c).Clear();
		}

	}//class
}//namespace

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产福利精品一区| 一区二区三区成人在线视频| 欧美日韩免费一区二区三区| 91亚洲精品久久久蜜桃网站| www.色精品| 91免费视频大全| 欧美在线视频不卡| 538prom精品视频线放| 欧美精品日韩精品| 欧美一区二区啪啪| 日韩精品一区二区三区中文不卡 | 日本一区二区三区在线不卡| 亚洲色大成网站www久久九九| 日本一区二区视频在线观看| 亚洲视频一区在线观看| 亚洲一区二区欧美日韩| 日韩黄色小视频| 国产一区二区三区av电影| 国产成人免费av在线| 高清在线观看日韩| 欧美在线一二三四区| 欧美一级日韩免费不卡| 国产人妖乱国产精品人妖| 亚洲图片另类小说| 日本欧美韩国一区三区| 国产成人亚洲综合色影视| av综合在线播放| 91精品国产日韩91久久久久久| 欧美xxx久久| 亚洲视频在线观看三级| 三级精品在线观看| 成人精品国产一区二区4080 | 亚洲成国产人片在线观看| 日韩电影在线一区二区三区| 成人午夜视频免费看| 欧美日韩综合在线免费观看| 亚洲精品一区二区三区在线观看| 自拍偷在线精品自拍偷无码专区| 秋霞午夜鲁丝一区二区老狼| 成人免费视频一区| 欧美一区二区三区免费大片| 1024精品合集| 国产麻豆视频精品| 欧美日韩国产一级二级| 国产精品三级av| 久久99精品国产麻豆婷婷| 色噜噜狠狠成人网p站| 久久夜色精品国产噜噜av| 亚洲1区2区3区4区| 91麻豆国产福利在线观看| 久久女同精品一区二区| 亚洲超碰精品一区二区| 色综合久久天天| 国产日韩欧美综合在线| 青娱乐精品视频在线| 91福利精品第一导航| 国产精品久久久久久久久免费丝袜| 国产成人免费视频网站| 欧美久久久一区| 亚洲午夜电影在线| 色香蕉成人二区免费| 国产精品白丝在线| 国产激情一区二区三区桃花岛亚洲| 88在线观看91蜜桃国自产| 一区二区三区精品在线| 大白屁股一区二区视频| 欧美极品aⅴ影院| 国产成人综合亚洲网站| 欧美精品一区二区三区高清aⅴ | 91丨国产丨九色丨pron| 国产亚洲欧美日韩在线一区| 黄色精品一二区| 日韩欧美在线观看一区二区三区| 亚洲成人你懂的| 欧美日韩另类一区| 亚洲动漫第一页| 欧美日韩aaaaa| 天堂蜜桃一区二区三区| 欧美精品亚洲二区| 美腿丝袜亚洲一区| 精品国产成人系列| 国产毛片精品视频| 国产精品高潮久久久久无| 成人av电影免费在线播放| 中文无字幕一区二区三区| 粉嫩绯色av一区二区在线观看| 国产欧美一区二区三区沐欲| 成人av资源站| 亚洲欧美激情视频在线观看一区二区三区| 成人h动漫精品| 一区二区三区不卡在线观看| 欧美三级资源在线| 日韩高清欧美激情| 欧美videos大乳护士334| 国产精品中文字幕欧美| 中文字幕中文字幕一区二区| 91福利国产成人精品照片| 三级在线观看一区二区| 精品成人佐山爱一区二区| 懂色av噜噜一区二区三区av| 亚洲男人的天堂av| 日韩免费一区二区三区在线播放| 99久久精品国产精品久久| 一区二区三区av电影| 91精品国产全国免费观看| 国产乱码精品一区二区三区忘忧草 | 成人精品免费看| 亚洲福利视频一区二区| 精品福利视频一区二区三区| 99视频一区二区| 日韩国产高清影视| 中文成人av在线| 精品污污网站免费看| 国产一区不卡视频| 伊人性伊人情综合网| 日韩精品资源二区在线| 色综合婷婷久久| 毛片一区二区三区| 一区二区三区在线视频观看| 日韩精品一区二区三区在线播放| 成人免费视频网站在线观看| 日韩av电影天堂| 亚洲人午夜精品天堂一二香蕉| 欧美精品黑人性xxxx| 99久久综合国产精品| 久久精品二区亚洲w码| 亚洲精品国产第一综合99久久| 精品福利av导航| 666欧美在线视频| 色美美综合视频| 国产成人精品一区二区三区网站观看| 亚洲成av人片| 亚洲精品免费在线播放| 国产丝袜美腿一区二区三区| 日韩视频一区二区三区在线播放| 色伊人久久综合中文字幕| www.66久久| 国产成人综合自拍| 韩国欧美国产一区| 久久国产精品99精品国产 | 欧美精品亚洲二区| 色乱码一区二区三区88| 成人激情动漫在线观看| 国产在线视频一区二区三区| 免费视频一区二区| 三级成人在线视频| 久久se精品一区二区| 久久无码av三级| 国产a级毛片一区| 天天影视网天天综合色在线播放| 一区二区三区精密机械公司| 五月婷婷色综合| 色94色欧美sute亚洲线路一ni | 亚洲女爱视频在线| 国产精品色噜噜| 欧美精品v国产精品v日韩精品| 理论电影国产精品| 久久国产精品99精品国产| 久久99在线观看| 激情久久五月天| 国产成都精品91一区二区三 | 欧美成人艳星乳罩| 日韩欧美一二三区| www成人在线观看| 国产亚洲精品超碰| 国产精品热久久久久夜色精品三区 | 91在线视频网址| 91福利资源站| 欧美疯狂做受xxxx富婆| 日韩欧美精品三级| 欧美激情一区三区| 亚洲美女视频在线| 亚洲 欧美综合在线网络| 欧美aaa在线| 国产高清不卡一区| 色88888久久久久久影院野外| 欧美在线一二三| 日韩美女主播在线视频一区二区三区 | 在线观看av一区二区| 日韩欧美国产精品一区| 国产视频一区二区在线| 樱桃国产成人精品视频| 男人操女人的视频在线观看欧美| 国产精品一区二区三区网站| 99精品国产99久久久久久白柏| 精品视频一区 二区 三区| 2023国产精品视频| 一级女性全黄久久生活片免费| 日韩在线播放一区二区| 国产成人精品亚洲777人妖| 91 com成人网| 国产精品久久久久久久久动漫 | 久久精品在线免费观看| 亚洲免费电影在线| 久久se精品一区精品二区| 91福利在线观看| 国产午夜亚洲精品理论片色戒| 一个色综合网站| 成人在线综合网站| 欧美一区二区三区啪啪|