Ejemplo n.º 1
0
        private void BindData()
        {
            string         id  = Request.QueryString["id"];
            ProcessInfoBLL bll = null;

            Manage.Entity.MES.ProcessInfo info   = new Manage.Entity.MES.ProcessInfo();
            DataGridResult <EquipmentRef> eqList = new DataGridResult <EquipmentRef>();
            DataGridResult <StationRef>   wsList = new DataGridResult <StationRef>();

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

                    UIBindHelper.BindForm(this.Page, info);
                    this.hiID.Value         = info.PID;
                    this.HiCREATEUSER.Value = info.CREATEUSER;
                    this.HiCREATETIME.Value = info.CREATETIME.ToString();
                    List <EquipmentRef> eqlist = bll.GetEList(id);
                    foreach (EquipmentRef item in eqlist)
                    {
                        item.DeleteAction = "deleteEQ('" + item.EQID + "')";
                    }

                    List <StationRef> wslist = bll.GetSList(id);
                    foreach (StationRef item in wslist)
                    {
                        item.DeleteAction = "deleteWS('" + item.STID + "')";
                    }
                    wsList.Total = wslist.Count;
                    wsList.Rows  = wslist;

                    eqList.Total        = eqlist.Count;
                    eqList.Rows         = eqlist;
                    this.HiFLOWID.Value = info.FLOWID;
                }
                else
                {
                    string flowID = Request.QueryString["flowID"];
                    info         = new ProcessInfo();
                    info.FLOWID  = flowID;
                    wsList.Total = 0;
                    wsList.Rows  = new List <StationRef>();
                    eqList.Total = 0;
                    eqList.Rows  = new List <EquipmentRef>();
                }
                this.HiFLOWID.Value = info.FLOWID;
                this.hiWSList.Value = wsList.GetJsonSource();
                this.hiEQList.Value = eqList.GetJsonSource();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
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;
            }
        }