예제 #1
0
        public void GetDataPage(HttpContext context)
        {
            string    callback = context.Request["jsoncallback"];
            Hashtable ht       = new Hashtable();

            if (!string.IsNullOrEmpty(context.Request["name"]))
            {
                ht.Add("AssetName", context.Request["name"].ToString());
            }
            if (!string.IsNullOrEmpty(context.Request["Id"]))
            {
                ht.Add("EquipKindId", context.Request["Id"].ToString());
            }
            ht.Add("IsConsume", "1");
            ht.Add("IsDelete", "0");
            ht.Add("PageIndex", context.Request["startIndex"].ToString());
            ht.Add("PageSize", context.Request["pageSize"].ToString());

            EmsModel.JsonModel Model = new EmsBLL.EquipDetail().GetPage(ht);

            System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();

            HttpContext.Current.Response.Write(callback + "({\"result\":" + jss.Serialize(Model) + "})");
            HttpContext.Current.Response.End();
        }
예제 #2
0
        public void EditConsume(HttpContext context)
        {
            string callback = context.Request["jsoncallback"];
            int    insEpid  = Convert.ToInt32(context.Request["itemid"]);
            string name     = context.Request["name"];
            byte   type     = Convert.ToByte(HttpContext.Current.Request["type"]);
            int    result;

            if (new EmsBLL.EquipDetail().IsInsEpExists(name, type, insEpid))
            {
                result = -1;
            }
            else
            {
                EmsModel.EquipDetail insEp = new EmsBLL.EquipDetail().GetEmsModel(insEpid);
                string useridcard          = context.Request["useridcard"];
                string unit    = context.Request["unit"];
                string remarks = context.Request["remarks"];
                insEp.Id              = insEpid;
                insEp.AssetName       = name;
                insEp.AssetsClassName = name;
                insEp.Unit            = unit;
                insEp.Type            = type;
                insEp.Remarks         = remarks;
                insEp.Editor          = useridcard;
                insEp.UpdateTime      = DateTime.Now;
                result = new EmsBLL.EquipDetail().Update(insEp);
            }
            //输出Json
            HttpContext.Current.Response.Write(callback + "({\"result\":" + result + "})");
            HttpContext.Current.Response.End();
        }
예제 #3
0
        public void GetModelById(HttpContext context)
        {
            string callback = context.Request["jsoncallback"];
            int    insEpid  = Convert.ToInt32(context.Request["itemid"]);

            //序列化
            System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();
            EmsModel.EquipDetail insEp = new EmsBLL.EquipDetail().GetEmsModel(insEpid);
            //输出Json
            HttpContext.Current.Response.Write(callback + "({\"result\":" + jss.Serialize(insEp) + "})");
            HttpContext.Current.Response.End();
        }
예제 #4
0
        public void MoveEquipOutRoom(HttpContext context)
        {
            string callback = context.Request["jsoncallback"];
            int    itemid   = Convert.ToInt32(context.Request["itemid"]);

            EmsModel.EquipDetail equip = new EmsBLL.EquipDetail().GetEmsModel(itemid);
            equip.StorageLocation = "0";
            //序列化
            System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();
            int result = new EmsBLL.EquipDetail().Update(equip);

            //输出Json
            HttpContext.Current.Response.Write(callback + "({\"result\":" + result + "})");
            HttpContext.Current.Response.End();
        }
예제 #5
0
        public void GetDataByBarcode(HttpContext context)
        {
            string callback = context.Request["jsoncallback"];

            string Barcode = context.Request["Barcode"];

            EmsModel.EquipDetail user = new EmsBLL.EquipDetail().GetModelByBarcode(Barcode);
            //序列化
            System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();

            //输出Json
            HttpContext.Current.Response.Write(callback +
                                               "({\"result\":" + jss.Serialize(user) + "})");

            HttpContext.Current.Response.End();
        }
