private void toolStripSave_Click(object sender, EventArgs e) { HY_Model.HY_Supplier u = new HY_Model.HY_Supplier(); u.S_gyName = this.gyName.Text.Trim(); u.S_jName = this.jName.Text.Trim(); u.S_Area = this.Area.Text.Trim(); u.S_cpName = this.cpName.Text.Trim(); u.S_name = this.name.Text.Trim(); u.S_tel = this.tel.Text.Trim(); //添加动作 if (intFalg == 1) { bool isEmpty = UserInputCheck(); if (isEmpty == true) { HY_BLL.HY_SupplierBLL hysup = new HY_SupplierBLL(); int res = hysup.com_Supplier(u); if (res > 0) { MessageBoxEx.Show("提示信息:供应商信息添加成功!"); this.Close(); } } } if (intFalg == 2) { bool isEmpty = UserInputCheck(); if (isEmpty == true) { string sql = "Update HY_Supplier set s_gyName='" + this.gyName.Text.Trim() + "',s_jName='" + this.jName.Text.Trim() + "',s_Area='" + this.Area.Text.Trim() + "',s_cpName='" + this.cpName.Text.Trim() + "',s_Name='" + this.name.Text.Trim() + "',s_Tel='" + this.tel.Text.Trim() + "' where s_ID='" + this.label1.Text.Trim() + "'"; int res = hystorbll.com_HY_HY_Storagelslist(sql); if (res > 0) { MessageBoxEx.Show("产品修改成功,确定后关闭窗口!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.None); requistionDate(); this.Close(); } } } }
private void btnDEL_Click(object sender, EventArgs e) { int cid = int.Parse(this.listBoxClass.SelectedValue.ToString());//选择产品类别值 HY_BLL.HY_StorageBLL hystorbll = new HY_StorageBLL(); string sql="delete from HY_CPClass where c_ID='"+cid+"'"; int res = hystorbll.com_HY_HY_Storagelslist(sql); if (res > 0) { MessageBox.Show("提示:成功删除产品类别!"); cp_Class(); } }
private void btnADD_Click(object sender, EventArgs e) { HY_BLL.HY_StorageBLL hystor = new HY_StorageBLL(); string sql = "insert into HY_CPClass(c_Class) values('" + this.c_Class.Text.Trim() + "')"; int res = hystor.com_HY_HY_Storagelslist(sql); if (res > 0) { MessageBox.Show("产品类别添加成功,确定后可继续添加!"); cp_Class(); this.c_Class.Text = "";//清空输入框 } }
private void toolStripSave_Click(object sender, EventArgs e) { if (this.s_Person.Text == string.Empty) { MessageBoxEx.Show("入库人姓名不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error); this.s_Person.Focus(); return; } if (this.s_CID.Text == string.Empty) { MessageBoxEx.Show("厂内编号不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error); this.s_CID.Focus(); return; } if (this.s_Supplier.Text == string.Empty) { MessageBoxEx.Show("供应商名称不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error); this.s_Supplier.Focus(); return; } if (this.s_DDate.Text == "") { MessageBoxEx.Show("到货日期不能为空!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error); this.s_DDate.Focus(); return; } if (this.s_XDate.Text == "") { MessageBoxEx.Show("入库日期不能为空!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error); this.s_XDate.Focus(); return; } if (this.s_Price.Text == string.Empty) { MessageBoxEx.Show("产品单价不能为空", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error); this.s_Price.Focus(); return; } HY_Model.HY_Storage hystormodel = new HY_Model.HY_Storage(); hystormodel.S_DID = this.s_DID.Text; hystormodel.S_CID = this.s_CID.Text.Trim(); hystormodel.S_Person = this.s_Person.Text.Trim(); hystormodel.S_Class = this.s_Class.Text; hystormodel.S_Warehouse = this.s_Warehouse.Text; hystormodel.S_XDate = Convert.ToDateTime(this.s_XDate.Value); hystormodel.S_DDate = Convert.ToDateTime(this.s_DDate.Value); hystormodel.S_PID = this.s_PID.Text; hystormodel.S_Pname = this.s_Pname.Text.Trim(); hystormodel.S_Specifications = this.s_Specifications.Text.Trim(); hystormodel.S_Units = this.s_Units.Text.Trim(); hystormodel.S_Amount = int.Parse(this.s_Amount.Text.Trim()); hystormodel.S_Price = float.Parse(this.s_Price.Text.Trim()); hystormodel.S_Notes = this.s_Notes.Text.Trim(); hystormodel.S_Origin = this.s_Origin.Text.Trim(); hystormodel.S_Supplier = this.s_Supplier.Text.Trim(); if (intFalg == 1) { string sql = "insert into HY_Storage(s_DID,s_CID,s_Person,s_Class,s_Warehouse,s_XDate,s_DDate,s_PID,s_Pname,s_Specifications,s_Units,s_Amount,s_Price,s_Notes,s_Origin,s_Supplier) values('" + hystormodel.S_DID + "','" + hystormodel.S_CID + "','" + hystormodel.S_Person + "','" + hystormodel.S_Class + "','" + hystormodel.S_Warehouse + "','" + hystormodel.S_XDate + "','" + hystormodel.S_DDate + "','" + hystormodel.S_PID + "','" + hystormodel.S_Pname + "','" + hystormodel.S_Specifications + "','" + hystormodel.S_Units + "','" + hystormodel.S_Amount + "','" + hystormodel.S_Price + "','" + hystormodel.S_Notes + "','" + hystormodel.S_Origin + "','" + hystormodel.S_Supplier + "')"; int res = hystorbll.com_HY_HY_Storagelslist(sql); if (res > 0) { //写入log库存表 string sqllog = "insert into HY_StorageLog(s_DID,s_CID,s_Person,s_Class,s_Warehouse,s_XDate,s_DDate,s_PID,s_Pname,s_Specifications,s_Units,s_Amount,s_Price,s_Notes,s_Origin,s_Supplier) values('" + hystormodel.S_DID + "','" + hystormodel.S_CID + "','" + hystormodel.S_Person + "','" + hystormodel.S_Class + "','" + hystormodel.S_Warehouse + "','" + hystormodel.S_XDate + "','" + hystormodel.S_DDate + "','" + hystormodel.S_PID + "','" + hystormodel.S_Pname + "','" + hystormodel.S_Specifications + "','" + hystormodel.S_Units + "','" + hystormodel.S_Amount + "','" + hystormodel.S_Price + "','" + hystormodel.S_Notes + "','" + hystormodel.S_Origin + "','" + hystormodel.S_Supplier + "')"; hystorbll.com_HY_HY_Storagelslist(sqllog); MessageBoxEx.Show("产品入库成功,确定后可继续添加", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.None); requistionDate(); f_PID(); //品号 f_CID(); //单号 this.s_CID.Focus(); this.s_CID.Text = ""; this.s_Person.Text = ""; this.s_Class.Text = ""; this.s_Warehouse.Text = ""; this.s_Pname.Text = ""; this.s_Specifications.Text = ""; this.s_Amount.Text = ""; this.s_Price.Text = ""; this.s_Notes.Text = ""; } } if (intFalg == 2) { string sql = "Update HY_Storage set s_DID='" + hystormodel.S_DID + "',s_CID='" + hystormodel.S_CID + "',s_Person='" + hystormodel.S_Person + "',s_Class='" + hystormodel.S_Class + "',s_Warehouse='" + hystormodel.S_Warehouse + "',s_XDate='" + Convert.ToDateTime(this.s_XDate.Value) + "',s_DDate='" + Convert.ToDateTime(this.s_DDate.Value) + "',s_Pname='" + hystormodel.S_Pname + "',s_Specifications='" + hystormodel.S_Specifications + "',s_Amount='" + hystormodel.S_Amount + "',s_Price='" + hystormodel.S_Price + "',s_Notes='" + hystormodel.S_Notes + "' where s_PID='" + hystormodel.S_PID + "'"; int res = hystorbll.com_HY_HY_Storagelslist(sql); if (res > 0) { //写入log库存表 //string sqllog = "insert into HY_StorageLog(s_DID,s_CID,s_Person,s_Class,s_Warehouse,s_XDate,s_DDate,s_PID,s_Pname,s_Specifications,s_Amount,s_Price,s_Notes) values('" + hystormodel.S_DID + "','" + hystormodel.S_CID + "','" + hystormodel.S_Person + "','" + hystormodel.S_Class + "','" + hystormodel.S_Warehouse + "','" + hystormodel.S_XDate + "','" + hystormodel.S_DDate + "','" + hystormodel.S_PID + "','" + hystormodel.S_Pname + "','" + hystormodel.S_Specifications + "','" + hystormodel.S_Amount + "','" + hystormodel.S_Price + "','" + hystormodel.S_Notes + "')"; //hystorbll.com_HY_HY_Storagelslist(sqllog); MessageBoxEx.Show("产品修改成功,确定后可继续操作", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.None); f_Back(); requistionDate(); this.s_CID.Text = ""; this.s_Person.Text = ""; this.s_Class.Text = ""; this.s_Warehouse.Text = ""; this.s_Pname.Text = ""; this.s_Specifications.Text = ""; this.s_Amount.Text = ""; this.s_Price.Text = ""; this.s_Notes.Text = ""; this.groupBox1.Enabled = false; this.groupBox2.Enabled = false; this.groupBox3.Enabled = true; } } }
//追加补货信息 private void btnADDOK_Click(object sender, EventArgs e) { if (this.s_Specifications.Text.Trim() == string.Empty) { MessageBoxEx.Show("产品规格不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.s_Specifications.Focus(); return; } if (this.s_Price.Text.Trim() == string.Empty) { MessageBoxEx.Show("产品单价不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.s_Price.Focus(); return; } if (!IsNumber(this.s_Price.Text.Trim())) { MessageBoxEx.Show("产品单价只能为数字,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.s_Price.Focus(); return; } if (this.s_Amount.Text.Trim() == string.Empty) { MessageBoxEx.Show("产品数量不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.s_Amount.Focus(); return; } if (!IsNumber(this.s_Amount.Text.Trim())) { MessageBoxEx.Show("产品数量只能为数字,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.s_Amount.Focus(); return; } HY_Model.HY_Storage hystormodel = new HY_Model.HY_Storage(); hystormodel.S_DID = this.s_DID.Text; hystormodel.S_CID = this.s_CID.Text; hystormodel.S_Person = this.s_Person.Text; hystormodel.S_Class = this.s_Class.Text; hystormodel.S_Warehouse = this.s_Warehouse.Text; hystormodel.S_XDate = Convert.ToDateTime(this.s_XDate.Value); hystormodel.S_DDate = Convert.ToDateTime(this.s_DDate.Value); hystormodel.S_PID = this.s_PID.Text; hystormodel.S_Pname = this.s_Pname.Text.Trim(); hystormodel.S_Specifications = this.s_Specifications.Text.Trim(); hystormodel.S_Amount = int.Parse(this.s_Amount.Text.Trim()); hystormodel.S_Price = int.Parse(this.s_Price.Text.Trim()); hystormodel.S_Notes = this.s_Notes.Text.Trim(); string str_DID = this.listView1.SelectedItems[0].SubItems[0].Text; HY_BLL.HY_StorageBLL hystorbll = new HY_StorageBLL(); string sql = "update HY_Storage set s_Amount=s_Amount+'" + hystormodel.S_Amount + "',s_Price='" + hystormodel.S_Price + "' where s_PID='" + str_DID + "'"; int res = hystorbll.com_HY_HY_Storagelslist(sql); if (res > 0) { //写入log库存表 string sqllog = "insert into HY_StorageLog(s_DID,s_CID,s_Person,s_Class,s_Warehouse,s_XDate,s_DDate,s_PID,s_Pname,s_Specifications,s_Amount,s_Price,s_Notes,s_State) values('" + hystormodel.S_DID + "','" + hystormodel.S_CID + "','" + hystormodel.S_Person + "','" + hystormodel.S_Class + "','" + hystormodel.S_Warehouse + "','" + hystormodel.S_XDate + "','" + hystormodel.S_DDate + "','" + hystormodel.S_PID + "','" + hystormodel.S_Pname + "','" + hystormodel.S_Specifications + "','" + hystormodel.S_Amount + "','" + hystormodel.S_Price + "','" + hystormodel.S_Notes + "','添加补货')"; hystorbll.com_HY_HY_Storagelslist(sqllog); MessageBoxEx.Show("预警产品追加成功,确认后继续追加!", "操作提示", MessageBoxButtons.OK); string sql4 = "select * from HY_Storage order by s_ID desc"; requistionDate(sql4); } }