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)));
            }
        }
 public ActionResult Details(int id)
 {
     using (MBREntities db = new MBREntities())
     {
         WashingInfoService us     = new WashingInfoService(db);
         MBR_WashingInfo    entity = us.GetById(id);
         return(View(entity));
     }
 }
 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)));
         }
     }
 }
 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));
         }
     }
 }
        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));
            }
        }