protected void btnSaveClose_Click(object sender, EventArgs e) { #region//插入basis表 , 更新母批剩余数量 ,子批flowidno为当点站=========================================== //==============不分批子批长度取母批的长度 modify by lei.xue on 2017-5-28================================== string SplitLength = ""; if (cbxSplit.Checked == true) { SplitLength = txtSplitLength.Text; } else { //母批直接分批的时候改为分批长度取剩余长度 modify by lei.xue on 2017-8-19 //SplitLength = txtPreLength.Text; SplitLength = txtRestLength.Text; } LotBasisDatalist dl = new LotBasisDatalist(); DataTable dt = (DataTable)ViewState["lotDt"]; dl.flowid = dt.Rows[0]["flowid"].ToString(); dl.workshopid = ddlWorkshop.SelectedValue; dl.lottype = "Film"; dl.status = "Active"; dl.createuser = System.Web.HttpContext.Current.Request.Cookies["userID"].Value.ToString(); dl.currentflowidno = (Convert.ToInt32(dt.Rows[0]["flowidno"].ToString()) + 1).ToString(); //流程编号加1 dl.factoryid = ""; dl.workorder = ViewState["WO"].ToString(); dl.reworkorder = ""; dl.lotid = txtLabelInfo.Text; dl.lotcount = dt.Rows[0]["lotcount"].ToString(); dl.ProcessComplete = "N"; //dl.UVCompleteLotid = txtLot.Text; dl.length = SplitLength; //txtSplitLength.Text; //================剩余长度和宽度为母批的有效长度和宽度modify by lei.xue on 2017-6-1============= dl.restlength = txtValidLength.Text; //SplitLength;//txtSplitLength.Text; dl.width = txtPreWidth.Text; dl.restwidth = txtValidWidth.Text; //txtPreWidth.Text; dl.Filmlevel = "A"; dl.eqpid = ddlEqp.SelectedValue; //增加有效幅宽 add by lei.xue on 2017-4-18================================================= dl.validwidth = txtValidWidth.Text; //================增加有效长度 add by lei.xue on 2017-5-28================================= dl.validlength = txtValidLength.Text; string result = CreateMouldLot.InsertLot(dl); if (result != "success") { JScript.Alert(result, this); return; } #endregion #region//插入分批记录到分批表=============================================================== dl.sublotid = txtLabelInfo.Text; dl.lotid = txtLot.Text; string resultsplit = PasteFilm.InsertSplitLot(dl); #endregion #region //更新母批剩余数量=================================================================== Decimal rest = Convert.ToDecimal(txtRestLength.Text) - Convert.ToDecimal(SplitLength); //txtSplitLength.Text); string strRest = PasteFilm.UpdateParentQty(txtLot.Text, rest.ToString(), "Length"); if (strRest != "success") { JScript.Alert("更新母批剩余数量失败!", this); return; } #endregion string resultCheckout = UVBack.FilmCheckOut(txtLabelInfo.Text, "", ddlEqp.SelectedValue, ddlWorkshop.SelectedValue, lblWorksiteID.Text, System.Web.HttpContext.Current.Request.Cookies["userID"].Value.ToString(), txtMouldLot.Text, txtHaze.Text, ddlGlueType.SelectedValue ); if (resultCheckout == "success") { //JScript.AlertAndRedirect("UV背涂过站成功!", "UVBack.aspx", this); //ClearInfo(); //打印标签调用前台方法 //ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>PrintLabel();</script>"); //ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>PrintLabel('" + txtLabelInfo.Text + "','../Product/UVBack.aspx');</script>"); ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>PrintLabel('" + txtLabelInfo.Text + "','../Product/UVBack.aspx','" + txtProductType.Text + "');</script>"); } else { JScript.Alert("UV背涂过站失败!", this); return; } }
protected void btnSaveClose_Click(object sender, EventArgs e) { #region//分批条码改为可以手动输入,判断条码是否已经存在 add by lei.xue on 2017-11-8 string strExistSubLot = FilmCRUD.ExistSublot(txtLot.Text, txtLabelInfo.Text); if (strExistSubLot == "success") { JScript.Alert("该分批条码已经存在", this); return; } #endregion //插入basis表 , 更新母批剩余数量 ,子批flowidno为当点站 string SplitLength = ""; if (cbxSplit.Checked == true) { SplitLength = txtSplitLength.Text; } else { //母批直接分批的时候改为分批长度取剩余长度 modify by lei.xue on 2017-8-19 //SplitLength = txtPreLength.Text; SplitLength = txtRestLength.Text; } LotBasisDatalist dl = new LotBasisDatalist(); DataTable dt = (DataTable)ViewState["lotDt"]; dl.flowid = dt.Rows[0]["flowid"].ToString(); dl.workshopid = ddlWorkshop.SelectedValue; dl.lottype = "Film"; dl.status = "Active"; dl.createuser = System.Web.HttpContext.Current.Request.Cookies["userID"].Value.ToString(); dl.currentflowidno = (Convert.ToInt32(dt.Rows[0]["flowidno"].ToString()) + 1).ToString(); //流程编号加1 dl.factoryid = ""; dl.workorder = ViewState["WO"].ToString(); dl.reworkorder = ""; dl.lotid = txtLabelInfo.Text; dl.lotcount = dt.Rows[0]["lotcount"].ToString(); dl.ProcessComplete = "N"; dl.UVCompleteLotid = txtLot.Text; dl.length = SplitLength; //txtSplitLength.Text; //================剩余长度和宽度为母批的有效长度和宽度modify by lei.xue on 2017-6-1============= dl.restlength = txtValidLength.Text; //SplitLength;//txtSplitLength.Text; dl.width = txtPreWidth.Text; dl.restwidth = txtValidWidth.Text; //txtPreWidth.Text; dl.Filmlevel = "A"; //增加贴膜设备编号 add by lei.xue on 2017-2-22 dl.eqpid = ddlEqp.SelectedValue; //增加有效幅宽 add by lei.xue on 2017-4-19 dl.validwidth = txtValidWidth.Text; //增加有效长度 add by lei.xue on 2017-6-11 dl.validlength = txtValidLength.Text; string result = CreateMouldLot.InsertLot(dl); if (result != "success") { JScript.Alert(result, this); return; } //插入分批记录到分批表 dl.sublotid = txtLabelInfo.Text; dl.lotid = txtLot.Text; string resultsplit = PasteFilm.InsertSplitLot(dl); //更新母批剩余数量 Decimal rest = Convert.ToDecimal(txtRestLength.Text) - Convert.ToDecimal(SplitLength);//txtSplitLength.Text ); string strRest = PasteFilm.UpdateParentQty(ViewState["originalLot"].ToString(), rest.ToString(), "Length"); if (strRest != "success") { JScript.Alert("更新母批剩余数量失败!", this); return; } if (result != "success" || resultsplit != "success") { JScript.Alert("创建贴膜条码失败!", this); return; } //子批过站记录 add by lei.xue on 2017-4-26========================================= string strWipinfo = PasteFilm.FilmCheckOut(txtLabelInfo.Text, ddlEqp.SelectedValue, ddlWorkshop.SelectedValue, lblWorksiteID.Text, System.Web.HttpContext.Current.Request.Cookies["userID"].Value.ToString()); if (strWipinfo == "fail") { JScript.Alert("子批过站记录失败!", this); return; } ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>PrintLabel('" + txtLabelInfo.Text + "','../Product/PasteFilm.aspx','" + txtProductType.Text + "');</script>"); //JScript.Alert("创建贴膜条码成功!", this); }
protected void btnSaveClose_Click(object sender, EventArgs e) { //插入basis表 , 更新母批剩余数量 ,子批flowidno为当点站 LotBasisDatalist dl = new LotBasisDatalist(); DataTable dt = (DataTable)ViewState["lotDt"]; dl.flowid = dt.Rows[0]["flowid"].ToString(); dl.workshopid = ddlWorkshop.SelectedValue; dl.lottype = "Film"; dl.status = "Active"; dl.createuser = System.Web.HttpContext.Current.Request.Cookies["userID"].Value.ToString(); dl.currentflowidno = (Convert.ToInt32(dt.Rows[0]["flowidno"].ToString()) + 1).ToString(); //流程编号加1 dl.factoryid = ""; dl.workorder = ViewState["WO"].ToString(); dl.reworkorder = ""; dl.lotid = txtLabelInfo.Text; dl.lotcount = dt.Rows[0]["lotcount"].ToString(); dl.ProcessComplete = "N"; //dl.UVCompleteLotid = txtLot.Text; dl.length = txtPreLength.Text; dl.restlength = txtPreLength.Text; dl.width = txtSplitWidth.Text; dl.restwidth = txtSplitWidth.Text; dl.Filmlevel = "A"; dl.eqpid = ddlEqp.SelectedValue; //=====================增加有效幅宽 add by lei.xue on 2017-5-24================================= dl.validwidth = txtSplitWidth.Text; string result = CreateMouldLot.InsertLot(dl); if (result != "success") { JScript.Alert(result, this); return; } //插入分批记录到分批表 dl.sublotid = txtLabelInfo.Text; dl.lotid = txtLot.Text; string resultsplit = PasteFilm.InsertSplitLot(dl); //更新母批剩余数量 Decimal rest = Convert.ToDecimal(txtRestWidth.Text) - Convert.ToDecimal(txtSplitWidth.Text); string strRest = PasteFilm.UpdateParentQty(ViewState["originalLot"].ToString(), rest.ToString(), "Width"); if (strRest != "success") { JScript.Alert("更新母批剩余数量失败!", this); return; } if (result != "success" || resultsplit != "success") { JScript.Alert("创建分批条码失败!", this); return; } //子批过站记录 add by lei.xue on 2017-4-26========================================= string strWipinfo = Subsection.FilmCheckOut(txtLabelInfo.Text, ddlEqp.SelectedValue, ddlWorkshop.SelectedValue, lblWorksiteID.Text, System.Web.HttpContext.Current.Request.Cookies["userID"].Value.ToString()); if (strWipinfo == "fail") { JScript.Alert("子批过站记录失败!", this); return; } ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>PrintLabel('" + txtLabelInfo.Text + "','../Product/Subsection.aspx');</script>"); //JScript.Alert("创建贴膜条码成功!", this); }