Exemplo n.º 1
0
        public JsonResult Edit(MBR_WashingInfo entity)
        {
            if (entity != null && ModelState.IsValid)
            {
                using (MBREntities db = new MBREntities())
                {
                    WashingInfoService us = new WashingInfoService(db);

                    if (us.Edit(ref errors, entity))
                    {
                        LogHandler.WriteServiceLog(LogonUser.RealName, "WashingInfoID:" + entity.WashingInfoID, Resource.EditSucceed, Resource.Edit, "离线清洗数据管理");
                        return(Json(JsonHandler.CreateMessage(1, Resource.EditSucceed)));
                    }
                    else
                    {
                        string ErrorCol = errors.Error;
                        LogHandler.WriteServiceLog(LogonUser.RealName, "WashingInfoID:" + entity.WashingInfoID, Resource.EditFail, Resource.Edit, "离线清洗数据管理");
                        return(Json(JsonHandler.CreateMessage(0, Resource.EditFail + ErrorCol)));
                    }
                }
            }
            else
            {
                return(Json(JsonHandler.CreateMessage(0, Resource.EditFail)));
            }
        }
Exemplo n.º 2
0
 public ActionResult Details(int id)
 {
     using (MBREntities db = new MBREntities())
     {
         WashingInfoService us     = new WashingInfoService(db);
         MBR_WashingInfo    entity = us.GetById(id);
         return(View(entity));
     }
 }
Exemplo n.º 3
0
 public JsonResult Delete(int id)
 {
     using (MBREntities db = new MBREntities())
     {
         WashingInfoService us = new WashingInfoService(db);
         if (us.Delete(ref errors, id))
         {
             LogHandler.WriteServiceLog(LogonUser.RealName, "WashingInfoID:" + id, Resource.DeleteSucceed, Resource.Delete, "离线清洗数据管理");
             return(Json(JsonHandler.CreateMessage(1, Resource.DeleteSucceed)));
         }
         else
         {
             string ErrorCol = errors.Error;
             LogHandler.WriteServiceLog(LogonUser.RealName, "WashingInfoID:" + id, Resource.DeleteFail, Resource.Delete, "离线清洗数据管理");
             return(Json(JsonHandler.CreateMessage(0, Resource.DeleteFail + ErrorCol)));
         }
     }
 }
Exemplo n.º 4
0
 public JsonResult Create(MBR_WashingInfo entity)
 {
     using (MBREntities db = new MBREntities())
     {
         WashingInfoService us = new WashingInfoService(db);
         if (us.Create(ref errors, entity))
         {
             LogHandler.WriteServiceLog(LogonUser.RealName, "WashingInfoID:" + entity.WashingInfoID, Resource.InsertSucceed, Resource.Create, "离线清洗数据管理");
             return(Json(JsonHandler.CreateMessage(1, Resource.InsertSucceed), JsonRequestBehavior.AllowGet));
         }
         else
         {
             string ErrorCol = errors.Error;
             LogHandler.WriteServiceLog(LogonUser.RealName, "WashingInfoID:" + entity.WashingInfoID, Resource.InsertFail, Resource.Create, "离线清洗数据管理");
             return(Json(JsonHandler.CreateMessage(0, Resource.InsertFail + ErrorCol), JsonRequestBehavior.AllowGet));
         }
     }
 }
Exemplo n.º 5
0
        public JsonResult GetList(GridPager pager, int?InfoID)
        {
            Expression <Func <MBR_WashingInfo, bool> > predicate = null;

            if (InfoID.HasValue)
            {
                predicate = m => m.InfoID == InfoID.Value;
            }
            using (MBREntities db = new MBREntities())
            {
                WashingInfoService us = new WashingInfoService(db);
                var query             = us.GetList(ref pager, predicate);
                var json = new
                {
                    draw            = pager.draw,
                    recordsTotal    = pager.recordsFiltered,
                    recordsFiltered = pager.recordsTotal,
                    data            = query.Select(m =>
                                                   new
                    {
                        m.WashingInfoID,
                        m.InfoID,
                        m.BeginTime,
                        m.EndTime,
                        m.WashType,
                        m.YaoJiLX,
                        m.JinPaoSJ,
                        m.YaoJiND,
                        m.TouShuiL_Low,
                        m.TouShuiL_High,
                        TouShuiL_HFL = 0,
                        m.LvJieCZDC,
                        LvJieCZLJ = 0
                    })
                };
                return(Json(json, JsonRequestBehavior.AllowGet));
            }
        }