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(); }
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; } }
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; } }
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; } }