public ActionResult Detail(int id) { try { PermissionMapRepository ml = new PermissionMapRepository(); PermissionMap obj = ml.GetPermissionMap(id); return(View(obj)); } catch (Exception ex) { return(Content(ContentIcon.Error + "|" + ErrorWirter(RouteData, ex.Message))); } }
public ActionResult Edit(int id) { try { PermissionMapRepository ml = new PermissionMapRepository(); PermissionMap obj = ml.GetPermissionMap(id); ViewData["ForeachMenuByOption"] = ForeachMenuByOption(obj.MID, 0); ViewData["ForeachPermissionByOption"] = ForeachPermissionByOption(obj.PID, 0, 1); return(View(obj)); } catch (Exception ex) { return(Content(ContentIcon.Error + "|" + ErrorWirter(RouteData, ex.Message))); } }
public ActionResult Edit(int id, FormCollection formCollection) { try { PermissionMapRepository ml = new PermissionMapRepository(); PermissionMap obj = ml.GetPermissionMap(id); UpdateModel(obj); obj.LastUpdateDate = DateTime.Now; obj.LastUpdateUserID = ID; bool result = ml.Update(obj) > 0 ? true : false; return(result ? Content(ContentIcon.Succeed + "|操作成功") : Content(ContentIcon.Error + "|操作失败")); } catch (Exception ex) { return(Content(ContentIcon.Error + "|" + ErrorWirter(RouteData, ex.Message))); } }