コード例 #1
0
        protected void btSave_Click(object sender, EventArgs e)
        {
            ProducePlan    info = new ProducePlan();
            ProducePlanBLL bll  = null;

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

                bll = BLLFactory.CreateBLL <ProducePlanBLL>();

                if (this.hiID.Value == "")
                {
                    bll.Insert(info);
                }
                else
                {
                    info.CREATEUSER = this.HiCREATEUSER.Value;
                    info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value);
                    info.PID        = this.hiID.Value;
                    bll.Update(info);
                }

                ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.refreshData();parent.closeAppWindow1();", true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        private void BindData()
        {
            string         id   = Request.QueryString["id"];
            ProducePlanBLL bll  = null;
            ProducePlan    info = new ProducePlan();

            try
            {
                bll = BLLFactory.CreateBLL <ProducePlanBLL>();
                if (string.IsNullOrEmpty(id) == false)
                {
                    info.PID = id;
                    info     = bll.Get(info);

                    UIBindHelper.BindForm(this.Page, info);
                    this.PLANDATE.Text      = info.PLANDATE.ToString("yyyy-MM-dd");
                    this.hiID.Value         = info.PID;
                    this.HiCREATEUSER.Value = info.CREATEUSER;
                    this.HiCREATETIME.Value = info.CREATETIME.ToString();
                }
                else
                {
                    info = new ProducePlan();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
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;
            }
        }
コード例 #4
0
ファイル: TrackInfoManage.aspx.cs プロジェクト: 48401298/efp
        private void BindData()
        {
            DataPage       dp        = new DataPage();
            ProducePlan    condition = new ProducePlan();
            ProducePlanBLL bll       = null;

            try
            {
                bll = BLLFactory.CreateBLL <ProducePlanBLL>();
                condition.FACTORYPID   = this.FACTORYPID.SelectedValue;
                condition.PRID         = this.PRID.SelectedValue;
                condition.PRODUCTIONID = this.PRODUCTIONID.SelectedValue;
                PagerHelper.InitPageControl(this.AspNetPager1, dp, true);
                dp = bll.GetList(condition, dp);
                List <ProducePlan> list = dp.Result as List <ProducePlan>;
                this.GvList.DataSource = list;
                this.GvList.DataBind();

                for (int i = 0; i < this.GvList.Rows.Count; i++)
                {
                    string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["PID"].ToString());

                    (this.GvList.Rows[i].Cells[7].Controls[0] as WebControl).Attributes.Add("onclick", click);
                }
                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #5
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            ArrayList      pkArray = null;
            ProducePlanBLL bll     = null;

            try
            {
                bll = BLLFactory.CreateBLL <ProducePlanBLL>();

                pkArray = GvHelper.GetPKValueByChk(this.GvList, 0, "cbxSelect", 0);

                foreach (object key in pkArray)
                {
                    bll.DeleteProducePlan(new ProducePlan {
                        PID = key.ToString()
                    });
                }

                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #6
0
        private void BindData()
        {
            ProducePlanBLL bll = new ProducePlanBLL();

            List <ProducePlan> list = bll.GetUnFinishedPlans(new ProducePlan());

            this.OnPList.DataSource = list;
            this.OnPList.DataBind();
        }
コード例 #7
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentEncoding = Encoding.UTF8;
            context.Response.ContentType     = "application/json";
            ProducePlanBLL ppbll    = BLLFactory.CreateBLL <ProducePlanBLL>();
            SupplyInfoBLL  sibll    = BLLFactory.CreateBLL <SupplyInfoBLL>();
            string         planID   = context.Request.QueryString["planID"];
            SupplyInfo     siresult = ppbll.GetProducePlanInfoByID(planID);

            if (siresult == null)
            {
                siresult = new SupplyInfo();
                if (siresult != null)
                {
                    siresult.PID = "none";
                }
            }
            else
            {
                //获取生产计划
                ProducePlan plan = new ProducePlanBLL().Get(new ProducePlan {
                    PID = planID
                });

                //获取bom明细
                siresult.Details = sibll.GetMaterialListByBOM(siresult.ProductionID);

                //获取bom基本信息
                ProduceBOM bomBase = new ProduceDOMBLL().GetByProduceID(siresult.ProductionID);

                //生成要货明细
                foreach (SupplyMaterialInfo detail in siresult.Details)
                {
                    if (bomBase.Amount != 0)
                    {
                        detail.AMOUNT = Convert.ToInt32(decimal.Parse(plan.PLANAMOUNT)) / bomBase.Amount;
                    }
                    else
                    {
                        detail.AMOUNT = 0;
                    }
                }
            }

            context.Response.Write(LAF.Common.Serialization.JsonConvertHelper.GetSerializes(siresult));
        }
コード例 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsPostBack == false)
            {
                this.InitForm();
                //获取产品信息
                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;
                }
            }

            SetBtnState();
        }
