コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sAccess  = this.Request["access"];
            int    iAccess  = int.Parse(sAccess);
            string sType    = this.Request["type"];
            int    iType    = int.Parse(sType);
            string sBarcode = this.Request["barcode"];

            Msg barcodeMsg = PrintModel.QueryBatchId(sBarcode);
            int iBatchId   = 0;

            if (barcodeMsg.Status)
            {
                iBatchId = int.Parse((barcodeMsg.UserData as Tbl_BarCodeBatch).BuildBatchID.ToString());
            }
            GsonHelper gson = new GsonHelper();
            string     res  = string.Empty;

            if (iAccess == (int)TableType.加工中心)
            {
                if (iType == 1)
                {
                    Msg msg = APreEnsure2.queryByBarcode((int)BatchStatus.加工仓库入库待审批, iBatchId);
                    if (msg.Status)
                    {
                        res = gson.GetSerializerString(msg.UserData);
                    }
                }
                else if (iType == 2)
                {
                    Msg msg = APreEnsure2.queryByBarcode((int)BatchStatus.加工仓库待出库审批, iBatchId);
                    if (msg.Status)
                    {
                        res = gson.GetSerializerString(msg.UserData);
                    }
                }
                else
                {
                }
            }


            if (iAccess == (int)TableType.中心仓储)
            {
                if (iType == 1)
                {
                    Msg msg = APreEnsure2.queryByBarcode((int)BatchStatus.中心仓库入库待审批, iBatchId);
                    if (msg.Status)
                    {
                        res = gson.GetSerializerString(msg.UserData);
                    }
                }
                else if (iType == 2)
                {
                    Msg msg = APreEnsure2.queryByBarcode((int)BatchStatus.中心仓库待出库审批, iBatchId);
                    if (msg.Status)
                    {
                        res = gson.GetSerializerString(msg.UserData);
                    }
                }
                else
                {
                }
            }

            if (iAccess == (int)TableType.现场仓储)
            {
                if (iType == 1)
                {
                    Msg msg = APreEnsure2.queryByBarcode((int)BatchStatus.现场仓库入库待审批, iBatchId);
                    if (msg.Status)
                    {
                        res = gson.GetSerializerString(msg.UserData);
                    }
                }
                else if (iType == 2)
                {
                    Msg msg = APreEnsure2.queryByBarcode((int)BatchStatus.现场仓库待出库审批, iBatchId);
                    if (msg.Status)
                    {
                        res = gson.GetSerializerString(msg.UserData);
                    }
                }
                else
                {
                }
            }
            this.Response.Write(res);
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string     sAccess    = this.Request["access"];
            string     sType      = this.Request["batchType"];
            int        iBatchType = int.Parse(sType);
            int        iAccess    = int.Parse(sAccess);
            JsonArray  json       = new JsonArray();
            GsonHelper gson       = new GsonHelper();
            Msg        msg        = APreEnsure2.QueryUnsure(iAccess, iBatchType);

            if (msg.Status)
            {
                if (iAccess == (int)UserData.加工主管)
                {
                    if (iBatchType == 1)
                    {
                        List <Tbl_ProductBatch> lPlan = msg.UserData as List <Tbl_ProductBatch>;
                        foreach (Tbl_ProductBatch oPlan in lPlan)
                        {
                            json.Add(JsonValue.Parse(gson.GetSerializerString(oPlan)));
                        }
                    }
                    else if (iBatchType == 2)
                    {
                        List <Tbl_OutProductBatch> lPlan = msg.UserData as List <Tbl_OutProductBatch>;
                        foreach (Tbl_OutProductBatch oPlan in lPlan)
                        {
                            json.Add(JsonValue.Parse(gson.GetSerializerString(oPlan)));
                        }
                    }
                    else
                    {
                    }
                }
                if (iAccess == (int)UserData.中心仓库主管)
                {
                    if (iBatchType == 1)
                    {
                        List <Tbl_CenterStorageBatch> lPlan = msg.UserData as List <Tbl_CenterStorageBatch>;
                        foreach (Tbl_CenterStorageBatch oPlan in lPlan)
                        {
                            json.Add(JsonValue.Parse(gson.GetSerializerString(oPlan)));
                        }
                    }
                    else if (iBatchType == 2)
                    {
                        List <Tbl_OutCenterStorage> lPlan = msg.UserData as List <Tbl_OutCenterStorage>;
                        foreach (Tbl_OutCenterStorage oPlan in lPlan)
                        {
                            json.Add(JsonValue.Parse(gson.GetSerializerString(oPlan)));
                        }
                    }
                    else
                    {
                    }
                }
                if (iAccess == (int)UserData.现场仓库主管)
                {
                    if (iBatchType == 1)
                    {
                        List <Tbl_SiteStorageBatch> lPlan = msg.UserData as List <Tbl_SiteStorageBatch>;
                        foreach (Tbl_SiteStorageBatch oPlan in lPlan)
                        {
                            json.Add(JsonValue.Parse(gson.GetSerializerString(oPlan)));
                        }
                    }
                    else if (iBatchType == 2)
                    {
                        List <Tbl_OutSiteStorage> lPlan = msg.UserData as List <Tbl_OutSiteStorage>;
                        foreach (Tbl_OutSiteStorage oPlan in lPlan)
                        {
                            json.Add(JsonValue.Parse(gson.GetSerializerString(oPlan)));
                        }
                    }
                    else
                    {
                    }
                }
            }
            this.Response.Write(json.ToString());
        }