Beispiel #1
0
        public JsonResult Edit(MBR_Info entity)
        {
            if (entity != null && ModelState.IsValid)
            {
                using (MBREntities db = new MBREntities())
                {
                    MBRInfoService us = new MBRInfoService(db);

                    if (us.Edit(ref errors, entity))
                    {
                        LogHandler.WriteServiceLog(LogonUser.RealName, "InfoID:" + entity.InfoID + ",Title:" + entity.Title, Resource.EditSucceed, Resource.Edit, "MBR膜管理");
                        return(Json(JsonHandler.CreateMessage(1, Resource.EditSucceed)));
                    }
                    else
                    {
                        string ErrorCol = errors.Error;
                        LogHandler.WriteServiceLog(LogonUser.RealName, "InfoID:" + entity.InfoID + ",Title:" + entity.Title, Resource.EditFail, Resource.Edit, "MBR膜管理");
                        return(Json(JsonHandler.CreateMessage(0, Resource.EditFail + ErrorCol)));
                    }
                }
            }
            else
            {
                return(Json(JsonHandler.CreateMessage(0, Resource.EditFail)));
            }
        }
Beispiel #2
0
        public ViewResult ANIndex(int?InfoID)
        {
            MBR_Info Info = null;

            if (InfoID.HasValue)
            {
                using (MBREntities db = new MBREntities())
                {
                    Info = db.MBR_Info.Find(InfoID.Value);
                }
            }
            if (Info == null)
            {
                throw new Exception("请选择膜");
            }

            ViewBag.MBRInfo = Info;

            ANInfoModel model = new ANInfoModel();

            using (MBREntities db = new MBREntities())
            {
                model.CLCurve   = db.AN_CLCurve.Find(InfoID.Value);
                model.HighCurve = db.AN_HighCurve.Find(InfoID.Value);
                model.LowCurve  = db.AN_LowCurve.Find(InfoID.Value);
            }
            model.InfoID = (int)InfoID;
            return(View(model));
        }
Beispiel #3
0
 public ActionResult Details(int id)
 {
     using (MBREntities db = new MBREntities())
     {
         MBRInfoService us     = new MBRInfoService(db);
         MBR_Info       entity = us.GetById(id);
         return(View(entity));
     }
 }
Beispiel #4
0
        public ActionResult Edit(int id)
        {
            MBR_Info entity = null;

            using (MBREntities db = new MBREntities())
            {
                entity = db.MBR_Info.Include("MBR_Pool").Where(m => m.InfoID == id).FirstOrDefault();
            }
            return(View(entity));
        }
Beispiel #5
0
 public JsonResult Create(MBR_Info entity)
 {
     using (MBREntities db = new MBREntities())
     {
         MBRInfoService us = new MBRInfoService(db);
         if (us.Create(ref errors, entity))
         {
             LogHandler.WriteServiceLog(LogonUser.RealName, "InfoID:" + entity.InfoID + ",Title:" + entity.Title, Resource.InsertSucceed, Resource.Create, "MBR膜管理");
             return(Json(JsonHandler.CreateMessage(1, Resource.InsertSucceed), JsonRequestBehavior.AllowGet));
         }
         else
         {
             string ErrorCol = errors.Error;
             LogHandler.WriteServiceLog(LogonUser.RealName, "InfoID:" + entity.InfoID + ",Title:" + entity.Title, Resource.InsertFail, Resource.Create, "MBR膜管理");
             return(Json(JsonHandler.CreateMessage(0, Resource.InsertFail + ErrorCol), JsonRequestBehavior.AllowGet));
         }
     }
 }
        public ViewResult OffLineIndex(int?InfoID)
        {
            MBR_Info Info = null;

            if (InfoID.HasValue)
            {
                using (MBREntities db = new MBREntities())
                {
                    Info = db.MBR_Info.Find(InfoID.Value);
                }
            }
            if (Info == null)
            {
                throw new Exception("请选择膜");
            }

            ViewBag.MBRInfo = Info;

            return(View());
        }