public ActionResult EditGroup(UserGroup record) { try { if (record != null) { var groupBusiness = new UserGroupBusiness(); var temp = groupBusiness.GetById(record.Id); temp.Code = record.Code; temp.Modifieddate = DateTime.Now; temp.Name = record.Name; temp.Status = record.Status; temp.Description = record.Description; groupBusiness.Edit(temp); return(RedirectToAction("Groups")); } return(View()); } catch (FaultException ex) { var exep = Function.GetExeption(ex); var codeExp = exep[1]; string url = "Error/ErrorFunction/" + codeExp; return(RedirectToActionPermanent(url)); } }
public ActionResult ManageRolesForGroup(long?id, int?page) { try { int currentPageIndex = page.HasValue ? page.Value : 1; InitSelectListItemRole(id); var userGroupRoleBusiness = new UserGroupRoleBusiness(); var userGroupBusiness = new UserGroupBusiness(); if (id != null) { IList <UserGroupRole> userGroupRole = userGroupRoleBusiness.GetByGroupId((long)id).ToPagedList(currentPageIndex, 30); var userGroup = userGroupBusiness.GetById((long)id); ViewData["group_name"] = userGroup.Name; return(View((IPagedList <UserGroupRole>)userGroupRole)); } } catch (FaultException ex) { var exep = Function.GetExeption(ex); var codeExp = exep[1]; string url = "Error/ErrorFunction/" + codeExp; return(RedirectToActionPermanent(url)); } return(RedirectToAction("Groups")); }
// // GET: /CMSBHDType/Create public ActionResult EditGroup(long id = 0) { try { InitSelectListItemStatus(); UserGroupBusiness groupBusiness = new UserGroupBusiness(); var record = groupBusiness.GetById(id); if (record == null) { return(HttpNotFound()); } return(View(record)); } catch (FaultException ex) { var exep = Function.GetExeption(ex); var codeExp = exep[1]; string url = "Error/ErrorFunction/" + codeExp; return(RedirectToActionPermanent(url)); } }