




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、精選優(yōu)質(zhì)文檔-傾情為你奉上using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace 超市管理信息系統(tǒng) public partial class f_供應(yīng)商基本信息 : Form /公有變量記錄選定數(shù)據(jù) public string strOldNO = "" public string strOldNa
2、me = "" public string strOldAdd = "" public f_供應(yīng)商基本信息() InitializeComponent(); private void f_供應(yīng)商基本信息_Load(object sender, EventArgs e) / TODO: 這行代碼將數(shù)據(jù)加載到表“連鎖超市管理信息數(shù)據(jù)庫DataSet.供應(yīng)商”中。您可以根據(jù)需要移動(dòng)或移除它。 this.供應(yīng)商TableAdapter.Fill(this.連鎖超市管理信息數(shù)據(jù)庫DataSet.供應(yīng)商); /新增數(shù)據(jù)單擊事件 private void btnIns
3、ert_Click(object sender, EventArgs e) /獲取前臺(tái)數(shù)據(jù) string strName = txtName.Text; string strAdd = txtAdd.Text; string strNO = txtNO.Text; int iNO = 0; int iErrCode = 0; /對(duì)前臺(tái)編號(hào)數(shù)據(jù)的格式審核 try iNO = Convert.ToInt32(txtNO.Text.Trim(); catch (Exception eINO) iErrCode = 1; /對(duì)前臺(tái)名稱數(shù)據(jù)的格式審核 if (strName.Length > 20
4、) iErrCode = 2; if (strAdd.Length > 30) iErrCode = 3; if (iErrCode != 0) MessageBox.Show("你所輸入的數(shù)據(jù)有誤,請核查!"); else try /新增寫入數(shù)據(jù)庫 this.供應(yīng)商TableAdapter.Insert(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("新增數(shù)據(jù)發(fā)生錯(cuò)誤,請與管理員聯(lián)系!"); /刷新數(shù)據(jù)列數(shù) this.供應(yīng)商TableAdapter.Fill(t
5、his.連鎖超市管理信息數(shù)據(jù)庫DataSet.供應(yīng)商); /單擊數(shù)據(jù)表單元格觸發(fā)事件 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) /獲取對(duì)應(yīng)行的各個(gè)單元格數(shù)據(jù) string strNO = this.dataGridView1.Rowse.RowIndex.Cells0.Value.ToString(); string strName = this.dataGridView1.Rowse.RowIndex.Cells1.Value.ToString(); string strA
6、dd = this.dataGridView1.Rowse.RowIndex.Cells2.Value.ToString(); /填充回對(duì)應(yīng)的文本框 txtNO.Text = strNO; txtName.Text = strName; txtAdd.Text = strAdd; /將原數(shù)據(jù)值賦予公有變量 strOldNO = strNO; strOldName = strName; strOldAdd = strAdd; /刪除按鈕事件 private void btnDelete_Click(object sender, EventArgs e) /獲取前臺(tái)數(shù)據(jù) string strNam
7、e = txtName.Text; string strAdd = txtAdd.Text; string strNO = txtNO.Text; int iNO = 0; int iErrCode = 0; /對(duì)前臺(tái)編號(hào)數(shù)據(jù)的格式審核 try iNO = Convert.ToInt32(txtNO.Text.Trim(); catch (Exception eINO) iErrCode = 1; /對(duì)前臺(tái)名稱數(shù)據(jù)的格式審核 if (strName.Length > 20) iErrCode = 2; if (strAdd.Length > 30) iErrCode = 3; if
8、 (iErrCode != 0) MessageBox.Show("你所輸入的數(shù)據(jù)有誤,請核查!"); else try /新增寫入數(shù)據(jù)庫 this.供應(yīng)商TableAdapter.Delete(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("刪除數(shù)據(jù)發(fā)生錯(cuò)誤,請與管理員聯(lián)系!"); /刷新數(shù)據(jù)列數(shù) this.供應(yīng)商TableAdapter.Fill(this.連鎖超市管理信息數(shù)據(jù)庫DataSet.供應(yīng)商); /修改按鈕事件 private void btnUpdate
9、_Click(object sender, EventArgs e) /獲取前臺(tái)數(shù)據(jù) string strName = txtName.Text; string strAdd = txtAdd.Text; string strNO = txtNO.Text; int iNO = 0; int iErrCode = 0; /對(duì)前臺(tái)編號(hào)數(shù)據(jù)的格式審核 try iNO = Convert.ToInt32(txtNO.Text.Trim(); catch (Exception eINO) iErrCode = 1; /對(duì)前臺(tái)名稱數(shù)據(jù)的格式審核 if (strName.Length > 20) i
10、ErrCode = 2; if (strAdd.Length > 30) iErrCode = 3; if (iErrCode != 0) MessageBox.Show("你所輸入的數(shù)據(jù)有誤,請核查!"); else try this.供應(yīng)商TableAdapter.Update(iNO, strName, strAdd, Convert.ToInt32(strOldNO), strOldName, strOldAdd); catch (Exception exUpdate) MessageBox.Show("修改數(shù)據(jù)發(fā)生錯(cuò)誤,請與管理員聯(lián)系!"
11、); /刷新數(shù)據(jù)列數(shù) this.供應(yīng)商TableAdapter.Fill(this.連鎖超市管理信息數(shù)據(jù)庫DataSet.供應(yīng)商); using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace 超市管理信息系統(tǒng) public partial class f_供應(yīng)商基本信息 : Form /公有變量記錄選定數(shù)據(jù) public
12、 string strOldNO = "" public string strOldName = "" public string strOldAdd = "" public f_供應(yīng)商基本信息() InitializeComponent(); private void f_供應(yīng)商基本信息_Load(object sender, EventArgs e) / TODO: 這行代碼將數(shù)據(jù)加載到表“連鎖超市管理信息數(shù)據(jù)庫DataSet.供應(yīng)商”中。您可以根據(jù)需要移動(dòng)或移除它。 this.供應(yīng)商TableAdapter.Fill(this.
13、連鎖超市管理信息數(shù)據(jù)庫DataSet.供應(yīng)商); /新增數(shù)據(jù)單擊事件 private void btnInsert_Click(object sender, EventArgs e) /獲取前臺(tái)數(shù)據(jù) string strName = txtName.Text; string strAdd = txtAdd.Text; string strNO = txtNO.Text; int iNO = 0; int iErrCode = 0; /對(duì)前臺(tái)編號(hào)數(shù)據(jù)的格式審核 try iNO = Convert.ToInt32(txtNO.Text.Trim(); catch (Exception eINO)
14、iErrCode = 1; /對(duì)前臺(tái)名稱數(shù)據(jù)的格式審核 if (strName.Length > 20) iErrCode = 2; if (strAdd.Length > 30) iErrCode = 3; if (iErrCode != 0) MessageBox.Show("你所輸入的數(shù)據(jù)有誤,請核查!"); else try /新增寫入數(shù)據(jù)庫 this.供應(yīng)商TableAdapter.Insert(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("新增數(shù)據(jù)發(fā)生錯(cuò)
15、誤,請與管理員聯(lián)系!"); /刷新數(shù)據(jù)列數(shù) this.供應(yīng)商TableAdapter.Fill(this.連鎖超市管理信息數(shù)據(jù)庫DataSet.供應(yīng)商); /單擊數(shù)據(jù)表單元格觸發(fā)事件 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) /獲取對(duì)應(yīng)行的各個(gè)單元格數(shù)據(jù) string strNO = this.dataGridView1.Rowse.RowIndex.Cells0.Value.ToString(); string strName = this.dataGridVie
16、w1.Rowse.RowIndex.Cells1.Value.ToString(); string strAdd = this.dataGridView1.Rowse.RowIndex.Cells2.Value.ToString(); /填充回對(duì)應(yīng)的文本框 txtNO.Text = strNO; txtName.Text = strName; txtAdd.Text = strAdd; /將原數(shù)據(jù)值賦予公有變量 strOldNO = strNO; strOldName = strName; strOldAdd = strAdd; /刪除按鈕事件 private void btnDelete_C
17、lick(object sender, EventArgs e) /獲取前臺(tái)數(shù)據(jù) string strName = txtName.Text; string strAdd = txtAdd.Text; string strNO = txtNO.Text; int iNO = 0; int iErrCode = 0; /對(duì)前臺(tái)編號(hào)數(shù)據(jù)的格式審核 try iNO = Convert.ToInt32(txtNO.Text.Trim(); catch (Exception eINO) iErrCode = 1; /對(duì)前臺(tái)名稱數(shù)據(jù)的格式審核 if (strName.Length > 20) iEr
18、rCode = 2; if (strAdd.Length > 30) iErrCode = 3; if (iErrCode != 0) MessageBox.Show("你所輸入的數(shù)據(jù)有誤,請核查!"); else try /新增寫入數(shù)據(jù)庫 this.供應(yīng)商TableAdapter.Delete(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("刪除數(shù)據(jù)發(fā)生錯(cuò)誤,請與管理員聯(lián)系!"); /刷新數(shù)據(jù)列數(shù) this.供應(yīng)商TableAdapter.Fill(this.連鎖超市管理信息數(shù)據(jù)庫DataSet.供應(yīng)商); /修改按鈕事件 private void btnUpdate_Click(object sender, EventArgs e) /獲取前臺(tái)數(shù)據(jù) string strName = txt
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2不一樣的你我他(教案)-部編版道德與法治三年級(jí)下冊
- 2024秋八年級(jí)道德與法治上冊 第三單元 法律在我心中 第十課 維護(hù)消費(fèi)者權(quán)利(維護(hù)我們的合法權(quán)益)教學(xué)設(shè)計(jì) 人民版
- 《第四單元10以內(nèi)數(shù)加與減-小雞吃食》(教學(xué)設(shè)計(jì))-2024-2025學(xué)年一年級(jí)上冊數(shù)學(xué)北師大版
- Unit 1 Making friends (教學(xué)設(shè)計(jì))-2024-2025學(xué)年人教PEP版英語三年級(jí)上冊
- 2024年二年級(jí)品生下冊《愛惜每一張紙》教學(xué)設(shè)計(jì)2 鄂教版
- 2024-2025學(xué)年高中生物 第六章 從雜交育種到基因工程 第1節(jié) 雜交育種與誘變育種教學(xué)設(shè)計(jì)2 新人教版必修2
- 2023七年級(jí)英語上冊 Module 6 A trip to the zoo Unit 3 Language in use教學(xué)設(shè)計(jì) (新版)外研版
- Unit 1 The secrets of happiness Presenting ideas 教學(xué)設(shè)計(jì) -2024-2025學(xué)年外研版(2024)七年級(jí)英語下冊
- 2023六年級(jí)英語下冊 Unit 7 Shanghai Is in the Southeast of China第1課時(shí)教學(xué)設(shè)計(jì) 陜旅版(三起)
- 2023三年級(jí)數(shù)學(xué)上冊 二 觀察物體第1課時(shí) 看一看(1)教學(xué)設(shè)計(jì) 北師大版
- 工程項(xiàng)目跟蹤審計(jì)送審資料清單
- 中文產(chǎn)品手冊機(jī)架效果器tcelectronic-triplec manual chinese
- 新概念英語第三冊Lesson8 課件
- 人衛(wèi)版內(nèi)科學(xué)第九章白血?。ǖ?節(jié))
- 食堂設(shè)備維修記錄
- DB65∕T 4357-2021 草原資源遙感調(diào)查技術(shù)規(guī)程
- 幼兒園繪本:《閃閃的紅星》 紅色故事
- 植物生理學(xué)_第七版_潘瑞熾_答案
- FZ∕T 60021-2021 織帶產(chǎn)品物理機(jī)械性能試驗(yàn)方法
- 云南大學(xué)研究業(yè)績認(rèn)定與折算細(xì)則
- DG∕T 154-2022 熱風(fēng)爐
評(píng)論
0/150
提交評(píng)論