public ActionResult Edit(int id = 0)
        {
            if (id == 0)
            {
                int accountId = _accountRepository.FindAll(a => a.Email == User.Identity.Name).FirstOrDefault().ID;
                return RedirectToAction("Edit", "Account", new { id = accountId });
            }

            int targetAccount;
            if (IsAdmin(User.Identity.Name))
            {
                targetAccount = id;
            }
            else
            {
                targetAccount = _accountRepository.FindAll(a => a.Email == User.Identity.Name).FirstOrDefault().ID;
            }

            EditAccountViewModel viewModel = new EditAccountViewModel();
            Account account = _accountRepository.FindAll().Where(a => a.ID == targetAccount).FirstOrDefault();
            if (account == null)
            {
                return RedirectToAction("Index", "Home", null);
            }

            viewModel.FirstName = account.FirstName;
            viewModel.LastName = account.LastName;
            viewModel.Company = account.Company;
            viewModel.RegistrationNumber = account.RegistrationNumber;
            viewModel.Address = account.Address;
            viewModel.Phone = account.Phone;

            return View(viewModel);
        }
        public ActionResult Edit(EditAccountViewModel viewModel)
        {
            Account account = _accountRepository.FindAll(a => a.Email == User.Identity.Name).FirstOrDefault();
            if (account == null)
            {
                return RedirectToAction("Index", "Home", null);
            }

            account.FirstName = viewModel.FirstName;
            account.LastName = viewModel.LastName;
            account.Company = viewModel.Company;
            account.RegistrationNumber = viewModel.RegistrationNumber;
            account.Address = viewModel.Address;
            account.Phone = viewModel.Phone;

            _accountRepository.Save(account);

            return RedirectToAction("View");
        }