Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ReturnMsg ret = new ReturnMsg();

            ret.Status = 0;
            this.Response.ContentType = "text/plain";
            JavaScriptSerializer jss = new JavaScriptSerializer();
            string sImei             = this.Request["imei"];
            string Id    = this.Request["username"];
            string table = this.Request["tablename"];

            if (table != null)
            {
                if (table.Equals("Tbl_Materies"))
                {
                    Msg msg = MetriesModel.AndroidEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_ProductBatch"))
                {
                    Msg msg = ProductModel.AndroidInBunch(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_OutProductBatch"))
                {
                    Msg msg = ProductModel.AndroidOutEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_CenterStorageBatch"))
                {
                    Msg msg = Center.AndroidInEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_OutCenterStorage"))
                {
                    Msg msg = Center.AndroidOutBatch(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_SiteStorageBatch"))
                {
                    Msg msg = SiteStorageModel.AndroidInEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_OutSiteStorage"))
                {
                    Msg msg = SiteStorageModel.AndroidOutBatch(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else
                {
                    ret.Status = 0;
                }
            }
            this.Response.Write(jss.Serialize(ret));
        }
Beispiel #2
0
        public string AdmEnsure(string Id, string table)
        {
            JavaScriptSerializer jss = new JavaScriptSerializer();

            ////  string sImei = this.Request["imei"];
            //string Id = this.Context.Request.QueryString["id"];
            //string table =this.Context.Request.QueryString["table"];
            if (table != null)
            {
                LingYunDemo.Web.android.AdmEnsure.ReturnMsg ret = new LingYunDemo.Web.android.AdmEnsure.ReturnMsg();
                ret.Status = 1;
                if (table.Equals("Tbl_Materies"))
                {
                    Msg msg = MetriesModel.AndroidEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_ProductBatch"))
                {
                    Msg msg = ProductModel.AndroidInBunch(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_OutProductBatch"))
                {
                    Msg msg = ProductModel.AndroidOutEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_CenterStorageBatch"))
                {
                    Msg msg = Center.AndroidInEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_OutCenterStorage"))
                {
                    Msg msg = Center.AndroidOutBatch(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_SiteStorageBatch"))
                {
                    Msg msg = SiteStorageModel.AndroidInEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_OutSiteStorage"))
                {
                    Msg msg = SiteStorageModel.AndroidOutBatch(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                //this.Response.Write(jss.Serialize(ret));
                //this.Response.Write("#");
            }
            //this.Context.Response.Write(Id);
            //this.Context.Response.Write(table);
            return(Id);
        }