예제 #6
0
        public void GetDateEscheat(HttpContext context)
        {
            string callback = context.Request["jsoncallback"];

            string OrderNo = context.Request["OrderID"];

            //序列化
            System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();
            List <EmsModel.EquipDetail> mod = new EmsBLL.EquipDetail().GetEmsModelExperimentId(OrderNo, "1");

            //输出Json
            HttpContext.Current.Response.Write(callback +
                                               "({\"result\":" + jss.Serialize(mod) + "})");

            HttpContext.Current.Response.End();
        }
예제 #7
0
        public void EquipIntoCount(HttpContext context)
        {
            string callback = context.Request["jsoncallback"];
            int    itemid   = Convert.ToInt32(context.Request["itemid"]);
            int    count    = Convert.ToInt32(context.Request["count"]);

            EmsModel.EquipDetail equip = new EmsBLL.EquipDetail().GetEmsModel(itemid);
            equip.Id     = itemid;
            equip.Count  = equip.Count + count;
            equip.Editor = context.Request["useridcard"];
            System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();
            EmsModel.JsonModel mod = new EmsBLL.EquipDetail().EquipIntoCount(equip, count);
            //输出Json
            HttpContext.Current.Response.Write(callback + "({\"result\":" + jss.Serialize(mod) + "})");
            HttpContext.Current.Response.End();
        }
예제 #8
0
        public void GetJsonModelByEquipId(HttpContext context)
        {
            string    callback = context.Request["jsoncallback"];
            Hashtable ht       = new Hashtable();

            ht.Add("EquipId", context.Request["EquipId"] ?? "");
            ht.Add("PageIndex", context.Request["PageIndex"] ?? "1");
            ht.Add("PageSize", context.Request["PageSize"] ?? "10");
            bool ispage = true;

            if (!string.IsNullOrEmpty(context.Request["ispage"]))
            {
                ispage = Convert.ToBoolean(context.Request["ispage"]);
            }
            //序列化
            System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();
            EmsModel.JsonModel mod = new EmsBLL.EquipDetail().GetJsonModelByEquipId(ht, ispage);
            mod = nameCommon.AddCreateNameForData(mod, 4, "UserIDCard", "", "", context.Request["Name"] ?? "");
            //输出Json
            HttpContext.Current.Response.Write(callback + "({\"result\":" + jss.Serialize(mod) + "})");
            HttpContext.Current.Response.End();
        }
        public void ChangeUseStatus(HttpContext context)
        {
            string callback  = context.Request["jsoncallback"];
            int    itemid    = Convert.ToInt32(context.Request["itemid"]);
            byte   status    = Convert.ToByte(context.Request["Status"]);
            string tablename = context.Request["tablename"];
            int    result;

            switch (tablename)
            {
            case "UserInfo":
                EmsModel.UserInfo user = new EmsBLL.UserInfo().GetEmsModel(itemid);
                user.Id = itemid;
                //user.IsDelete = 1;
                user.UseStatus = status;
                result         = new EmsBLL.UserInfo().Update(user);
                break;

            case "Student":
                EmsModel.Student stu = new EmsBLL.Student().GetEmsModel(itemid);
                stu.Id        = itemid;
                stu.UseStatus = status;
                result        = new EmsBLL.Student().Update(stu);
                break;

            case "Warehouse":
                EmsModel.Warehouse ware = new EmsBLL.Warehouse().GetEmsModel(itemid);
                ware.Id        = itemid;
                ware.UseStatus = status;
                result         = new EmsBLL.Warehouse().Update(ware);
                break;

            case "InstrumentEquip":
                EmsModel.InstrumentEquip insEp = new EmsBLL.InstrumentEquip().GetEmsModel(itemid);
                insEp.Id        = itemid;
                insEp.UseStatus = status;
                result          = new EmsBLL.InstrumentEquip().Update(insEp);
                break;

            case "EquipDetail":
                EmsModel.EquipDetail equip = new EmsBLL.EquipDetail().GetEmsModel(itemid);
                equip.Id        = itemid;
                equip.UseStatus = status;
                result          = new EmsBLL.EquipDetail().Update(equip);
                break;

            case "ClassInfo":
                EmsModel.ClassInfo cla = new EmsBLL.ClassInfo().GetEmsModel(itemid);
                cla.Id        = itemid;
                cla.UseStatus = status;
                result        = new EmsBLL.ClassInfo().Update(cla);
                break;

            case "LearnYear":
                EmsModel.LearnYear ley = new EmsBLL.LearnYear().GetEmsModel(itemid);
                ley.Id        = itemid;
                ley.UseStatus = status;
                result        = new EmsBLL.LearnYear().Update(ley);
                break;

            case "SectionPlace":
                EmsModel.SectionPlace spla = new EmsBLL.SectionPlace().GetEmsModel(itemid);
                spla.Id        = itemid;
                spla.UseStatus = status;
                result         = new EmsBLL.SectionPlace().Update(spla);
                break;

            default:
                result = 0;
                break;
            }
            //输出Json
            context.Response.Write(callback + "({\"result\":" + result + "})");
            context.Response.End();
        }
예제 #10
0
        public void AddConsume(HttpContext context)
        {
            string callback = context.Request["jsoncallback"];
            string name     = context.Request["name"];
            byte   type     = Convert.ToByte(HttpContext.Current.Request["type"]);
            int    result;

            if (new EmsBLL.EquipDetail().IsInsEpExists(name, type))
            {
                result = -1;
            }
            else
            {
                string useridcard          = context.Request["useridcard"];
                int    count               = Convert.ToInt32(context.Request["count"]);
                string unit                = context.Request["unit"];
                string remarks             = context.Request["remarks"];
                EmsModel.EquipDetail insEp = new EmsModel.EquipDetail();
                insEp.AssetNumber        = "";
                insEp.AssetName          = name;
                insEp.Count              = count;
                insEp.Unit               = unit;
                insEp.Type               = type;
                insEp.EquipSource        = 0;//0本院资产;1资产系统
                insEp.IsConsume          = 1;
                insEp.Remarks            = remarks;
                insEp.Creator            = useridcard;
                insEp.CreateTime         = DateTime.Now;
                insEp.IsDelete           = 0;
                insEp.UseStatus          = 0;
                insEp.EquipKindId        = 0;
                insEp.EquipIntoID        = 0;
                insEp.EquipStatus        = 0;
                insEp.Barcode            = "";
                insEp.ClassNumber        = "";
                insEp.AssetsClassName    = name;
                insEp.IntlClassCode      = "";
                insEp.IntlClassName      = "";
                insEp.UsageStatus        = "";
                insEp.UsageDirection     = "";
                insEp.JYBBBSYFX          = "";
                insEp.AcquisitionMethod  = "";
                insEp.AcquisitionDate    = DateTime.Now;
                insEp.BrandStandardModel = "";
                insEp.EquipmentUse       = "";
                insEp.UseDepartment      = "";
                insEp.UsePeople          = "";
                insEp.Factory            = "";
                insEp.StorageLocation    = "0";
                insEp.WorthType          = "";
                insEp.UseNature          = "";
                insEp.Worth              = 0;
                insEp.FinanceRecordType  = "";
                insEp.FundsSubject       = "";
                insEp.CountryCode        = "";
                insEp.Operator           = useridcard;
                insEp.FinanceRecordType  = "";
                insEp.FinanceRecordType  = "";
                insEp.FinanceRecordType  = "";
                insEp.ManualModify       = 0;
                result = new EmsBLL.EquipDetail().Add(insEp);
            }
            //输出Json
            HttpContext.Current.Response.Write(callback + "({\"result\":" + result + "})");
            HttpContext.Current.Response.End();
        }