




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
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_供應商基本信息 : Form /公有變量記錄選定數據 public string strOldNO = "" public string strOldName = "&q
2、uot; public string strOldAdd = "" public f_供應商基本信息() InitializeComponent(); private void f_供應商基本信息_Load(object sender, EventArgs e) / TODO: 這行代碼將數據加載到表“連鎖超市管理信息數據庫DataSet.供應商”中。您可以根據需要移動或移除它。 this.供應商TableAdapter.Fill(this.連鎖超市管理信息數據庫DataSet.供應商); /新增數據單擊事件 private void btnInsert_Click(obj
3、ect sender, EventArgs e) /獲取前臺數據 string strName = txtName.Text; string strAdd = txtAdd.Text; string strNO = txtNO.Text; int iNO = 0; int iErrCode = 0; /對前臺編號數據的格式審核 try iNO = Convert.ToInt32(txtNO.Text.Trim(); catch (Exception eINO) iErrCode = 1; /對前臺名稱數據的格式審核 if (strName.Length > 20) iErrCode =
4、2; if (strAdd.Length > 30) iErrCode = 3; if (iErrCode != 0) MessageBox.Show("你所輸入的數據有誤,請核查!"); else try /新增寫入數據庫 this.供應商TableAdapter.Insert(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("新增數據發(fā)生錯誤,請與管理員聯系!"); /刷新數據列數 this.供應商TableAdapter.Fill(this.連鎖超市管理信息數
5、據庫DataSet.供應商); /單擊數據表單元格觸發(fā)事件 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) /獲取對應行的各個單元格數據 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(); /填充回對應的文本框 txtNO.Text = strNO; txtName.Text = strName; txtAdd.Text = strAdd; /將原數據值賦予公有變量 strOldNO = strNO; strOldName = strName; strOldAdd = strAdd; /刪除按鈕事件 private void btnDelete_Click(object sender, EventArgs e) /獲取前臺數據 string strName = txtName.T
7、ext; string strAdd = txtAdd.Text; string strNO = txtNO.Text; int iNO = 0; int iErrCode = 0; /對前臺編號數據的格式審核 try iNO = Convert.ToInt32(txtNO.Text.Trim(); catch (Exception eINO) iErrCode = 1; /對前臺名稱數據的格式審核 if (strName.Length > 20) iErrCode = 2; if (strAdd.Length > 30) iErrCode = 3; if (iErrCode !=
8、 0) MessageBox.Show("你所輸入的數據有誤,請核查!"); else try /新增寫入數據庫 this.供應商TableAdapter.Delete(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("刪除數據發(fā)生錯誤,請與管理員聯系!"); /刷新數據列數 this.供應商TableAdapter.Fill(this.連鎖超市管理信息數據庫DataSet.供應商); /修改按鈕事件 private void btnUpdate_Click(object
9、 sender, EventArgs e) /獲取前臺數據 string strName = txtName.Text; string strAdd = txtAdd.Text; string strNO = txtNO.Text; int iNO = 0; int iErrCode = 0; /對前臺編號數據的格式審核 try iNO = Convert.ToInt32(txtNO.Text.Trim(); catch (Exception eINO) iErrCode = 1; /對前臺名稱數據的格式審核 if (strName.Length > 20) iErrCode = 2;
10、if (strAdd.Length > 30) iErrCode = 3; if (iErrCode != 0) MessageBox.Show("你所輸入的數據有誤,請核查!"); else try this.供應商TableAdapter.Update(iNO, strName, strAdd, Convert.ToInt32(strOldNO), strOldName, strOldAdd); catch (Exception exUpdate) MessageBox.Show("修改數據發(fā)生錯誤,請與管理員聯系!"); /刷新數據列數 th
11、is.供應商TableAdapter.Fill(this.連鎖超市管理信息數據庫DataSet.供應商); 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_供應商基本信息 : Form /公有變量記錄選定數據 public string strOl
12、dNO = "" public string strOldName = "" public string strOldAdd = "" public f_供應商基本信息() InitializeComponent(); private void f_供應商基本信息_Load(object sender, EventArgs e) / TODO: 這行代碼將數據加載到表“連鎖超市管理信息數據庫DataSet.供應商”中。您可以根據需要移動或移除它。 this.供應商TableAdapter.Fill(this.連鎖超市管理信息數據庫Da
13、taSet.供應商); /新增數據單擊事件 private void btnInsert_Click(object sender, EventArgs e) /獲取前臺數據 string strName = txtName.Text; string strAdd = txtAdd.Text; string strNO = txtNO.Text; int iNO = 0; int iErrCode = 0; /對前臺編號數據的格式審核 try iNO = Convert.ToInt32(txtNO.Text.Trim(); catch (Exception eINO) iErrCode = 1;
14、 /對前臺名稱數據的格式審核 if (strName.Length > 20) iErrCode = 2; if (strAdd.Length > 30) iErrCode = 3; if (iErrCode != 0) MessageBox.Show("你所輸入的數據有誤,請核查!"); else try /新增寫入數據庫 this.供應商TableAdapter.Insert(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("新增數據發(fā)生錯誤,請與管理員聯系!&qu
15、ot;); /刷新數據列數 this.供應商TableAdapter.Fill(this.連鎖超市管理信息數據庫DataSet.供應商); /單擊數據表單元格觸發(fā)事件 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) /獲取對應行的各個單元格數據 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(); /填充回對應的文本框 txtNO.Text = strNO; txtName.Text = strName; txtAdd.Text = strAdd; /將原數據值賦予公有變量 strOldNO = strNO; strOldName = strName; strOldAdd = strAdd; /刪除按鈕事件 private void btnDelete_Click(object s
17、ender, EventArgs e) /獲取前臺數據 string strName = txtName.Text; string strAdd = txtAdd.Text; string strNO = txtNO.Text; int iNO = 0; int iErrCode = 0; /對前臺編號數據的格式審核 try iNO = Convert.ToInt32(txtNO.Text.Trim(); catch (Exception eINO) iErrCode = 1; /對前臺名稱數據的格式審核 if (strName.Length > 20) iErrCode = 2; if
18、 (strAdd.Length > 30) iErrCode = 3; if (iErrCode != 0) MessageBox.Show("你所輸入的數據有誤,請核查!"); else try /新增寫入數據庫 this.供應商TableAdapter.Delete(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("刪除數據發(fā)生錯誤,請與管理員聯系!"); /刷新數據列數 this.供應商TableAdapter.Fill(this.連鎖超市管理信息數據庫DataSet.供應商); /修改按鈕事件 private void btnUpdate_Click(object sender, EventArgs e) /獲取前臺數據 string strName
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025家電購買合同樣本范文
- 2025年城市個人租房合同范本
- 新型碳化硅浮島結二極管的理論與實驗研究
- 2025《房產抵押貸款協(xié)議》
- 用工合同范文錦集(4篇)2
- 2025教師個人工作總結(17篇)
- 汽車銷售2025個人工作計劃(15篇)
- CRM2B鐵騎力士項目藍圖方案匯報26v20
- 財務管理成本效益分析練習
- 年終安全工作總結報告(16篇)
- 夫妻實行aa制協(xié)議書
- 養(yǎng)老消防安全試題及答案
- 2025年下半年北京大興區(qū)地震局招聘臨時輔助用工擬聘用人員易考易錯模擬試題(共500題)試卷后附參考答案
- 2025春季學期國家安全教育期末考試-國開(XJ)-參考資料
- 2025新版保安員考試試題附含答案
- 2024貴州貴陽農商銀行“超享聘旭日”大學生招聘50人筆試歷年典型考題及考點剖析附帶答案詳解
- 醫(yī)療健康產業(yè)的中醫(yī)師承人才培養(yǎng)模式
- 養(yǎng)牛場項目可行性研究報告
- 2025公需課《人工智能賦能制造業(yè)高質量發(fā)展》試題及答案
- 2025年三級安全培訓考試試題附參考答案【考試直接用】
- 宇宙起源與演化歷史探討
評論
0/150
提交評論