




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(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ù)有誤,請(qǐng)核查!"); else try /新增寫入數(shù)據(jù)庫 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(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ù)有誤,請(qǐng)核查!"); else try /新增寫入數(shù)據(jù)庫 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ù)庫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ù)有誤,請(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)系!"
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ù)有誤,請(qǐng)核查!"); else try /新增寫入數(shù)據(jù)庫 this.供應(yīng)商TableAdapter.Insert(iNO, strName, strAdd); catch (Exception exInsert) MessageBox.Show("新增數(shù)據(jù)發(fā)生錯(cuò)
15、誤,請(qǐng)與管理員聯(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ù)有誤,請(qǐng)核查!"); else try /新增寫入數(shù)據(jù)庫 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ù)庫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等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(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)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度退股及員工持股計(jì)劃合同
- 個(gè)人股權(quán)轉(zhuǎn)讓合同2025年度含業(yè)績對(duì)賭條款
- 二零二五年度臨時(shí)項(xiàng)目經(jīng)理職務(wù)聘用與成果轉(zhuǎn)化合同
- 二零二五年度旅游團(tuán)隊(duì)保險(xiǎn)責(zé)任免除聲明
- 電線電纜購銷合同
- 管理層勞動(dòng)合同工資
- 個(gè)人數(shù)字資產(chǎn)管理協(xié)議
- 全新池塘出租協(xié)議
- 月餅產(chǎn)品代銷合同
- 鄉(xiāng)村旅游發(fā)展策略與實(shí)施方案
- 體育競賽的組織與編排
- 動(dòng)靜脈內(nèi)瘺的圍手術(shù)期護(hù)理-課件
- reaxys使用介紹課件
- 工程建設(shè)項(xiàng)目管理培訓(xùn)教材課件
- 11-化學(xué)動(dòng)力學(xué)基礎(chǔ)-2-考研試題資料系列
- 《簡愛》課本劇劇本
- 社區(qū)獲得性肺炎臨床路徑
- 產(chǎn)品品質(zhì)檢驗(yàn)流程標(biāo)準(zhǔn)規(guī)范模板()
- GB∕T 7260.40-2020 不間斷電源系統(tǒng) UPS 第4部分:環(huán)境 要求及報(bào)告
- 安全文明施工管理(EHS)方案(24頁)
- 水廠項(xiàng)目基于BIM技術(shù)全生命周期解決方案-城市智慧水務(wù)講座課件
評(píng)論
0/150
提交評(píng)論