private void btnLinkOrder_Click(object sender, System.EventArgs e) { //关联订单 try { ProduceLog pLog = new ProduceLog(); pLog.cnnProduceSerialNo = decimal.Parse(txtProduceSerialNo.Text); pLog.cndProduceDate = DateTime.Parse(txtProduceDate.Text); pLog.cndShipBeginDate = DateTime.Parse(txtShipBeginDate.Text); pLog.cndShipEndDate = DateTime.Parse(txtShipEndDate.Text); pLog.cnvcProduceDeptID = ddlProduceDept.SelectedValue; pLog.cnvcOperID = oper.strLoginID; OperLog operLog = new OperLog(); operLog.cnvcOperID = oper.strLoginID; operLog.cnvcDeptID = oper.strDeptID; operLog.cnvcOperType = "关联订单"; ProduceFacade pFacade = new ProduceFacade(); pFacade.LindOrder(pLog, operLog); Popup("关联订单成功"); btnQueryProduct_Click(null, null); } catch (Exception ex) { Popup(ex.Message); } }
private void DataGrid2_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { //更新计划生产数量 try { OperLog ol = new OperLog(); ol.cnvcOperType = "更新计划生产数量"; ol.cnvcOperID = this.oper.strLoginID; ol.cnvcDeptID = this.oper.strDeptID; ProduceDetail pd = new ProduceDetail(); pd.cnnProduceSerialNo = Convert.ToDecimal(this.txtProduceSerialNo.Text); pd.cnvcInvCode = e.Item.Cells[0].Text; pd.cnnProduceCount = Convert.ToDecimal(((TextBox)e.Item.Cells[6].Controls[0]).Text); ProduceFacade pf = new ProduceFacade(); pf.UpdateProduceDetail(pd, ol); this.DataGrid2.EditItemIndex = -1; btnQueryProduct_Click(null, null); this.Popup("成功更新计划生产数量"); } catch (Exception ex) { this.Popup(ex.Message); } }
private void Button1_Click(object sender, System.EventArgs e) { //预估调整 try { string strProduceSerialNo = this.txtProduceSerialNo.Text; OperLog ol = new OperLog(); ol.cnvcOperID = this.oper.strLoginID; ol.cnvcDeptID = this.oper.strDeptID; ol.cnvcOperType = "调整预估"; //AdjustMakeDetail ProduceFacade pf = new ProduceFacade(); if (this.chkSelf.Checked) { pf.AdjustMakeDetailSelf(strProduceSerialNo, ol); } else { pf.AdjustMakeDetail(strProduceSerialNo, ol); } this.Popup("调整预估成功"); BindGrid(); } catch (Exception ex) { this.Popup(ex.Message); } }
private void btnClear_Click(object sender, System.EventArgs e) { //清除预估数据 // ProduceLog pLog = new ProduceLog(); // pLog.cnnProduceSerialNo = decimal.Parse(txtProduceSerialNo.Text); // pLog.cnvcOperID = oper.strLoginID; OperLog operLog = new OperLog(); operLog.cnvcOperID = oper.strLoginID; operLog.cnvcDeptID = oper.strDeptID; operLog.cnvcOperType = "清除预估数据"; ProduceFacade pf = new ProduceFacade(); try { pf.ClearMake(txtProduceSerialNo.Text, operLog); Popup("清除预估数据成功"); this.DataGrid1.DataSource = null; this.DataGrid1.DataBind(); } catch (Exception ex) { this.Popup(ex.Message); } }
private void btnMakeLog_Click(object sender, System.EventArgs e) { try { ProduceLog pLog = new ProduceLog(); pLog.cnnProduceSerialNo = decimal.Parse(txtProduceSerialNo.Text); pLog.cnvcOperID = oper.strLoginID; OperLog operLog = new OperLog(); operLog.cnvcOperID = oper.strLoginID; operLog.cnvcDeptID = oper.strDeptID; operLog.cnvcOperType = "生产预估"; ProduceFacade pf = new ProduceFacade(); if (chkSelf.Checked) { pf.AddMakeLogSelf(pLog, operLog); } else { pf.AddMakeLog(pLog, operLog); } Popup("预估成功"); BindGrid(); } catch (Exception ex) { Popup(ex.Message); } }
private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { //更新 try { string strProduceSerialNo = this.txtProduceSerialNo.Text; string strMakeSerialNo = e.Item.Cells[0].Text; string strAdjustcount = ((TextBox)e.Item.Cells[12].Controls[0]).Text; string strstcount = ((TextBox)e.Item.Cells[11].Controls[0]).Text; string strinvcode = e.Item.Cells[5].Text; string strmakecount = e.Item.Cells[8].Text; string strcount = e.Item.Cells[13].Text; DataTable dtInv = Application["tbInventory"] as DataTable; DataRow[] drInvs = dtInv.Select("cnvcinvcode='" + strinvcode + "'"); if (drInvs.Length == 0) { throw new Exception("无此存货"); } Entity.Inventory inv = new AMSApp.zhenghua.Entity.Inventory(drInvs[0]); if (!inv.cnbSelf && strAdjustcount != "0") { throw new Exception("非自制存货,不能调整数量"); } // if(Convert.ToDecimal(strmakecount)>Convert.ToDecimal(strcount)+Convert.ToDecimal(strAdjustcount)+Convert.ToDecimal(strstcount)) // throw new Exception("计划生产数量不能大于库存领用量、调整生产数量、生产数量之和"); OperLog ol = new OperLog(); ol.cnvcOperID = this.oper.strLoginID; ol.cnvcDeptID = this.oper.strDeptID; ol.cnvcOperType = "调整数量"; MakeDetail md = new MakeDetail(); md.cnnMakeSerialNo = Convert.ToDecimal(strMakeSerialNo); md.cnnAdjustCount = Convert.ToDecimal(strAdjustcount); md.cnnStCount = Convert.ToDecimal(strstcount); md.cnvcInvCode = strinvcode; ProduceFacade pf = new ProduceFacade(); pf.UpdateMakeDetail(strProduceSerialNo, md, ol); this.Popup("更新调整数量及库存领用量成功"); this.DataGrid1.EditItemIndex = -1; BindGrid(); } catch (Exception ex) { this.Popup(ex.Message); } }
protected void btnPrint_ServerClick(object sender, System.EventArgs e) { try { ProduceFacade pf = new ProduceFacade(); OperLog operLog = new OperLog(); operLog.cnvcOperID = oper.strLoginID; operLog.cnvcDeptID = oper.strDeptID; operLog.cnvcOperType = "发货单"; pf.AssignPrint(txtAssignSerialNo.Text, operLog); } catch (Exception ex) { Popup(ex.Message); } }
private void btnOK_Click(object sender, System.EventArgs e) { try { if (JudgeIsNull(txtProduceDate.Text, "生产日期")) { //Popup(); return; } if (JudgeIsNull(txtShipBeginDate.Text, "开始日期")) { //Popup(); return; } if (JudgeIsNull(txtShipEndDate.Text, "结束日期")) { //Popup(); return; } ProduceLog producePlan = new ProduceLog(); producePlan.cnvcProduceDeptID = ddlProduceDept.SelectedValue; producePlan.cndProduceDate = DateTime.Parse(txtProduceDate.Text); producePlan.cndShipBeginDate = DateTime.Parse(txtShipBeginDate.Text); producePlan.cndShipEndDate = DateTime.Parse(txtShipEndDate.Text); producePlan.cnvcOperID = oper.strLoginID; producePlan.cnvcProduceState = "0"; producePlan.cnbSelf = this.chkSelf.Checked; OperLog operLog = new OperLog(); operLog.cnvcOperID = oper.strLoginID; operLog.cnvcDeptID = oper.strDeptID; operLog.cnvcOperType = "添加生产计划"; ProduceFacade produce = new ProduceFacade(); produce.AddProduceLog(producePlan, operLog); btnCancel_Click(null, null); //this.btnReturn_Click(null,null); //this.Response.Redirect("wfmProducePlanQuery.aspx",true); Popup("生产计划添加成功", "wfmProducePlanQuery.aspx"); } catch (Exception ex) { Popup(ex.Message); } }
protected void btnLinkOrder_Click(object sender, System.EventArgs e) { try { ProduceLog pLog = new ProduceLog(); pLog.cnnProduceSerialNo = decimal.Parse(txtProduceSerialNo.Text); pLog.cndProduceDate = DateTime.Parse(txtProduceDate.Text); pLog.cndShipBeginDate = DateTime.Parse(txtShipBeginDate.Text); pLog.cndShipEndDate = DateTime.Parse(txtShipEndDate.Text); pLog.cnvcProduceDeptID = ddlProduceDept.SelectedValue; pLog.cnvcOperID = oper.strLoginID; OperLog operLog = new OperLog(); operLog.cnvcOperID = oper.strLoginID; operLog.cnvcDeptID = oper.strDeptID; ProduceFacade pFacade = new ProduceFacade(); switch (ViewState["OperType"].ToString()) { case "Order": operLog.cnvcOperType = "关联订单"; pFacade.LindOrder(pLog, operLog); Popup("关联订单成功"); break; case "Add": operLog.cnvcOperType = "关联加单"; pFacade.LindOrderAdd(pLog, operLog); Popup("关联加单成功"); break; case "Reduce": operLog.cnvcOperType = "关联减单"; pFacade.LindOrderReduce(pLog, operLog); Popup("关联减单成功"); break; } } catch (Exception ex) { Popup(ex.Message); } }
private void btnProduce_Click(object sender, System.EventArgs e) { try { OperLog operLog = new OperLog(); operLog.cnvcOperID = oper.strLoginID; operLog.cnvcDeptID = oper.strDeptID; operLog.cnvcOperType = "门市自生产"; ProduceFacade pf = new ProduceFacade(); pf.SelfProduce(txtOrderSerialNo.Text, ddlProduceDept.SelectedValue, operLog); Popup("自生产完成,已更新库存量"); } catch (Exception ex) { Popup(ex.Message); } }
protected void btnOK_Click(object sender, System.EventArgs e) { try { if (JudgeIsNull(txtProduceDate.Text, "生产日期")) { //Popup(); return; } if (JudgeIsNull(txtShipBeginDate.Text, "开始日期")) { //Popup(); return; } if (JudgeIsNull(txtShipEndDate.Text, "结束日期")) { //Popup(); return; } ProduceLog producePlan = new ProduceLog(); producePlan.cnvcProduceDeptID = ddlProduceDept.SelectedValue; producePlan.cndProduceDate = DateTime.Parse(txtProduceDate.Text); producePlan.cndShipBeginDate = DateTime.Parse(txtShipBeginDate.Text); producePlan.cndShipEndDate = DateTime.Parse(txtShipEndDate.Text); producePlan.cnvcOperID = oper.strLoginID; producePlan.cnvcProduceState = "0"; OperLog operLog = new OperLog(); operLog.cnvcOperID = oper.strLoginID; operLog.cnvcDeptID = oper.strDeptID; operLog.cnvcOperType = "添加生产计划"; ProduceFacade produce = new ProduceFacade(); produce.AddProduceLog(producePlan, operLog); Popup("生产计划添加成功"); btnCancel_Click(null, null); } catch (Exception ex) { Popup(ex.Message); } }
protected void btnModify_Click(object sender, System.EventArgs e) { try { if (JudgeIsNull(txtProduceDate.Text, "生产日期")) { //Popup(); return; } if (JudgeIsNull(txtShipBeginDate.Text, "开始日期")) { //Popup(); return; } if (JudgeIsNull(txtShipEndDate.Text, "结束日期")) { //Popup(); return; } ProduceLog pLog = new ProduceLog(); pLog.cnnProduceSerialNo = decimal.Parse(txtProduceSerialNo.Text); pLog.cndProduceDate = DateTime.Parse(txtProduceDate.Text); pLog.cndShipBeginDate = DateTime.Parse(txtShipBeginDate.Text); pLog.cndShipEndDate = DateTime.Parse(txtShipEndDate.Text); pLog.cnvcProduceDeptID = ddlProduceDept.SelectedValue; pLog.cnvcOperID = oper.strLoginID; OperLog operLog = new OperLog(); operLog.cnvcOperID = oper.strLoginID; operLog.cnvcDeptID = oper.strDeptID; operLog.cnvcOperType = "修改生产计划"; ProduceFacade pFacade = new ProduceFacade(); pFacade.UpdateProduceLog(pLog, operLog); Popup("修改成功"); } catch (Exception ex) { Popup(ex.Message); } }
protected void btnMakeLog_Click(object sender, System.EventArgs e) { try { ProduceLog pLog = new ProduceLog(); pLog.cnnProduceSerialNo = decimal.Parse(txtProduceSerialNo.Text); pLog.cnvcOperID = oper.strLoginID; OperLog operLog = new OperLog(); operLog.cnvcOperID = oper.strLoginID; operLog.cnvcDeptID = oper.strDeptID; operLog.cnvcOperType = "订单制令"; ProduceFacade pf = new ProduceFacade(); pf.AddMakeLog(pLog, "0", operLog); Popup("制令成功"); } catch (Exception ex) { Popup(ex.Message); } }
private void DataGrid1_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { if (e.CommandName == "CLOSE") { string strProduceSerialNo = e.CommandArgument.ToString(); OperLog ol = new OperLog(); ol.cnvcOperID = this.oper.strLoginID; ol.cnvcDeptID = this.oper.strDeptID; ol.cnvcOperType = "生产竣工"; ProduceFacade pf = new ProduceFacade(); try { pf.ProduceCLose(strProduceSerialNo, ol); this.Popup("竣工完成"); btnQuery_Click(null, null); } catch (Exception ex) { this.Popup(ex.Message); } } }
private void btnCheck_Click(object sender, System.EventArgs e) { if (Session["tbProduceDetail"] == null) { this.Popup("请首先使用【盘点清单】按钮,查询计划情况"); return; } if (this.JudgeIsNull(txtDays.Text)) { this.Popup("请输入过期天数调整量"); return; } DataTable dtpd = (DataTable)Session["tbProduceDetail"]; ArrayList al = new ArrayList(); DataTable dtInv = Application["tbInventory"] as DataTable; DataTable dtProductClass = Application["tbProductClass"] as DataTable; // string strSql = "select * from tbProduceCheckLog where cnnProduceSerialNo=" + txtProduceSerialNo.Text+" order by cnvcInvCode"; // DataTable dtCheck = Helper.Query(strSql); //foreach(DataGridItem dgi in this.DataGrid1.Items) foreach (DataRow dr in dtpd.Rows) { //Entity.ProduceCheckLog pc = new ProduceCheckLog(dr); string strinvcode = dr["cnvcInvCode"].ToString(); //dgi.Cells[0].Text; string strinvname = dr["cnvcInvName"].ToString(); //dgi.Cells[1].Text; string strincount = dr["cnnInCount"].ToString(); //dgi.Cells[6].Text; //string strwhcount = dgi.Cells[7].Text; bool iswh = Convert.ToBoolean(dr["cnbInWh"].ToString()); //((CheckBox)dgi.Cells[7].Controls[1]).Checked; if (iswh) { this.Popup("已经完成了盘点入库"); return; } decimal dincount = Convert.ToDecimal(strincount); Entity.RdRecordDetail rrd = new RdRecordDetail(); rrd.cnvcInvCode = strinvcode; rrd.cnnQuantity = Convert.ToDecimal(strincount); DataRow[] drInvs = dtInv.Select("cnvcInvCode='" + strinvcode + "'"); if (drInvs.Length == 0) { this.Popup(strinvname + "存货档案未找到"); return; } Entity.Inventory inv = new AMSApp.zhenghua.Entity.Inventory(drInvs[0]); DataRow[] drProductClasses = dtProductClass.Select("cnvcProductClassCode='" + inv.cnvcInvCCode + "'"); if (drProductClasses.Length == 0) { this.Popup(strinvname + "的存货类别未找到"); return; } Entity.ProductClass pc = new ProductClass(drProductClasses[0]); rrd.cnvcGroupCode = inv.cnvcGroupCode; rrd.cnvcComunitCode = inv.cnvcSTComUnitCode; rrd.cnvcFlag = "0"; rrd.cndExpDate = Convert.ToDateTime(this.txtProduceDate.Text).AddDays(pc.cnnDays).AddDays(Convert.ToDouble(txtDays.Text)); //Convert.ToDateTime(this.txtExpDate.Text); rrd.cndMdate = Convert.ToDateTime(this.txtProduceDate.Text); //if(rrd.cnnQuantity == 0)continue; al.Add(rrd); } if (al.Count == 0) { this.Popup("无入库产品,不用生产入库!"); return; } Entity.RdRecord rr = new RdRecord(); rr.cnvcRdCode = "RD009"; rr.cnvcRdFlag = "0"; rr.cnvcWhCode = this.ddlWarehouse.SelectedValue; rr.cnvcDepID = this.ddlProduceDept.SelectedValue; rr.cnvcOperName = this.oper.strOperName; rr.cnvcComments = "生产入库"; rr.cnvcMaker = this.oper.strLoginID; rr.cnnProorderID = Convert.ToDecimal(this.txtProduceSerialNo.Text); rr.cnvcState = "2"; OperLog ol = new OperLog(); ol.cnvcOperID = this.oper.strLoginID; ol.cnvcDeptID = this.oper.strDeptID; ol.cnvcOperType = "生产入库"; string strWarehouse = this.ddlWarehouse.SelectedValue; try { ProduceFacade pf = new ProduceFacade(); pf.CheckInWh(this.txtMakeSerialNo.Text, rr, al, ol, strWarehouse); this.Popup("生产入库成功"); } catch (Exception ex) { this.Popup(ex.Message); } QueryProduceDetail(); BindGrid(); }
private void Button2_Click(object sender, System.EventArgs e) { //领料单打印 ArrayList al = new ArrayList(); DataTable dtInv = Application["tbInventory"] as DataTable; foreach (DataGridItem dgi in this.DataGrid1.Items) { string strinvcode = dgi.Cells[0].Text; string strinvname = dgi.Cells[1].Text; string stroutcount = dgi.Cells[6].Text; string strwhcount = dgi.Cells[7].Text; bool iscollar = ((CheckBox)dgi.Cells[8].Controls[1]).Checked; if (iscollar) { //this.Popup(strinvname+"已经完成了生产材料领用"); this.Popup("已经领用生产材料"); return; } if (!this.JudgeIsNum(strwhcount)) { this.Popup(strinvname + "无库存,不能领用原材料,请检查原材料库存"); return; } decimal doutcount = Convert.ToDecimal(stroutcount); decimal dwhcount = Convert.ToDecimal(strwhcount); if (doutcount > dwhcount) { this.Popup(strinvname + "库存数量不足,不能领用原材料进行生产,请检查原材料库存"); return; } Entity.RdRecordDetail rrd = new RdRecordDetail(); rrd.cnvcInvCode = strinvcode; rrd.cnnQuantity = Convert.ToDecimal(stroutcount); DataRow[] drInvs = dtInv.Select("cnvcInvCode='" + strinvcode + "'"); if (drInvs.Length == 0) { this.Popup(strinvname + "存货档案未找到"); return; } Entity.Inventory inv = new AMSApp.zhenghua.Entity.Inventory(drInvs[0]); rrd.cnvcGroupCode = inv.cnvcGroupCode; rrd.cnvcComunitCode = inv.cnvcSTComUnitCode; rrd.cnvcFlag = "0"; al.Add(rrd); } Entity.RdRecord rr = new RdRecord(); rr.cnvcRdCode = "RD008"; rr.cnvcRdFlag = "0"; rr.cnvcWhCode = this.ddlWarehouse.SelectedValue; rr.cnvcDepID = this.ddlProduceDept.SelectedValue; rr.cnvcOperName = this.oper.strOperName; rr.cnvcComments = "生产材料领用"; rr.cnvcMaker = this.oper.strLoginID; rr.cnnProorderID = Convert.ToDecimal(this.txtProduceSerialNo.Text); rr.cnvcState = "2"; OperLog ol = new OperLog(); ol.cnvcOperID = this.oper.strLoginID; ol.cnvcDeptID = this.oper.strDeptID; ol.cnvcOperType = "生产材料领用"; string strWarehouse = this.ddlWarehouse.SelectedValue; try { ProduceFacade pf = new ProduceFacade(); pf.Collar(this.txtMakeSerialNo.Text, rr, al, ol, strWarehouse); this.Popup("生产材料领用成功"); } catch (Exception ex) { this.Popup(ex.Message); } BindGrid(); }