コード例 #1
0
        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));
            }
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
        //
        // 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));
            }
        }