Example #1
0
        public ActionResult UpdateCompany()
        {
            var userName = User.Identity.Name;
            ApplicationUserManager userManager = HttpContext.GetOwinContext().GetUserManager <ApplicationUserManager>();
            var user             = userManager.FindByName(userName);
            CompanyViewModel  cc = new CompanyViewModel();
            DatabaseControler dc = new DatabaseControler();

            dc.GetCompany(ref cc, user.Id);
            return(View(cc));
        }
Example #2
0
        public ActionResult Index(CompanytMessageId?message)
        {
            ViewBag.StatusMessage =
                message == CompanytMessageId.UpdateCompanySuccess ? "Dane firmy zostaƂy zapisane w bazie." : "";
            var userName = User.Identity.Name;
            ApplicationUserManager userManager = HttpContext.GetOwinContext().GetUserManager <ApplicationUserManager>();
            var user            = userManager.FindByName(userName);
            CompanyViewModel cc = new CompanyViewModel();

            if (userManager.GetRoles(user.Id).Contains("ADMINISTRATOR"))
            {
                cc.IsAdministrator = true;
            }
            cc.IsAccountConfirmed = user.EmailConfirmed;
            DatabaseControler dc = new DatabaseControler();

            dc.GetCompany(ref cc, user.Id);
            return(View(cc));
        }