public ActionResult Save(ShopExpress entity) { var json = new JsonHelp(); try { if (entity.ID == 0) { json.IsSuccess = DB.ShopExpress.Insert(entity); json.Msg = "添加"; } else { json.IsSuccess = DB.ShopExpress.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) { ShopExpress entity = null; if (id == null) { entity = new ShopExpress(); } else { entity = DB.ShopExpress.FindEntity(id); } return(View(entity)); }