コード例 #9
0
ファイル: MaterialOnline.aspx.cs プロジェクト: 48401298/efp
        private void InitForm()
        {
            List <DictInfo> dicts = null;

            //绑定批次
            List <ProducePlan> whList = BLLFactory.CreateBLL <ProducePlanBLL>().GetList();

            dicts = whList.Select(p => new DictInfo {
                ID = p.BATCHNUMBER, Des = p.BATCHNUMBER
            }).ToList <DictInfo>();
            Tools.BindDataToDDL(this.BatchNumber, dicts, null);

            //获取产品信息
            if (string.IsNullOrEmpty(this.BatchNumber.SelectedValue) == false)
            {
                ProducePlanBLL bll    = BLLFactory.CreateBLL <ProducePlanBLL>();
                ProductInfo    result = bll.GetPNameByIDBatchNumber(this.BatchNumber.SelectedValue);
                this.PRODUCTIONID.Value = result.PID;
                this.PNAME.Text         = result.PNAME;
            }
        }
コード例 #10
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentEncoding = Encoding.UTF8;
            context.Response.ContentType     = "application/json";
            string type        = context.Request.QueryString["Type"];
            string code        = context.Request.QueryString["Code"];
            string batchNumber = "";

            switch (type)
            {
            case "CP":
                ProducePlanBLL bll    = BLLFactory.CreateBLL <ProducePlanBLL>();
                ProductInfo    result = bll.GetPNameByIDBatchNumber(code);
                if (result == null)
                {
                    result = new ProductInfo();
                    if (result != null)
                    {
                        result.PID = "none";
                    }
                }
                context.Response.Write(LAF.Common.Serialization.JsonConvertHelper.GetSerializes(result));
                break;

            case "CP2":
                ProducePlanBLL bllGoodInfo    = BLLFactory.CreateBLL <ProducePlanBLL>();
                GoodInfo       resultGoodInfo = bllGoodInfo.GetGoodInfoByBatchNumber(code);
                if (resultGoodInfo == null)
                {
                    resultGoodInfo = new GoodInfo();
                    if (resultGoodInfo != null)
                    {
                        resultGoodInfo.PID = "none";
                    }
                }
                context.Response.Write(LAF.Common.Serialization.JsonConvertHelper.GetSerializes(resultGoodInfo));
                break;

            case "CB":
                EquipmentBLL  bll2    = BLLFactory.CreateBLL <EquipmentBLL>();
                EquipmentInfo result2 = bll2.GetInfoByBarCode(code);
                if (result2 == null)
                {
                    result2 = new EquipmentInfo();
                    if (result2 != null)
                    {
                        result2.PID = "none";
                    }
                }
                context.Response.Write(LAF.Common.Serialization.JsonConvertHelper.GetSerializes(result2));
                break;

            case "GX":    //根据工位条码获取加工工序
                ProcessInfoBLL bll3 = BLLFactory.CreateBLL <ProcessInfoBLL>();
                Manage.Entity.MES.ProcessInfo result3 = bll3.GetInfoByWS(code);
                if (result3 == null)
                {
                    result3 = new Manage.Entity.MES.ProcessInfo();
                    if (result3 != null)
                    {
                        result3.PID = "none";
                    }
                }
                context.Response.Write(LAF.Common.Serialization.JsonConvertHelper.GetSerializes(result3));
                break;

            case "GX2":
                ProcessInfoBLL bll4 = BLLFactory.CreateBLL <ProcessInfoBLL>();
                batchNumber = context.Request.QueryString["BatchNumber"];
                Manage.Entity.MES.ProcessInfo result4 = bll4.GetInfoByBarCodeAndBatchNumber(code, batchNumber);
                if (result4 == null)
                {
                    result4 = new Manage.Entity.MES.ProcessInfo();
                    if (result4 != null)
                    {
                        result4.PID = "none";
                    }
                }
                context.Response.Write(LAF.Common.Serialization.JsonConvertHelper.GetSerializes(result4));
                break;

            case "PP":
                ProducePlanBLL ppbll    = BLLFactory.CreateBLL <ProducePlanBLL>();
                SupplyInfoBLL  sibll    = BLLFactory.CreateBLL <SupplyInfoBLL>();
                string         id       = context.Request.QueryString["id"];
                SupplyInfo     siresult = ppbll.GetProducePlanInfoByID(id);
                if (siresult == null)
                {
                    siresult = new SupplyInfo();
                    if (siresult != null)
                    {
                        siresult.PID = "none";
                    }
                }
                else
                {
                    siresult.Details = sibll.GetMaterialListByBOM(siresult.ProductionID);
                }

                context.Response.Write(LAF.Common.Serialization.JsonConvertHelper.GetSerializes(siresult));
                break;

            case "ZJ":
                QualityCheckBLL qcBll = BLLFactory.CreateBLL <QualityCheckBLL>();
                batchNumber = context.Request.QueryString["BatchNumber"];
                QualityCheckInfo qualityCheckInfo = qcBll.GetPDInfo(batchNumber);
                if (qualityCheckInfo == null)
                {
                    qualityCheckInfo    = new QualityCheckInfo();
                    qualityCheckInfo.ID = "none";
                }
                context.Response.Write(LAF.Common.Serialization.JsonConvertHelper.GetSerializes(qualityCheckInfo));
                break;

            default:
                break;
            }
        }
コード例 #11
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;
            }
        }