public ActionResult EditAction(ActionInfo actionInfo) { if (!string.IsNullOrEmpty(actionInfo.ActionName) && !string.IsNullOrEmpty(actionInfo.Url) && !string.IsNullOrEmpty(Request["Sort"])) { int sort = 0; int.TryParse(Request["Sort"], out sort); actionInfo.Url = Request["Url"].ToLower(); actionInfo.Sort = sort; actionInfo.ModfiedOn = DateTime.Now; actionInfo.IsMenu = Request["isOrNo"] == "true" ? true : false; if (actionInfo.IsMenu == true) { actionInfo.MenuIcon = Request["ImgSrc"]; } else { actionInfo.MenuIcon = ""; } if (ActionInfoService.Update(actionInfo)) { return(Content("ok")); } } return(Content("no")); }
public ActionResult Edit(ActionInfo actionInfo) { actionInfo.ModifiedOn = DateTime.Now; if (actionInfo.IsMenu == false) { actionInfo.MenuIcon = null; } ActionInfoService.Update(actionInfo); return(Content("ok")); }
public ActionResult Update(ActionInfo ActionInfo) { //同一个上下文不能缓存两个同一个主键的对象 ActionInfo oldUser = ActionInfoService.GetEntities(u => u.Id == ActionInfo.Id).FirstOrDefault(); //查出来一个旧的权限实体,直接在上面修改 //oldUser.UserName = ActionInfo.UserName; //oldUser.UserPwd = ActionInfo.UserPwd; oldUser.Remark = ActionInfo.Remark; bool updateflag = ActionInfoService.Update(oldUser); var jsondata = new { updateflag, Status.code }; return(Json(jsondata, JsonRequestBehavior.AllowGet)); }
public ActionResult EditPost(int id,string actionname,string remark,string httpmethod,string url,string ismenu,string sort,string menuicon) { ActionInfo actionInfo = ActionInfoService.GetEntites(u => u.Id == id).FirstOrDefault(); actionInfo.Id = id; actionInfo.ActionName = actionname; actionInfo.HttpMethod = httpmethod; actionInfo.Url = url; actionInfo.IsMenu = Convert.ToBoolean(ismenu); actionInfo.Sort = Convert.ToInt32(sort); actionInfo.Remark = remark; actionInfo.Modfiedon = DateTime.Now.ToString(); actionInfo.MenuIcon = menuicon; ActionInfoService.Update(actionInfo); return Content("ok"); }
public ActionResult Edit(ActionInfo userInfo) { ActionInfoService.Update(userInfo); return(Content("ok")); }