Ejemplo n.º 1
0
        public IActionResult OrgEdit(T_PRT_ORGANIZATIONS org)
        {
            //security check
            string _UserIDX = _userManager.GetUserId(User);

            if (_DbPortal.IsUserAnOrgAdmin(_UserIDX, org.ORG_ID))
            {
                string ClientID = _DbPortal.InsertUpdateT_PRT_ORGANIZATIONS(org.ORG_ID, org.ORG_NAME);

                if (ClientID != null)
                {
                    TempData["Success"] = "Update successful.";
                }
                else
                {
                    TempData["Error"] = "Error editing organization.";
                }
            }
            else
            {
                TempData["Error"] = "You must have admin rights to edit this Organization.";
            }

            return(RedirectToAction("OrgEdit", new { id = org.ORG_ID }));
        }