Ejemplo n.º 1
0
        //
        // GET: /User/Edit/5

        public ActionResult Edit(string id)
        {
            var guid   = Guid.Empty;
            var result = PartialView("Edit", new User());

            try
            {
                Shrike.Areas.ErrorManagementUI.ErrorManagementUI.Helpers.CustomErrors.SetLayoutForErrorPage(
                    Request.IsAjaxRequest());

                if (Guid.TryParse(id, out guid))
                {
                    ViewBag.RolesString = _userBusinessLogic.GetTenantRoles(); // RoleManager.TenantRoles;
                    var user = _userUILogic.GetUserById(guid);
                    result = PartialView("Edit", user);
                }
            }
            catch (Exception ex)
            {
                string message = string.Concat(
                    ex.ToString(), ex.InnerException != null ? ex.InnerException.ToString() : string.Empty);
                if (ex.InnerException != null)
                {
                    ViewBag.Error = ex.ToString() + "\n InnerException: " + ex.InnerException;
                    throw new Exception(ex.ToString(), ex.InnerException);
                }
                else
                {
                    ViewBag.Error = ex.ToString();
                    throw new Exception(ex.ToString());
                }
            }
            return(result);
        }