




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、ATM系統源代碼與可執行程序模塊總體設計:歡迎模塊;登錄模塊;系統模塊;窗體 控件模塊;二、代碼與可執行程序 private void label4_Click(object sender, EventArgs e) Adminform adminform = new Adminform(); adminform.Show(); this.Hide(); private void label4_Click(object sender, EventArgs e) Adminform adminform = new Adminform(); adminform.Show(); this.Hide(
2、); private void 退出ToolStripMenuItem_Click_1(object sender, EventArgs e) Application.Exit(); /*歡迎模塊*/ Login login = new Login(); login.Show(); CustomerLogin customerLogin = new CustomerLogin(); customerLogin.Show(); /打開新的CustomerLogin窗體,對人工服務登錄. BankManageSystem bankManageSystem = new BankManageSyste
3、m(); bankManageSystem.Show(); About about = new About(); about.Show(); LianXi lianxi = new LianXi(); lianxi.Show(); Application.Exit(); /* 操作界面窗體設計 */ string strsql = Data Source=WIN-KOBGNACPI2KSQLEXPRESS;Initial Catalog=Bank;Integrated Security=True; sqlcon = new SqlConnection(strsql); CustomerLogi
4、n cl = new CustomerLogin(); cl.Show(); this.Hide(); /打開CustomerLogin窗體,并關閉Login窗體。 BankManageSystem bms = new BankManageSystem(); bms.Show(); this.Hide(); /* 連接數據庫 */ private void button1_Click(object sender, EventArgs e) /db.Clogin(textBox1.Text, textBox2.Text); /CustomerOperatiom co = new Customer
5、Operatiom(); /co.Show(); /this.Hide(); db = new DBManager(); string strsql=select * from Cardinfo; sqlds = db.seldemo(strsql); string cardid = this.textBox1.Text; string cardpwd = this.textBox2.Text; string tcardid = null; string tpwd = null; foreach (DataRow dr in sqlds.Tables0.Rows) tcardid = drca
6、rdid.ToString(); tpwd = drcardpwd.ToString(); if (tcardid.Equals(cardid) & tpwd.Equals(tpwd) MessageBox.Show(登錄成功); this.Hide(); CustomerOperation cop = new CustomerOperation(); cop.Show(); else MessageBox.Show(卡號或密碼錯誤); break; private void button2_Click(object sender, EventArgs e) textBox1.Clear();
7、 textBox2.Clear(); textBox1.Focus(); /清除textBox文本框中的數據 private void button3_Click(object sender, EventArgs e) this.Close(); /* ATM登錄界面窗體設計 */ private void button1_Click(object sender, EventArgs e) Transform tf = new Transform(); tf.Show(); this.Hide(); private void button2_Click(object sender, Event
8、Args e) Save save = new Save(); save.Show(); this.Hide(); /打開新Save窗體,并關閉CustomerOperation窗體 private void button3_Click(object sender, EventArgs e) Get get = new Get(); get.Show(); this.Hide(); private void button5_Click(object sender, EventArgs e) Amend amend = new Amend(); amend.Show(); this.Hide()
9、; /修改密碼 private void button4_Click(object sender, EventArgs e) Query query = new Query(); query.Show(); this.Hide(); private void button6_Click(object sender, EventArgs e) this.Hide(); /* ATM機操作界面窗體設計 */ private void button1_Click(object sender, EventArgs e) db = new DBManager(); string name = selec
10、t usename from Cardinfo; string usename = 所匯賬戶的戶主姓名為:+db.Alluseb(name)+,確定?; if (MessageBox.Show(usename, 信息, MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) = DialogResult.Yes) string get = select cardid from Cardinfo; string getmoney = update Cardinfo set card
11、money=cardmoney- + this.textBox2.Text + where cardid= +db.Alluseb(get) + ; string savemoney = update Cardinfo set cardmoney=cardmoney+ + this.textBox2.Text + where cardid= + this.textBox1.Text + ; db.Allusea(getmoney); db.Allusea(savemoney); MessageBox.Show(轉帳成功); this.textBox1.Clear(); this.textBox
12、2.Clear(); /訪問數據庫和修改數據庫,要緊用于轉賬 private void button2_Click(object sender, EventArgs e) CustomerOperation co = new CustomerOperation(); co.Show(); this.Hide(); /* ATM機轉賬界面窗體設計 */ private void button1_Click(object sender, EventArgs e) if (Convert.ToInt32(this.textBox1.Text) 0) string get = select * fro
13、m Cardinfo; string save = update Cardinfo set cardmoney=cardmoney+this.textBox1.Text+where cardid=+db.Alluseb(get)+; db.Allusea(save); MessageBox.Show(存款成功); this.textBox1.Clear(); else MessageBox.Show(存款不能為負); CustomerOperation co = new CustomerOperation(); co.Show(); this.Hide(); /* ATM機存款界面窗體設計 *
14、/ private void button1_Click(object sender, EventArgs e) db = new DBManager(); string get = select cardmoney from Cardinfo; if (Convert.ToInt32(this.textBox1.Text) =Convert.ToDecimal(db.Alluseb(get) string geta = select cardid from Cardinfo; string getmoney = update Cardinfo set cardmoney=cardmoney-
15、 + textBox1.Text + where cardid= + db.Alluseb(geta) + ; db.Allusea(getmoney); MessageBox.Show(取款成功); else MessageBox.Show(余額不足); /關于輸入金額進行校驗 private void button2_Click(object sender, EventArgs e) CustomerOperation co = new CustomerOperation(); co.Show(); this.Hide(); /* ATM機取款界面窗體設計 */ private void
16、button1_Click(object sender, EventArgs e) db=new DBManager(); string pwd= select cardpwd from Cardinfo; if(db.Alluseb(pwd).Equals(this.textBox3.Text) if(this.textBox1.Text.Equals(this.textBox2.Text) string get = select cardid from Cardinfo; string repwd = update Cardinfo set cardpwd=+this.textBox1.T
17、ext+ where cardid=+db.Alluseb(get)+; db.Allusea(repwd); string repwda = update Cardinfo set cardrepwd= + this.textBox1.Text + where cardid= + db.Alluseb(get) + ; db.Allusea(repwda); MessageBox.Show(密碼修成功); else MessageBox.Show(密碼確認不一致); else MessageBox.Show(原始密碼錯誤); /確認初始密碼和修改初始密碼是否一致 private void b
18、utton2_Click(object sender, EventArgs e) CustomerOperation co = new CustomerOperation(); co.Show(); this.Hide(); /* ATM機修改密碼界面窗體設計 */ private void button2_Click(object sender, EventArgs e) string get = select * from Cardinfo; string query = select cardmoney from Cardinfo where cardid= + db.Alluseb(g
19、et) + ; this.textBox1.Text = db.Alluseb(query); MessageBox.Show(查詢成功); /訪問數據庫,并讀取cardmoney中的數據,且寫入到textBox控件中 CustomerOperation co = new CustomerOperation(); co.Show(); this.Hide(); /* ATM余額查詢界面窗體設計 */ private void button1_Click(object sender, EventArgs e) string name = this.textBox1.Text; string nu
20、mber = this.textBox2.Text; string pwd = this.textBox10.Text; string repwd = this.textBox9.Text; string money = this.textBox11.Text; string lose = ; Random rd = new Random(); string cardid; cardid = Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Con
21、vert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Conver
22、t.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9) + Convert.ToString(rd.Next(0, 9); db.openaccount(cardid,name,number,pwd,repwd,money,lose); private void button9_Click(object sender, EventArgs e) this.Hide(); private void button4_Click(object sender, EventArg
23、s e) string closea= select cardid,cardpwd,usenumber from Cardinfo where cardid=+this.textBox4.Text+ ; if (db.Closeaccount(closea).Equals(this.textBox4.Text + this.textBox12.Text + textBox3.Text) string xh = delete from Cardinfo where cardid=+this.textBox4.Text+; db.Allusea(xh); MessageBox.Show(銷戶成功)
24、; private void button9_Click(object sender, EventArgs e) this.Hide(); private void button6_Click(object sender, EventArgs e) string guashi = select cardlose from Cardinfo where cardid=+this.textBox15.Text+; string closeb = select cardid,cardpwd,usenumber,cardlose from Cardinfo where cardid= + this.textBox15.Text + ; if (db.Closeaccount(closeb).Equals(this.textBox15.Text + this.textBox13.Text + textBox5.Text) string str = db.Allusebb(closeb).ToString(); if (str.Equals() string gua = update Cardinfo set cardlose=已掛失 where cardid= + this.textBox15.Text + ; db.Allusea(gua); MessageBox.
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 游戲行業綠色發展與環保技術考核試卷
- 人性化指導2025年證券從業資格證考試試題及答案
- 理解注冊會計師考試的重要性與試題及答案
- 2025年【工具鉗工(高級)】模擬考試題及答案
- 2024年項目管理考試提升指南試題及答案
- 2023年中國葛洲壩三峽建設工程有限公司成熟人才招聘若干人筆試參考題庫附帶答案詳解
- 污水處理中的低溫脫氮技術與應用考核試卷
- 橡膠管材在工業通風系統的消聲性能考核試卷
- 行政管理研究的現狀與展望試題及答案
- 管道工程行業綠色技術創新考核試卷
- 2024年秋兒童發展問題的咨詢與輔導終考期末大作業案例分析1-5答案
- 新產品試產管理程序
- 錨索抗滑樁畢業設計(湖南工程學院)
- 各國關于數據與個人隱私的法律規定
- 人教版(PEP)五年級英語下冊(U1-U4)單元專題訓練(含答案)
- 維生素K2行業研究、市場現狀及未來發展趨勢(2020-2026)
- 定遠縣蔡橋水庫在建工程實施方案
- 繪本故事《三只小豬蓋房子》課件
- GB 13296-2013 鍋爐、熱交換器用不銹鋼無縫鋼管(高清版)
- 部編版八年級語文下冊寫作《學寫讀后感》精美課件
- LED顯示屏項目立項報告(模板參考)
評論
0/150
提交評論