超市管理系统代码.doc

上传人:wj 文档编号:1102942 上传时间:2023-04-30 格式:DOC 页数:10 大小:37KB
下载 相关 举报
超市管理系统代码.doc_第1页
第1页 / 共10页
超市管理系统代码.doc_第2页
第2页 / 共10页
超市管理系统代码.doc_第3页
第3页 / 共10页
超市管理系统代码.doc_第4页
第4页 / 共10页
超市管理系统代码.doc_第5页
第5页 / 共10页
超市管理系统代码.doc_第6页
第6页 / 共10页
超市管理系统代码.doc_第7页
第7页 / 共10页
超市管理系统代码.doc_第8页
第8页 / 共10页
超市管理系统代码.doc_第9页
第9页 / 共10页
超市管理系统代码.doc_第10页
第10页 / 共10页
亲,该文档总共10页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

超市管理系统代码.doc

《超市管理系统代码.doc》由会员分享,可在线阅读,更多相关《超市管理系统代码.doc(10页珍藏版)》请在冰点文库上搜索。

超市管理系统代码.doc

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Text;

usingSystem.Windows.Forms;

namespace超市管理信息系统

{

publicpartialclassf_供应商基本信息:

Form

{

//公有变量记录选定数据

publicstringstrOldNO="";

publicstringstrOldName="";

publicstringstrOldAdd="";

publicf_供应商基本信息()

{

InitializeComponent();

}

privatevoidf_供应商基本信息_Load(objectsender,EventArgse)

{

//TODO:

这行代码将数据加载到表“连锁超市管理信息数据库DataSet.供应商”中。

您可以根据需要移动或移除它。

this.供应商TableAdapter.Fill(this.连锁超市管理信息数据库DataSet.供应商);

}

//新增数据单击事件

privatevoidbtnInsert_Click(objectsender,EventArgse)

{

//获取前台数据

stringstrName=txtName.Text;

stringstrAdd=txtAdd.Text;

stringstrNO=txtNO.Text;

intiNO=0;

intiErrCode=0;

//对前台编号数据的格式审核

try

{

iNO=Convert.ToInt32(txtNO.Text.Trim());

}

catch(ExceptioneINO)

{

iErrCode=1;

}

//对前台名称数据的格式审核

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(ExceptionexInsert)

{

MessageBox.Show("新增数据发生错误,请与管理员联系!

");

}

}

//刷新数据列数

this.供应商TableAdapter.Fill(this.连锁超市管理信息数据库DataSet.供应商);

}

//单击数据表单元格触发事件

privatevoiddataGridView1_CellClick(objectsender,DataGridViewCellEventArgse)

{

//获取对应行的各个单元格数据

stringstrNO=this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();

stringstrName=this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();

stringstrAdd=this.dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();

//填充回对应的文本框

txtNO.Text=strNO;

txtName.Text=strName;

txtAdd.Text=strAdd;

//将原数据值赋予公有变量

strOldNO=strNO;

strOldName=strName;

strOldAdd=strAdd;

}

//删除按钮事件

privatevoidbtnDelete_Click(objectsender,EventArgse)

{

//获取前台数据

stringstrName=txtName.Text;

stringstrAdd=txtAdd.Text;

stringstrNO=txtNO.Text;

intiNO=0;

intiErrCode=0;

//对前台编号数据的格式审核

try

{

iNO=Convert.ToInt32(txtNO.Text.Trim());

}

catch(ExceptioneINO)

{

iErrCode=1;

}

//对前台名称数据的格式审核

if(strName.Length>20)

{

iErrCode=2;

}

if(strAdd.Length>30)

{

iErrCode=3;

}

if(iErrCode!

=0)

{

MessageBox.Show("你所输入的数据有误,请核查!

");

}

else

{

try

{

//新增写入数据库

this.供应商TableAdapter.Delete(iNO,strName,strAdd);

}

catch(ExceptionexInsert)

{

MessageBox.Show("删除数据发生错误,请与管理员联系!

");

}

}

//刷新数据列数

this.供应商TableAdapter.Fill(this.连锁超市管理信息数据库DataSet.供应商);

}

//修改按钮事件

privatevoidbtnUpdate_Click(objectsender,EventArgse)

{

//获取前台数据

stringstrName=txtName.Text;

stringstrAdd=txtAdd.Text;

stringstrNO=txtNO.Text;

intiNO=0;

intiErrCode=0;

//对前台编号数据的格式审核

try

{

iNO=Convert.ToInt32(txtNO.Text.Trim());

}

catch(ExceptioneINO)

{

iErrCode=1;

}

//对前台名称数据的格式审核

if(strName.Length>20)

{

iErrCode=2;

}

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(ExceptionexUpdate)

{

MessageBox.Show("修改数据发生错误,请与管理员联系!

");

}

}

//刷新数据列数

this.供应商TableAdapter.Fill(this.连锁超市管理信息数据库DataSet.供应商);

}

}

}usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Text;

usingSystem.Windows.Forms;

namespace超市管理信息系统

{

publicpartialclassf_供应商基本信息:

Form

{

//公有变量记录选定数据

publicstringstrOldNO="";

publicstringstrOldName="";

publicstringstrOldAdd="";

publicf_供应商基本信息()

{

InitializeComponent();

}

privatevoidf_供应商基本信息_Load(objectsender,EventArgse)

{

//TODO:

这行代码将数据加载到表“连锁超市管理信息数据库DataSet.供应商”中。

您可以根据需要移动或移除它。

this.供应商TableAdapter.Fill(this.连锁超市管理信息数据库DataSet.供应商);

}

//新增数据单击事件

privatevoidbtnInsert_Click(objectsender,EventArgse)

{

//获取前台数据

stringstrName=txtName.Text;

stringstrAdd=txtAdd.Text;

stringstrNO=txtNO.Text;

intiNO=0;

intiErrCode=0;

//对前台编号数据的格式审核

try

{

iNO=Convert.ToInt32(txtNO.Text.Trim());

}

catch(ExceptioneINO)

{

iErrCode=1;

}

//对前台名称数据的格式审核

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(ExceptionexInsert)

{

MessageBox.Show("新增数据发生错误,请与管理员联系!

");

}

}

//刷新数据列数

this.供应商TableAdapter.Fill(this.连锁超市管理信息数据库DataSet.供应商);

}

//单击数据表单元格触发事件

privatevoiddataGridView1_CellClick(objectsender,DataGridViewCellEventArgse)

{

//获取对应行的各个单元格数据

stringstrNO=this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();

stringstrName=this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();

stringstrAdd=this.dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();

//填充回对应的文本框

txtNO.Text=strNO;

txtName.Text=strName;

txtAdd.Text=strAdd;

//将原数据值赋予公有变量

strOldNO=strNO;

strOldName=strName;

strOldAdd=strAdd;

}

//删除按钮事件

privatevoidbtnDelete_Click(objectsender,EventArgse)

{

//获取前台数据

stringstrName=txtName.Text;

stringstrAdd=txtAdd.Text;

stringstrNO=txtNO.Text;

intiNO=0;

intiErrCode=0;

//对前台编号数据的格式审核

try

{

iNO=Convert.ToInt32(txtNO.Text.Trim());

}

catch(ExceptioneINO)

{

iErrCode=1;

}

//对前台名称数据的格式审核

if(strName.Length>20)

{

iErrCode=2;

}

if(strAdd.Length>30)

{

iErrCode=3;

}

if(iErrCode!

=0)

{

MessageBox.Show("你所输入的数据有误,请核查!

");

}

else

{

try

{

//新增写入数据库

this.供应商TableAdapter.Delete(iNO,strName,strAdd);

}

catch(ExceptionexInsert)

{

MessageBox.Show("删除数据发生错误,请与管理员联系!

");

}

}

//刷新数据列数

this.供应商TableAdapter.Fill(this.连锁超市管理信息数据库DataSet.供应商);

}

//修改按钮事件

privatevoidbtnUpdate_Click(objectsender,EventArgse)

{

//获取前台数据

stringstrName=txtName.Text;

stringstrAdd=txtAdd.Text;

stringstrNO=txtNO.Text;

intiNO=0;

intiErrCode=0;

//对前台编号数据的格式审核

try

{

iNO=Convert.ToInt32(txtNO.Text.Trim());

}

catch(ExceptioneINO)

{

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 工程科技 > 能源化工

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2