public ActionResult Save(ShopSlide entity) { var json = new JsonHelp(); try { if (entity.ID == 0) { json.IsSuccess = DB.ShopSlide.Insert(entity); json.Msg = "添加"; } else { json.IsSuccess = DB.ShopSlide.Update(entity); json.Msg = "修改"; } if (json.IsSuccess) { json.ReUrl = ControllerPath + "/Index"; //注册成功就跳转到 激活页 json.Msg += "成功"; } else { json.Msg += "失败"; } } catch (Exception e) { json.IsSuccess = false; json.Msg = "操作失败"; LogHelper.Error("保存幻灯片失败:" + WebTools.getFinalException(e)); } return(Json(json)); }
public ActionResult Detail(int?id) { ShopSlide entity = null; if (id == null) { entity = new ShopSlide(); } else { entity = DB.ShopSlide.FindEntity(id); } return(View(entity)); }