Example #1
0
        public ActionResult EditRole(Role record)
        {
            try
            {
                if (record != null)
                {
                    var roleBusiness = new RoleBusiness();

                    var temp = roleBusiness.GetById(record.Id);
                    temp.Code         = record.Code;
                    temp.Modifieddate = DateTime.Now;
                    temp.Name         = record.Name;
                    temp.Title        = record.Name;
                    temp.Status       = record.Status;
                    temp.Description  = record.Description;
                    roleBusiness.Edit(temp);
                    return(RedirectToAction("Roles"));
                }

                return(View());
            }
            catch (FaultException ex)
            {
                var    exep    = Function.GetExeption(ex);
                var    codeExp = exep[1];
                string url     = "Error/ErrorFunction/" + codeExp;
                return(RedirectToActionPermanent(url));
            }
        }
Example #2
0
        public ActionResult ManageModulesForRole(long?id, int?page)
        {
            try
            {
                int currentPageIndex = page.HasValue ? page.Value : 1;

                InitSelectListItemModule(id);

                var roleModuleBusiness        = new RoleModuleBusiness();
                var roleBusiness              = new RoleBusiness();
                IList <RoleModule> roleModule = roleModuleBusiness.GetByRoleId((long)id).ToPagedList(currentPageIndex, 30);

                var role = roleBusiness.GetById((long)id);

                ViewData["rolename"] = role.Name;

                return(View((IPagedList <RoleModule>)roleModule));
            }
            catch (FaultException ex)
            {
                var    exep    = Function.GetExeption(ex);
                var    codeExp = exep[1];
                string url     = "Error/ErrorFunction/" + codeExp;
                return(RedirectToActionPermanent(url));
            }
        }
Example #3
0
        //
        // GET: /CMSBHDType/Create

        public ActionResult EditRole(long id = 0)
        {
            try
            {
                InitSelectListItemStatus();
                var roleBusiness = new RoleBusiness();

                var record = roleBusiness.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));
            }
        }