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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? form1.cs

?? c#標準教程適合與處于不同學習階段的人
?? CS
字號:
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 SQL=System.Data.SqlClient;   // Microsoft SQL Server databases
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)
		{
			SQL.SqlConnection  dbConn = null;
			SQL.SqlDataReader  dbReader = null;

			try
			{
				string  sConnect;
				sConnect = string.Format("Server={0};Database={1};{2}",
					"localhost", 
					"Sales",
					"Integrated Security=SSPI");  //id=sa;pwd=????				dbConn = new SQL.SqlConnection(sConnect);
				dbConn.Open();

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

				string  sql;  BankCustomer  c;
/*
				//parameter begin
				sql = "Select * From Customers Where CID=@CID Order By LastName Asc, FirstName Asc;";

				SQL.SqlCommand  dbCmd;
				dbCmd = new SQL.SqlCommand(sql, dbConn);

				dbCmd.Parameters.Add("@CID", SqlDbType.BigInt);
				dbCmd.Parameters[0].Value = 1;
				//parameter end

*/	
/*				
				//procedure begin
				SQL.SqlCommand  dbCmd =dbConn.CreateCommand();
				dbCmd.CommandText = "GetCustomer";
				dbCmd.CommandType = CommandType.StoredProcedure;
				dbCmd.Parameters.Add("@CID", SqlDbType.BigInt);
				dbCmd.Parameters[0].Value = 1;
				//precedure end
*/


				//Transaction
				SQL.SqlTransaction txn = dbConn.BeginTransaction();
				string strSQL = "INSERT INTO Customers VALUES(100,'Hui','Yu',1000000,1000000,'01-Jan-2005','money')";
				SQL.SqlCommand  dbCmd;
				dbCmd = new SQL.SqlCommand(strSQL, dbConn,txn);
				int intRecord = dbCmd.ExecuteNonQuery();
				if(intRecord ==1)
				{
					SWF.MessageBox.Show( "Update Successful");
					txn.Commit();
				}
				else
				{
					SWF.MessageBox.Show( "Update Failed");
					txn.Rollback();
				}			
			
/*				

				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;
			}

			SQL.SqlConnection  dbConn = null;

			try
			{
				string  sConnect;
				sConnect = string.Format("Server={0};Database={1};{2}",
					"localhost", 
					"Sales",
					"Integrated Security=SSPI");  // 搖id=sa;pwd=????				dbConn = new SQL.SqlConnection(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("'", "''"));

				SQL.SqlCommand  dbCmd;
				dbCmd = new SQL.SqlCommand(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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
天天色天天爱天天射综合| 成人教育av在线| 成人av资源在线观看| 在线一区二区三区做爰视频网站| 欧美二区乱c少妇| 中文字幕日本乱码精品影院| 日韩高清不卡一区二区三区| 成人av午夜电影| 精品理论电影在线观看 | 亚洲福利视频三区| 丁香激情综合五月| 精品国产成人在线影院| 亚洲高清免费视频| 在线亚洲欧美专区二区| 国产精品久久久久久久久动漫 | 欧美福利视频导航| 一区二区三区在线观看视频| 国产一区二区精品久久91| 91精品国产综合久久精品| 夜夜揉揉日日人人青青一国产精品| 国产精品自在欧美一区| 日韩情涩欧美日韩视频| 午夜精品福利在线| 精品视频色一区| 亚洲成av人片一区二区| 欧美最猛黑人xxxxx猛交| 亚洲女与黑人做爰| 97精品视频在线观看自产线路二| 久久午夜羞羞影院免费观看| 久久国内精品自在自线400部| 欧美电影一区二区| 秋霞国产午夜精品免费视频| 欧美日韩一二三区| 天天爽夜夜爽夜夜爽精品视频| 在线免费av一区| 香蕉加勒比综合久久| 欧美日韩国产首页在线观看| 亚洲国产aⅴ成人精品无吗| 欧美性色黄大片| 一区二区三区.www| 欧美午夜精品一区| 亚洲一卡二卡三卡四卡五卡| 91一区二区三区在线观看| 成人欧美一区二区三区白人| 国产不卡免费视频| 国产精品福利av| 91免费观看国产| 亚洲愉拍自拍另类高清精品| 欧美三级日韩三级| 麻豆国产91在线播放| 国产日韩精品一区二区三区| 成人av综合一区| 亚洲成人av一区二区三区| 日韩一区二区不卡| 成人午夜av在线| 亚洲超碰97人人做人人爱| 欧美一区二区三区精品| 国产一区二区视频在线| 成人欧美一区二区三区小说 | 91视频91自| 亚洲1区2区3区4区| 久久综合久久久久88| 国产999精品久久久久久绿帽| 亚洲免费高清视频在线| 日韩精品中午字幕| 国产东北露脸精品视频| 夜夜嗨av一区二区三区四季av| 欧美一区二区三区色| 国产精品99久久久久久有的能看 | 国产精品女主播av| 在线播放中文一区| 丁香激情综合国产| 免费的成人av| 国产精品第13页| 欧美精品 国产精品| 国产成人精品一区二区三区网站观看| 国产精品久久福利| 制服视频三区第一页精品| 成人午夜视频在线| 久久精品免费看| 亚洲一区二区综合| 欧美激情一区不卡| 欧美一级午夜免费电影| 懂色av噜噜一区二区三区av| 午夜精品在线看| 国产精品福利一区二区三区| 日韩欧美国产不卡| 欧美日韩午夜精品| 色综合网站在线| 成人自拍视频在线观看| 精品一区二区三区日韩| 亚洲国产成人av好男人在线观看| 久久精品在线观看| 日韩精品一区二区三区在线播放| 欧美性大战久久久久久久 | 狠狠v欧美v日韩v亚洲ⅴ| 亚洲午夜在线电影| 一区二区三区中文字幕精品精品| 国产婷婷一区二区| 欧美不卡一区二区三区| 91精品在线观看入口| 色欧美片视频在线观看在线视频| 国产成人午夜99999| 黄色日韩网站视频| 国产一区二区三区电影在线观看| 日韩黄色在线观看| 日韩精品电影在线| 五月天丁香久久| 天堂一区二区在线免费观看| 亚洲图片欧美视频| 一区二区三区自拍| 亚洲一卡二卡三卡四卡五卡| 夜夜嗨av一区二区三区网页| 一区二区在线免费观看| 亚洲综合另类小说| 亚洲无人区一区| 天天色图综合网| 精品中文字幕一区二区| 国产在线精品一区在线观看麻豆| 蜜桃av一区二区三区电影| 男女性色大片免费观看一区二区| 午夜视频在线观看一区| 日本成人在线电影网| 免费日本视频一区| 国产一本一道久久香蕉| 成人一级视频在线观看| 91美女蜜桃在线| 欧美日韩黄视频| 欧美一级日韩一级| 久久综合九色综合久久久精品综合| xvideos.蜜桃一区二区| 国产精品情趣视频| 夜夜嗨av一区二区三区中文字幕 | 精品国产91久久久久久久妲己 | 色综合 综合色| 538在线一区二区精品国产| 日韩欧美一级二级三级久久久| 2024国产精品| 亚洲欧美欧美一区二区三区| 亚洲成a人在线观看| 韩国午夜理伦三级不卡影院| 狠狠色伊人亚洲综合成人| 99久久伊人精品| 欧美日韩国产免费一区二区| 精品福利av导航| 日韩理论片在线| 洋洋av久久久久久久一区| 裸体一区二区三区| 国产91富婆露脸刺激对白| 欧美丝袜自拍制服另类| 精品噜噜噜噜久久久久久久久试看| 国产午夜精品一区二区三区嫩草| 国产精品日韩精品欧美在线| 一区二区三区不卡视频| 不卡视频一二三四| 91在线你懂得| 精品国免费一区二区三区| 国产精品成人一区二区艾草 | 亚洲美女在线一区| 免费成人av在线播放| 成人亚洲精品久久久久软件| 制服.丝袜.亚洲.中文.综合| 国产情人综合久久777777| 日本女人一区二区三区| 成人国产亚洲欧美成人综合网| 7777精品伊人久久久大香线蕉最新版 | 国产盗摄女厕一区二区三区| 在线观看日韩av先锋影音电影院| xf在线a精品一区二区视频网站| 一区二区高清在线| 国产成人av影院| 在线成人免费视频| 一区二区国产盗摄色噜噜| 成人永久免费视频| 日韩写真欧美这视频| 午夜亚洲国产au精品一区二区| 成人激情免费视频| 久久久久久麻豆| 自拍偷拍欧美精品| 婷婷成人激情在线网| 日本道精品一区二区三区| 国产欧美日韩精品一区| 日韩激情一区二区| 欧美日韩国产高清一区二区| 国产精品久久久久久久久图文区| 国内一区二区在线| 日韩午夜精品电影| 日韩激情一区二区| 91精品国产综合久久婷婷香蕉 | 日韩精品视频网站| 欧美性受xxxx| 国产精品不卡在线| 成人动漫精品一区二区| 日韩一区二区三区免费观看| 亚洲成人自拍偷拍| 在线成人免费观看| 男人操女人的视频在线观看欧美| 制服丝袜亚洲色图| 日韩电影免费一区| 777a∨成人精品桃花网|