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)); }
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)); }