




版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、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 strOldName = "&q
2、uot; public string strOldAdd = "" public f_供應(yīng)商基本信息() InitializeComponent(); private void f_供應(yīng)商基本信息_Load(object sender, EventArgs e) / TODO: 這行代碼將數(shù)據(jù)加載到表“連鎖超市管理信息數(shù)據(jù)庫(kù)DataSet.供應(yīng)商”中。您可以根據(jù)需要移動(dòng)或移除它。 this.供應(yīng)商TableAdapter.Fill(this.連鎖超市管理信息數(shù)據(jù)庫(kù)DataSet.供應(yīng)商); /新增數(shù)據(jù)單擊事件 private void btnInsert_Click(obj
3、ect 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)名稱(chēng)數(shù)據(jù)的格式審核 if (strName.Length > 20) iErrCode =
4、2; if (strAdd.Length > 30) iErrCode = 3; if (iErrCode != 0) MessageBox.Show("你所輸入的數(shù)據(jù)有誤,請(qǐng)核查!"); else try /新增寫(xiě)入數(shù)據(jù)庫(kù) this.供應(yīng)商TableAdapter.Insert(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("新增數(shù)據(jù)發(fā)生錯(cuò)誤,請(qǐng)與管理員聯(lián)系!"); /刷新數(shù)據(jù)列數(shù) this.供應(yīng)商TableAdapter.Fill(this.連鎖超市管理信息數(shù)
5、據(jù)庫(kù)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 strAdd = this.dat
6、aGridView1.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 strName = txtName.T
7、ext; 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)名稱(chēng)數(shù)據(jù)的格式審核 if (strName.Length > 20) iErrCode = 2; if (strAdd.Length > 30) iErrCode = 3; if (iErrCode !=
8、 0) MessageBox.Show("你所輸入的數(shù)據(jù)有誤,請(qǐng)核查!"); else try /新增寫(xiě)入數(shù)據(jù)庫(kù) this.供應(yīng)商TableAdapter.Delete(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("刪除數(shù)據(jù)發(fā)生錯(cuò)誤,請(qǐng)與管理員聯(lián)系!"); /刷新數(shù)據(jù)列數(shù) this.供應(yīng)商TableAdapter.Fill(this.連鎖超市管理信息數(shù)據(jù)庫(kù)DataSet.供應(yīng)商); /修改按鈕事件 private void btnUpdate_Click(object
9、 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)名稱(chēng)數(shù)據(jù)的格式審核 if (strName.Length > 20) iErrCode = 2;
10、if (strAdd.Length > 30) iErrCode = 3; if (iErrCode != 0) MessageBox.Show("你所輸入的數(shù)據(jù)有誤,請(qǐng)核查!"); else try this.供應(yīng)商TableAdapter.Update(iNO, strName, strAdd, Convert.ToInt32(strOldNO), strOldName, strOldAdd); catch (Exception exUpdate) MessageBox.Show("修改數(shù)據(jù)發(fā)生錯(cuò)誤,請(qǐng)與管理員聯(lián)系!"); /刷新數(shù)據(jù)列數(shù) th
11、is.供應(yīng)商TableAdapter.Fill(this.連鎖超市管理信息數(shù)據(jù)庫(kù)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 string strOl
12、dNO = "" 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ù)庫(kù)DataSet.供應(yīng)商”中。您可以根據(jù)需要移動(dòng)或移除它。 this.供應(yīng)商TableAdapter.Fill(this.連鎖超市管理信息數(shù)據(jù)庫(kù)Da
13、taSet.供應(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) iErrCode = 1;
14、 /對(duì)前臺(tái)名稱(chēng)數(shù)據(jù)的格式審核 if (strName.Length > 20) iErrCode = 2; if (strAdd.Length > 30) iErrCode = 3; if (iErrCode != 0) MessageBox.Show("你所輸入的數(shù)據(jù)有誤,請(qǐng)核查!"); else try /新增寫(xiě)入數(shù)據(jù)庫(kù) this.供應(yīng)商TableAdapter.Insert(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("新增數(shù)據(jù)發(fā)生錯(cuò)誤,請(qǐng)與管理員聯(lián)系!&qu
15、ot;); /刷新數(shù)據(jù)列數(shù) this.供應(yīng)商TableAdapter.Fill(this.連鎖超市管理信息數(shù)據(jù)庫(kù)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.RowI
16、ndex.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_Click(object s
17、ender, 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)名稱(chēng)數(shù)據(jù)的格式審核 if (strName.Length > 20) iErrCode = 2; if
18、 (strAdd.Length > 30) iErrCode = 3; if (iErrCode != 0) MessageBox.Show("你所輸入的數(shù)據(jù)有誤,請(qǐng)核查!"); else try /新增寫(xiě)入數(shù)據(jù)庫(kù) this.供應(yīng)商TableAdapter.Delete(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("刪除數(shù)據(jù)發(fā)生錯(cuò)誤,請(qǐng)與管理員聯(lián)系!"); /刷新數(shù)據(jù)列數(shù) this.供應(yīng)商TableAdapter.Fill(this.連鎖超市管理信息數(shù)據(jù)庫(kù)DataSet.供應(yīng)商); /修改按鈕事件 private void btnUpdate_Click(object sender, EventArgs e) /獲取前臺(tái)數(shù)據(jù) string strName
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 生物醫(yī)藥技術(shù)秘密保護(hù)合伙人協(xié)議
- 國(guó)際古董藝術(shù)品保險(xiǎn)庫(kù)租賃與保管服務(wù)協(xié)議
- 戀愛(ài)出軌宗教儀式處罰協(xié)議
- 生物實(shí)驗(yàn)動(dòng)物倫理審查與定制化技術(shù)服務(wù)合同
- 游艇專(zhuān)用衛(wèi)星導(dǎo)航系統(tǒng)租賃與全球定位及保障服務(wù)協(xié)議
- 股權(quán)解押與公司企業(yè)文化建設(shè)合作協(xié)議
- 新能源企業(yè)員工薪酬集體協(xié)商方案服務(wù)合同
- 生物醫(yī)藥企業(yè)數(shù)據(jù)泄露事件應(yīng)急處理與責(zé)任承擔(dān)協(xié)議
- 編程培訓(xùn)機(jī)構(gòu)兼職編程講師授課協(xié)議
- 電信網(wǎng)絡(luò)維護(hù)與檢修勞務(wù)派遣協(xié)議
- 滯期費(fèi)速遣費(fèi)的計(jì)算
- 省級(jí)特色專(zhuān)業(yè)安徽省高等學(xué)校質(zhì)量工程項(xiàng)目進(jìn)展報(bào)告
- 電鍍鉻作業(yè)指導(dǎo)書(shū)
- 先導(dǎo)化合物的優(yōu)化和結(jié)構(gòu)修飾藥物化學(xué)專(zhuān)家講座
- 并購(gòu)重組試題
- 在線音樂(lè)網(wǎng)站設(shè)計(jì)論文
- 發(fā)動(dòng)機(jī)機(jī)械-01.1cm5a4g63維修手冊(cè)
- 國(guó)家開(kāi)放大學(xué)《行政組織學(xué)》形考1-5標(biāo)準(zhǔn)答案
- 急性會(huì)厭炎課件
- 單發(fā)跖骨骨折臨床路徑及表單
- 2021年西安經(jīng)開(kāi)渭北城市發(fā)展集團(tuán)有限公司招聘筆試試題及答案解析
評(píng)論
0/150
提交評(píng)論