protected void btnSaveClose_Click(object sender, EventArgs e) { DataTable viewdt = (DataTable)ViewState["dt"]; if (viewdt.Rows.Count <= 0) { JScript.Alert("请先生成PET编号,在文本框输入数量按回车!", this); return; } //循环datatable插入lotbasis for (int i = 0; i <= grd.Rows.Count - 1; i++) { //CheckBox cbx = (CheckBox)grd.Rows[i].FindControl("cbx"); //if (cbx.Checked == true) //{ // //result = EqpManage.Delete(grd.Rows[i].Cells[1].Text); // //if (result != "success") // //{ // // JScript.Alert("删除设备!", this); // //} //} LotBasisDatalist dl = new LotBasisDatalist(); dl.flowid = txtWorkflowID.Text; dl.workshopid = txtWorkshopID.Text; dl.lottype = "Film"; dl.status = "Active"; dl.createuser = System.Web.HttpContext.Current.Request.Cookies["userID"].Value.ToString(); dl.currentflowidno = "0"; dl.factoryid = ""; dl.workorder = txtWorkOrder.Text;//ddlWorkorder.SelectedValue; dl.reworkorder = ""; dl.lotid = grd.Rows[i].Cells[0].Text; dl.lotcount = "1"; dl.Filmlevel = "A"; //创建批次增加宽度和长度记录 //批次长宽改为手动输入 modify by lei.xue on 2017-4-12================================================ //dl.length = txtMouldLength.Text; //dl.restlength = txtMouldLength.Text; //dl.width = txtMouldWidth.Text; //dl.restwidth = txtMouldWidth.Text; dl.length = txtLotLength.Text; dl.restlength = txtLotLength.Text; dl.width = txtLotWidth.Text; dl.restwidth = txtLotWidth.Text; string result = CreateMouldLot.InsertLot(dl); if (result != "success") { JScript.Alert("创建PET膜序列号失败!", this); return; } JScript.Alert("创建PET膜序列号成功!", this); ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>PrintLabel();</script>"); //CreateTable(); //databind(); //txtLotCount.Text = ""; } }
public static string InsertLot(LotBasisDatalist list) { //批次是否已经创建 add by lei.xue on 2017-6-2 if (CreateMouldLot.LotExist(list.lotid) == "success") { return("批次已存在!"); } string sql = "insert into jh_mes.tlotbasis(lotid,workorder,reworkorder,status,factoryid,workshopid," + " flowidno,worksitename,checkintime,checkouttime,createtime,createuser,flowid,lottype,lotcount,filmlevel,uvcompletelotid,pastefilmlotid,mouldlength,restlength,mouldwidth,restwidth,eqpid,validwidth,validlength" + ")values (" + "'" + list.lotid + "'," + "'" + list.workorder + "'," + "'" + list.reworkorder + "'," + "'" + list.status + "'," + "'" + list.factoryid + "'," + "'" + list.workshopid + "'," + "'" + list.currentflowidno + "'," + "Null," //worksitename + "Null," //checkintime + "Null," //checkouttime + "sysdate()," //createtime + "'" + list.createuser + "'," + "'" + list.flowid + "'," + "'" + list.lottype + "'," + list.lotcount + "," + "'" + list.Filmlevel + "'," + "'" + list.UVCompleteLotid + "'," + "'" + list.PasteFilmLotid + "'," + "'" + list.length + "'," + "'" + list.restlength + "'," + "'" + list.width + "'," + "'" + list.restwidth + "'," + "'" + list.eqpid + "'," + "'" + list.validwidth + "'," + "'" + list.validlength + "'" + ") ;"; int result = dbhelp.ExecuteNonQuery(sql, null); if (result > 0) { return("success"); } else { return("批次创建失败!"); } }
protected void btnSaveClose_Click(object sender, EventArgs e) { DataTable viewdt = (DataTable)ViewState["dt"]; if (viewdt.Rows.Count <= 0) { JScript.Alert("请先生成模具编号,在文本框输入数量按回车!", this); return; } //循环datatable插入lotbasis for (int i = 0; i <= grd.Rows.Count - 1; i++) { //CheckBox cbx = (CheckBox)grd.Rows[i].FindControl("cbx"); //if (cbx.Checked == true) //{ // //result = EqpManage.Delete(grd.Rows[i].Cells[1].Text); // //if (result != "success") // //{ // // JScript.Alert("删除设备!", this); // //} //} LotBasisDatalist dl = new LotBasisDatalist(); dl.flowid = ddlWorkFlow.SelectedValue; dl.workshopid = ddlWorkshop.SelectedValue; dl.lottype = "Mould"; dl.status = "Active"; dl.createuser = System.Web.HttpContext.Current.Request.Cookies["userID"].Value.ToString(); dl.currentflowidno = "0"; dl.factoryid = ""; dl.reworkorder = ""; dl.lotid = grd.Rows[i].Cells[0].Text; dl.lotcount = "1"; dl.ProcessComplete = "N"; string result = CreateMouldLot.InsertLot(dl); if (result != "success") { JScript.Alert(result, this); return; } JScript.Alert("创建模具编号成功!", this); CreateTable(); databind(); txtLotCount.Text = ""; } }
public static string InsertSplitLot(LotBasisDatalist list) { string sql = "insert into jh_mes.tlotsplit(lotid,sublotid,status,factoryid,workshopid," + " flowidno,worksitename,checkintime,checkouttime,createtime,createuser," + " flowid,lottype,filmlevel,filmlength,restfilmlength,filmwidth,restfilmwidth" + ")values (" + "'" + list.lotid + "'," + "'" + list.sublotid + "'," + "'" + list.status + "'," + "'" + list.factoryid + "'," + "'" + list.workshopid + "'," + "'" + list.currentflowidno + "'," + "Null," //worksitename + "Null," //checkintime + "Null," //checkouttime + "sysdate()," //createtime + "'" + list.createuser + "'," + "'" + list.flowid + "'," + "'" + list.lottype + "'," + "'" + list.Filmlevel + "'," + "'" + list.length + "'," + "'" + list.restlength + "'," + "'" + list.width + "'," + "'" + list.restwidth + "'" + ") ;"; int result = dbhelp.ExecuteNonQuery(sql, null); if (result > 0) { return("success"); } else { return("fail"); } }
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) { #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) { //插入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); }