//[SupportFilter] public ActionResult Create(SMMENUTB entity) { if (entity != null && ModelState.IsValid) { entity.CREATETIME = DateTime.Now; entity.CREATEPERSON = GetCurrentAccount().USER_NAME; string returnValue = string.Empty; SMLOG OperLog = new SMLOG { OPERATION_TYPE = "N", FUNC_CODE = "900001", USER_ID = UserId, CLASSNAME = ClassName + strCreate }; var result = SMMENUTBService.Create(entity); if (result != null) { OperLog.REMARK = "菜单:" + entity.NAME + Suggestion.InsertSucceed; SMLOGService.AddEntity(OperLog);//写入日志 return(Json(Suggestion.InsertSucceed)); } else { OperLog.REMARK = "菜单:" + entity.NAME + Suggestion.InsertFail; SMLOGService.AddEntity(OperLog); //写入日志 return(Json(Suggestion.InsertFail + returnValue)); //提示插入失败 } } return(Json(Suggestion.InsertFail + ",请核对输入的数据的格式")); //提示输入的数据的格式不对 }
//[SupportFilter] public ActionResult Edit(string id, SMMENUTB entity) { if (entity != null && ModelState.IsValid) { //数据校验 entity.UPDATETIME = DateTime.Now; entity.UPDATEPERSON = GetCurrentAccount().USER_NAME; string returnValue = string.Empty; SMLOG OperLog = new SMLOG { OPERATION_TYPE = "U", FUNC_CODE = "900002", USER_ID = UserId, CLASSNAME = ClassName + strEdit }; if (SMMENUTBService.Edit(entity)) { OperLog.REMARK = "菜单:" + entity.NAME + Suggestion.UpdateSucceed; SMLOGService.AddEntity(OperLog); //写入日志 return(Json(Suggestion.UpdateSucceed)); //提示更新成功 } else { OperLog.REMARK = "菜单:" + entity.NAME + Suggestion.UpdateFail; SMLOGService.AddEntity(OperLog); //写入日志 return(Json(Suggestion.UpdateFail + returnValue)); //提示更新失败 } } return(Json(Suggestion.UpdateFail + "请核对输入的数据的格式")); //提示输入的数据的格式不对 }
/// <summary> /// 查看详细 /// </summary> SMLOGService.AddEntity /// <param name="id"></param> /// <returns></returns> //[SupportFilter] public ActionResult Details(int id) { SMMENUTB item = SMMENUTBService.LoadEntities(m => m.ID == id).FirstOrDefault(); item.STATE = item.STATE == "Y" ? "启用" : "禁用"; return(View(item)); }
/// <summary> /// 首次创建 /// </summary> /// <returns></returns> public ActionResult Create(int?id) { if (id != null) { SMMENUTB entityId = SMMENUTBService.LoadEntities(m => m.ID == id).FirstOrDefault(); if (entityId != null) { SMFUNCTB entity = new SMFUNCTB(); entity.SysMenuId = id + '&' + entityId.NAME; return(View(entity)); } } return(View()); }
/// <summary> /// 首次编辑 /// </summary> /// <param name="id">主键</param> /// <returns></returns> //[SupportFilter] public ActionResult Edit(int id) { SMMENUTB item = SMMENUTBService.LoadEntities(m => m.ID == id).FirstOrDefault(); return(View(item)); }