Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    protected void btnSaveClose_Click(object sender, EventArgs e)
    {
        //string result = UVComplete.FilmCheckOut(txtLot.Text,
        //                      txtLabelInfo.Text,
        //                      ddlEqp.SelectedValue,
        //                      ddlWorkshop.SelectedValue,
        //                      lblWorksiteID.Text,
        //                      System.Web.HttpContext.Current.Request.Cookies["userID"].Value.ToString(),
        //                      txtPreLength.Text,
        //                      txtPreWidth.Text,
        //                      txtRestLength.Text,
        //                      txtSplitLength.Text,
        //                      txtMouldLot.Text,
        //                      txtDKWidth.Text,
        //                      txtMouldStructure.Text,
        //                      txtMouldPitch.Text,
        //                      ddlGlueType.SelectedValue
        //                      );

        //if (result == "success")
        //{
        //    JScript.Alert("UV成型过站成功!", this);
        //    //ClearInfo();
        //    //打印标签调用前台方法
        //    //ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>PrintLabel();</script>");
        //    ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>PrintLabel('" + txtLabelInfo.Text + "','../Product/UVComplete.aspx');</script>");
        //    return;
        //}
        //else
        //{
        //    JScript.Alert("UV成型过站失败!", this);
        //    return;
        //}

        #region//分批条码改为手动输入,判断条码是否已经存在 add by lei.xue on 2017-4-18
        string strExistSubLot = FilmCRUD.ExistSublot(txtLot.Text, txtLabelInfo.Text);
        if (strExistSubLot == "success")
        {
            JScript.Alert("该分批条码已经存在", this);
            return;
        }
        #endregion

        #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);
        string  strRest = PasteFilm.UpdateParentQty(txtLot.Text, rest.ToString(), "Length");
        if (strRest != "success")
        {
            JScript.Alert("更新母批剩余数量失败!", this);
            return;
        }
        #endregion
        #region//记录绑定的模具信息和胶水规格 modify by lei.xue on 2017-3-27================================
        string resultWipInfo = UVComplete.FilmCheckOut(txtLabelInfo.Text,
                                                       "",
                                                       ddlEqp.SelectedValue,
                                                       ddlWorkshop.SelectedValue,
                                                       lblWorksiteID.Text,
                                                       System.Web.HttpContext.Current.Request.Cookies["userID"].Value.ToString(),
                                                       txtMouldLot.Text,
                                                       txtDKWidth.Text,
                                                       txtMouldStructure.Text,
                                                       txtMouldPitch.Text,
                                                       ddlGlueType.SelectedValue
                                                       );
        if (strRest != "success")
        {
            JScript.Alert("记录绑定的模具信息和胶水规格失败!", this);
            return;
        }
        #endregion
        if (result != "success" || resultsplit != "success")
        {
            JScript.Alert("创建UV成型条码失败!", this);
            return;
        }
        //ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>PrintLabel('" + txtLabelInfo.Text + "','../Product/UVComplete.aspx');</script>");
        ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>PrintLabel('" + txtLabelInfo.Text + "','../Product/UVComplete.aspx','" + txtProductType.Text + "');</script>");
    }