public ActionResult EditCatalog(VModel.SySystem.FormCatalog m) { if (ModelState.IsValid) { int r = Bll.SySystemBll.Edit(m); switch (r) { case 200: return(Json(new { success = true })); } } return(View(m)); }
/// <summary> /// 编辑 /// </summary> /// <returns></returns> public static int Edit(VModel.SySystem.FormCatalog m) { using (var db = new fz_basicEntities()) { sy_system dbm = db.sy_system.Find(m.Id); dbm.Name = m.Name; dbm.Sort = m.Sort; dbm.IsEnabled = m.IsEnabled; db.SaveChanges(); } Common.Caches.RemoveCache("sy_system"); return(200); }
/// <summary> /// 新增 /// </summary> /// <returns></returns> public static int Add(VModel.SySystem.FormCatalog m) { using (var db = new fz_basicEntities()) { sy_system dbm = new sy_system { Type = 1, Name = m.Name, IsNav = false, PageOpen = 1, Level = 1, Sort = m.Sort, IsEnabled = m.IsEnabled, IsSystem = true }; db.sy_system.Add(dbm); db.SaveChanges(); } Common.Caches.RemoveCache("sy_system"); return(200); }
public ActionResult EditCatalog(int id) { VModel.SySystem.FormCatalog m = Bll.SySystemBll.GetEditCatalog(id); return(View(m)); }