Example #1
0
        protected void btSave_Click(object sender, EventArgs e)
        {
            GoodInfo    info = new GoodInfo();
            GoodInfoBLL bll  = null;

            try
            {
                UIBindHelper.BindModelByControls(this.Page, info);
                bll = BLLFactory.CreateBLL <GoodInfoBLL>();

                //获取生产计划信息
                ProducePlan plan = new ProducePlanBLL().GetByBatchNumber(info.BatchNumber);
                if (plan != null)
                {
                    info.FACTORYPID   = plan.FACTORYPID;
                    info.PRID         = plan.PRID;
                    info.ProductionID = plan.PRODUCTIONID;
                    info.PLANID       = plan.PID;
                }
                //校验是否有漏序
                string result = new ProcessCheckBLL().CheckMissingProcess(info.BatchNumber, info.ProductionID);
                if (result != "")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myjs", "alert('" + result + "');", true);
                    return;
                }

                bll.Insert(info);
                ClientScript.RegisterStartupScript(this.GetType(), "myjs", "alert('产品完工下线完成');window.location.href='MaterialOffline.aspx';", true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }