Пример #1
0
        /// <summary>
        /// 更新报修信息
        /// </summary>
        /// <param name="context"></param>
        public void SetRepairDetails(HttpContext context)
        {
            string callback       = context.Request["jsoncallback"];
            string RepairLocation = context.Request["RepairLocation"];
            string CostOfRepairs  = context.Request["CostOfRepairs"];
            string CompleteTime   = context.Request["CompleteTime"];
            string Damagetime     = context.Request["Damagetime"];
            string DamageCauses   = context.Request["DamageCauses"];
            string remarks        = context.Request["remarks"];
            string useridcard     = context.Request["useridcard"];
            string ID             = context.Request["id"];


            EmsModel.Repair mod = new EmsModel.Repair();
            mod.ID             = Convert.ToInt32(ID);
            mod.RepairLocation = RepairLocation;
            mod.CostOfRepairs  = CostOfRepairs;
            mod.CompleteTime   = CompleteTime;
            mod.Damagetime     = Convert.ToDateTime(Damagetime);
            mod.DamageCauses   = DamageCauses;
            mod.Remark         = remarks;
            mod.RepairMan      = useridcard;
            mod.RepairTime     = DateTime.Now;
            mod.EquipID        = Convert.ToInt32(ID);
            int rep = new EmsBLL.Repair().Update(mod);

            HttpContext.Current.Response.Write(callback + "({\"result\":" + rep + "})");
            HttpContext.Current.Response.End();
        }
Пример #2
0
        /// <summary>
        /// 查询附件表
        /// </summary>
        /// <param name="context"></param>
        public void GetRepairAttachment(HttpContext context)
        {
            string    callback = context.Request["jsoncallback"];
            Hashtable ht       = new Hashtable();
            int       id       = Convert.ToInt32(context.Request["ID"]);

            EmsModel.JsonModel Model = new EmsBLL.Repair().GetRepairAttachment(id);
            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();
        }
Пример #3
0
        /// <summary>
        /// 删除报修单条记录
        /// </summary>
        /// <param name="context"></param>
        public void deleteRepairDetails(HttpContext context)
        {
            string    callback = context.Request["jsoncallback"];
            Hashtable ht       = new Hashtable();

            ht.Add("ID", context.Request["ID"]);
            EmsModel.JsonModel Model = new EmsBLL.Repair().deleteRepairDetails(ht);
            //序列化
            System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();

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

            HttpContext.Current.Response.End();
        }
Пример #4
0
        public void RepairEdit(HttpContext context)
        {
            string callback     = context.Request["jsoncallback"];
            string Damagetime   = context.Request["Damagetime"];
            string DamageCauses = context.Request["DamageCauses"];
            string remarks      = context.Request["remarks"];
            string useridcard   = context.Request["useridcard"];
            string eqID         = context.Request["eqID"];


            EmsModel.Repair mod = new EmsModel.Repair();
            mod.Damagetime   = Convert.ToDateTime(Damagetime);
            mod.DamageCauses = DamageCauses;
            mod.Remark       = remarks;
            mod.RepairMan    = useridcard;
            mod.RepairTime   = DateTime.Now;
            mod.EquipID      = Convert.ToInt32(eqID);
            mod.IsDelete     = 0;
            mod.RepairStatus = 0;

            int rep = new EmsBLL.Repair().Add(mod);

            //EmsModel.EquipDetail eMod = new EmsBLL.EquipDetail().GetEmsModel(Convert.ToInt32(eqID));
            //输出Json

            if (rep > 0)
            {
                Hashtable ht = new Hashtable();
                ht.Add("Id", context.Request["eqID"]);
                ht.Add("EquipStatus", 2);
                new EmsBLL.EquipDetail().UpdateStatus(ht);
            }



            HttpContext.Current.Response.Write(callback +
                                               "({\"result\":" + rep + "})");

            HttpContext.Current.Response.End();
        }
Пример #5
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="context"></param>
        public void AddRepairDetails(HttpContext context)
        {
            string    callback = context.Request["jsoncallback"];
            Hashtable ht       = new Hashtable();

            ht.Add("Record", context.Request["Record"]);
            ht.Add("Date", context.Request["Date"]);
            ht.Add("ID", context.Request["ID"]);
            ht.Add("RID", context.Request["RID"]);
            ht.Add("Operator", context.Request["Operator"]);
            System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();
            string fileJson = context.Request["fileJson"];
            List <EmsModel.FileModel> files = jss.Deserialize <List <EmsModel.FileModel> >(fileJson);

            ht.Add("fileJson", files);

            EmsBLL.Repair      repair = new EmsBLL.Repair();
            EmsModel.JsonModel Model  = repair.AddRepairDetails(ht);

            HttpContext.Current.Response.Write(callback + "({\"result\":" + jss.Serialize(Model) + "})");
            HttpContext.Current.Response.End();
        }