示例#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;
            }
        }
示例#2
0
        protected void btStart_Click(object sender, EventArgs e)
        {
            LoginInfo       user = (Session["UserInfo"] as LoginInfo) as LoginInfo;
            ProduceTrack    info = new ProduceTrack();
            ProduceTrackBLL bll  = null;

            try
            {
                UIBindHelper.BindModelByControls(this.Page, info);

                bll = BLLFactory.CreateBLL <ProduceTrackBLL>();
                info.PRODUCTIONID = this.PRODUCTIONID.Value;
                if (this.hiID.Value == "")
                {
                    info.PID              = Guid.NewGuid().ToString();
                    info.STATUS           = "0";
                    info.WPID             = this.hiGX.Value;
                    info.EQUID            = this.hiCB.Value;
                    info.WSID             = this.hiGW.Value;
                    info.FACTORYPID       = user.OrgaID;
                    info.WORKINGSTARTTIME = DateTime.Now;
                    //校验是否跳序
                    string result = new ProcessCheckBLL().CheckSkipProcess(info.BATCHNUMBER, info.PRODUCTIONID, info.WPID);
                    if (result != "")
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "myjs", "alert('" + result + "');", true);
                        return;
                    }

                    bll.Insert(info);
                    this.HiCREATEUSER.Value = info.CREATEUSER;
                    this.HiCREATETIME.Value = info.CREATETIME.ToString();
                }
                else
                {
                    info.PID = this.hiID.Value;
                    info.WORKINGSTARTTIME = DateTime.Now;
                    info.STATUS           = "0";
                    info.WPID             = this.hiGX.Value;
                    info.EQUID            = this.hiCB.Value;
                    info.WSID             = this.hiGW.Value;
                    info.CREATETIME       = DateTime.Parse(this.HiCREATETIME.Value);
                    info.CREATEUSER       = this.HiCREATEUSER.Value;
                    bll.Update(info);
                }
                BindData(info.PID);
                //获取产品信息
                if (string.IsNullOrEmpty(this.BatchNumber.SelectedValue) == false)
                {
                    ProducePlanBLL ppbll  = BLLFactory.CreateBLL <ProducePlanBLL>();
                    ProductInfo    result = ppbll.GetPNameByIDBatchNumber(this.BatchNumber.SelectedValue);
                    this.PRODUCTIONID.Value = result.PID;
                    this.PNAME.Text         = result.PNAME;
                }
                this.hiID.Value = info.PID;
                //ClientScript.RegisterStartupScript(this.GetType(), "myjs", "window.location.href='MaterialTrace.aspx';", true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }