1、课程设计代码 用户登录using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using System.Data.SqlClient;using System.Configuration;namespace jinxiaocunSystem pu
2、blic partial class 用户登录: Form private string strcon = ConfigurationManager.ConnectionStringsDbLink.ToString(); public 用户登录() InitializeComponent(); private void button1_Click(object sender, EventArgs e)/登录 Common.Name = this.textBox1.Text; string usernumber = textBox1.Text.Trim(); string passward =
3、textBox2.Text.Trim(); int p = 0; int q = 0; SqlConnection connection = new SqlConnection(strcon); connection.Open(); if (connection.State.ToString() = Open) string sqls = Select * from Enter; SqlDataAdapter da = new SqlDataAdapter(sqls, connection); DataSet ds = new DataSet(); da.Fill(ds, Enter); fo
4、r (int i = 0; i ds.Tables0.Rows.Count; i+) if (Convert.ToInt32(ds.Tables0.RowsiproductShu) 1000) q = q + 1; connection.Close(); if (radioButton1.Checked)/系统管理员登陆 string strsql = select count(*) from Enterlable where usenumber= + textBox1.Text.Trim() + and password= + textBox2.Text.Trim() + and role=
5、 + radioButton1.Text + ; SqlCommand cmd = new SqlCommand(strsql, connection); connection.Open(); int i = (int)cmd.ExecuteScalar(); if (i 0) Form1 aa = new Form1(); aa.Show(); this.Hide(); else MessageBox.Show(请输入登录信息, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Stop); else if (radioButton2.Chec
6、ked)/部门经理登录 string strsql = select count(*) from Enterlable where usenumber= + textBox1.Text.Trim() + and password= + textBox2.Text.Trim() + and role= + radioButton2.Text + ; SqlCommand cmd = new SqlCommand(strsql, connection); connection.Open(); int i = (int)cmd.ExecuteScalar(); if (i 0) Form4 aa =
7、 new Form4(); aa.Show(); this.Hide(); else MessageBox.Show(请输入登录信息, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Stop); else if (radioButton3.Checked)/仓库管理员登陆 string strsql = select count(*) from Enterlable where usenumber= + textBox1.Text.Trim() + and password= + textBox2.Text.Trim() + and role
8、= + radioButton3.Text + ; SqlCommand cmd = new SqlCommand(strsql, connection); connection.Open(); int i = (int)cmd.ExecuteScalar(); if (i 0) if (p 0 | q 0) MessageBox.Show(有 + p + 种产品不足需采购,有 + q + 种产品过多停止采购); Form2 aa = new Form2(); aa.Show(); this.Hide(); else MessageBox.Show(请输入登录信息, 错误提示, Message
9、BoxButtons.OKCancel, MessageBoxIcon.Stop); else MessageBox.Show(请选择登录权限, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Stop); connection.Close(); private void 用户登录_Load(object sender, EventArgs e) 仓库管理员模块using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;u
10、sing System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using System.Data.SqlClient;using System.Configuration;namespace jinxiaocunSystem public partial class Form2 : Form private string strcon = ConfigurationManager.ConnectionStringsDbLink.ToS
11、tring(); public Form2() InitializeComponent(); private void 修改密码_Click(object sender, EventArgs e) 修改密码 aa = new 修改密码(); aa.Show(); private void 出货管理_Click(object sender, EventArgs e) 删除采购 aa = new 删除采购(); aa.Show(); private void 进货管理_Click(object sender, EventArgs e) 添加 aa = new 添加(); aa.Show(); pr
12、ivate void button1_Click(object sender, EventArgs e) 修改采购 aa = new 修改采购(); aa.Show(); private void button2_Click(object sender, EventArgs e) 查询采购 aa = new 查询采购(); aa.Show(); private void button3_Click(object sender, EventArgs e) 入库 aa = new 入库(); aa.Show(); private void button4_Click(object sender,
13、EventArgs e) 出库 aa = new 出库); aa.Show(); private void button5_Click(object sender, EventArgs e) 库存信息查询 aa = new 库存信息查询(); aa.Show(); private void button6_Click(object sender, EventArgs e) 用户登录 aa = new 用户登录(); aa.Show(); this.Hide(); 经理管理模块using System;using System.Collections.Generic;using System.C
14、omponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace jinxiaocunSystem public partial class Form4 : Form public Form4() InitializeComponent(); private void 信息查询_Click(object sender, EventArgs e) 查询采购 aa = new 查询采购(); aa.Show();
15、private void 修改密_Click(object sender, EventArgs e) 修改密码 aa = new 修改密码(); aa.Show(); private void button3_Click(object sender, EventArgs e) 用户登录 aa = new 用户登录(); aa.Show(); this.Hide(); private void button1_Click(object sender, EventArgs e) 库存查询 aa = new 库存查询(); aa.Show(); 系统管理模块using System;using Sy
16、stem.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace jinxiaocunSystem public partial class Form1 : Form public Form1() InitializeComponent(); private void 退出系统_Click(object sender, EventAr
17、gs e) 用户登录 aa = new 用户登录(); aa.Show(); this.Hide(); private void button1_Click(object sender, EventArgs e) 系统管理 aa = new 系统管理(); aa.Show(); private void button3_Click(object sender, EventArgs e) 查询采购 aa = new 查询采购(); aa.Show(); private void button4_Click(object sender, EventArgs e) 库存查询 aa = new 库存查
18、询(); aa.Show(); private void button2_Click(object sender, EventArgs e) 修改密码系统_管理员_ aa = new 修改密码_系统管理员_(); aa.Show(); 修改密码using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;
19、using System.Windows.Forms;using System.Configuration;using System.Data.SqlClient;namespace jinxiaocunSystem public partial class 修改密码 : Form private string strcon = ConfigurationManager.ConnectionStringsDbLink.ToString(); public 修改密码() InitializeComponent(); private void 确认_Click(object sender, Eve
20、ntArgs e) if (textBox1.Text.Trim() = textBox2.Text.Trim() SqlConnection connection = new SqlConnection(strcon); connection.Open(); String strsql1 = select count(*) from Enterlable where usenumber= + textBox3.Text.Trim() + and password= + textBox4.Text.Trim() + ; SqlCommand cmd1 = new SqlCommand(strs
21、ql1, connection); int i = (int)cmd1.ExecuteScalar(); if(i0) string strsql = update EnterLable set password = + textBox1.Text.Trim() + where usenumber= + textBox3.Text.Trim() + ; SqlCommand cmd = new SqlCommand(strsql, connection); int iresult = cmd.ExecuteNonQuery(); if (iresult 0) MessageBox.Show(信
22、息更改成功); connection.Close(); else MessageBox.Show(信息更改失败); connection.Close(); else MessageBox.Show(旧密码?输?入?错洙?误); connection.Close(); else MessageBox.Show(两次密码不一样,请重新输入, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Stop); return; private void 取消_Click(object sender, EventArgs e) Form4 aa = new F
23、orm4(); aa.Show(); This.Hide(); 修改采购using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;using System.Configuration;namespace jinxiaocunSystem public
24、 partial class 修改采购: Form private string strcon = ConfigurationManager.ConnectionStringsDbLink.ToString(); public 修改采购() InitializeComponent(); private void 修改采购_Load(object sender, EventArgs e) this.gRNTableAdapter.Fill(this.jinxiaocunSystemDataSet2.GRN); private void button1_Click(object sender, E
25、ventArgs e) SqlConnection connection = new SqlConnection(strcon); connection.Open(); if (connection.State.ToString() = Open) if (textBox1.Text != & textBox2.Text != & textBox3.Text != & textBox4.Text != & textBox5.Text != & textBox6.Text != & textBox7.Text != & textBox8.Text != ) string strsql = upd
26、ate GRN set Credentialsnumber= + textBox1.Text.Trim() + ,CKnumber= + textBox2.Text.Trim() + ,Goodsnumber= + textBox3.Text.Trim() + ,Goodnumber= + textBox4.Text.Trim() + ,Inunit= + textBox5.Text.Trim() + ,Incktime= + textBox6.Text.Trim() + ,Makingpeople= + textBox7.Text.Trim() + ,Purchasingpeople= +
27、textBox8.Text.Trim() + where Credentialsnumber= + textBox1.Text.Trim() + ; SqlCommand cmda = new SqlCommand(strsql, connection); int iresult = cmda.ExecuteNonQuery(); if (iresult 0) MessageBox.Show(修改信息成功); this.gRNTableAdapter.Fill(this.jinxiaocunSystemDataSet2.GRN); else MessageBox.Show(修改信息失骸败, 错
28、误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Stop); return; else MessageBox.Show(修改信息不能为空?, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Stop); return; connection.Close(); private void button2_Click(object sender, EventArgs e) textBox1.Text = null; textBox2.Text = null; textBox3.Text = null; textBox4.Text = null; textBox5.Text = null; textBox6.Text = null; textBox7.Text = null; textBox8.Text = null; 添加采购using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using Sy
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1