Exemplo n.º 1
0
 public ActionResult CompanyAdmin()
 {
     //validate that you cannot manually get into here without the right level, ie ADMIN, SuperAdmin
     if (User.Identity.GetCurrentUserRole() != "Admin" && User.Identity.GetCurrentUserRole() != "SuperUser")
     {
         return(RedirectToAction("Index", "Home"));
     }
     else
     {
         CompanyAdminView companyAdminView = CompanyAdminHelpers.GetCompanyAdminView(User);
         return(View(companyAdminView));
     }
 }
Exemplo n.º 2
0
        public ActionResult CompanyAdmin(CompanyAdminView companyAdminView)
        {
            if (ModelState.IsValid)
            {
                //If the 'Submit' button pressed then update tables, else leave as are so that on reload it takes original values once again.
                if (Request.Form["submitbutton"] != null)
                {
                    CompanyAdminHelpers.UpdateCompanyFromCompanyAdminView(companyAdminView);
                }

                return(RedirectToAction("CompanyAdmin"));
            }
            return(View(companyAdminView));
        }