public IActionResult UpdateFirmAccount(AccoutVM accoutUpdate) { if (_signInManager.IsSignedIn(User)) { _firmAccountRepozytory.updateFirmAccount(User.Identity.Name, accoutUpdate.FirmName, accoutUpdate.FirmDescriotion); } return(RedirectToAction("AccountPanel")); }
public IActionResult AccountPanel() { if (_signInManager.IsSignedIn(User)) { FirmAccount firm = _firmAccountRepozytory.getFirmAccount(User.Identity.Name); AccoutVM model = new AccoutVM() { FirmDescriotion = firm.FirmDescriotion, FirmName = firm.FirmName, Events = firm.Events, Tokens = firm.Tokens, UserName = firm.UserName }; return(View(model)); } return(View("Login")); }
// GET: /<controller>/ public IActionResult AddToken(AccoutVM model) { if (User.Identity.IsAuthenticated) { if (!_tokenRepozytory.TokenExist(model.NewTokenText)) { var newToken = new Token() { FirmAccount = _firmAccoutRepozytory.getFirmAccount(User.Identity.Name), PageId = model.NewPageId, TokenText = model.NewTokenText, UserName = User.Identity.Name, NamePage = model.NewNamePage }; _tokenRepozytory.addToken(newToken); } } return(RedirectToAction("AccountPanel", "Account")); }