第一范文网 - 专业文章范例文档资料分享平台

C#程序超市管理系统

来源:用户分享 时间:2025/10/25 9:35:55 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

i = cmd.ExecuteNonQuery(); conn.Close(); } catch (Exception ) { conn.Close(); } } return i; } } } 登录窗体Form1的代码: using System; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Text; namespace chaoshiguanlixitong { public partial class Form1 : Form { public static string yhm; public Form1() { InitializeComponent();} private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == \ { label3.Text = \账号或密码不能为空!\ else { string m = \密码 from denglu where 账号='\+ textBox1.Text + \ string g = \管理员 from denglu where 账号='\+ textBox1.Text + \ Sjk d = new Sjk(); if (d.cx(m).Trim() == textBox2.Text) { yhm = textBox1.Text; if (d.cx(g).Trim() == \ { Form2 f2 = new Form2(); f2.Show(); } else { Form3 f3 = new Form3(); f3.Show(); } this.Hide(); } else { label3.Text = \账号或密码错误,请重新输入!\ } } } } 管理员窗口Form2的代码: using System; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Text; namespace chaoshiguanlixitong { public partial class Form2 : Form { Sjk shujuku = new Sjk(); //定义一个数据库的对象 public static string hh, hl;//想xinhuo窗体传递参数 public Form2() { InitializeComponent(); } private void Form2_Load(object sender, EventArgs e) { // TODO: 这行代码将数据加载到表“csglDataSet1.xsb”中。您可以根据需要移动或删除它。 // TODO: 这行代码将数据加载到表“csglDataSet1.spxx”中。您可以根据需要移动或删除它。 // TODO: 这行代码将数据加载到表“csglDataSet.denglu”中。您可以根据需要移动或删除它。 // TODO: 这行代码将数据加载到表“csglDataSet.spxx”中。您可以根据需要移动或删除它。 string h= \用户名 from denglu where 账号='\+ \ label2.Text = Form1.yhm ; this.Text = shujuku .cx(h)+ \(管理员用户)\ } private void button1_Click(object sender, EventArgs e) { DialogResult k1 = MessageBox.Show(\你确定要退出当前用户切换到另一用户?\ if (k1 == DialogResult.Yes) { this.Close(); Form1 f1 = new Form1(); f1.Show(); } } private void button2_Click(object sender, EventArgs e) { DialogResult k1 = MessageBox.Show(\你确定要退出当前用户?\\MessageBoxButtons.YesNo); if (k1 == DialogResult.Yes) { Application.Exit();} } private void button3_Click(object sender, EventArgs e) { int sl=0; if (jhspbh.Text == \ { MessageBox.Show(\商品编号或数量不能为空!\ else { try //判断输入的进货数量是否为数字 { sl = int.Parse(jhsl.Text); } catch { MessageBox.Show(\请输入正确的商品数量!(商品数量必须为大于0的数字)\ jhsl.Text = \ } if (sl > 0) { string sql = \数量=数量+\\商品编号='\ int i=shujuku.xg(sql); if (i>=0) { if (i == 0) { hh = jhspbh.Text; hl = jhsl.Text; xinhuo xh = new xinhuo(); xh.Show(); xh.Visible = false; if (xh.ShowDialog() == DialogResult.OK) { } } MessageBox.Show(\商品添加成功!\ jhspbh.Text = \ jhsl.Text = \ } else { MessageBox.Show(\打开数据库失败,请重试!\ } } } private void button4_Click(object sender, EventArgs e) //商品查询中的“查询”按钮 { if(spcx.Text ==\ { MessageBox.Show(\你还没输入要查询的商品编号呢!\ else { string sql = \* from spxx where 商品编号='\+ spcx.Text + \ string[] j = shujuku.cx(sql, 7).Split(','); label12 . Text = j[0].ToString(); label13 . Text = j[1].ToString(); label15 . Text = j[2].ToString(); label17 . Text = j[3].ToString(); label19 . Text = j[4].ToString(); label21 . Text = j[5].ToString(); label23 . Text = j[6].ToString(); sql = \出售数量 from xsb where 商品编号='\+ spcx.Text + \ label25.Text = shujuku.qh(sql).ToString(); } } private void button7_Click(object sender, EventArgs e) //人员管理中的删除按钮 { if(ryglxm.Text ==\ { MessageBox.Show(\你还没输入要删除的账号呢,不能删除!\ else { if (ryglxm.Text == label2.Text) ///判断要删除的是不是当前登陆用户

搜索更多关于: C#程序超市管理系统 的文档
C#程序超市管理系统.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c6xhxu73s4u2p7v43zg0p6rgfk15t3500h7h_2.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top