public ActionResult Delete(int? id)
        {
            UnitOfWork unitOfWork = new UnitOfWork();
            UsersService usersService = new UsersService(unitOfWork);

            if (!id.HasValue)
            {
                return RedirectToAction("List");
            }

            usersService.Delete(id.Value);

            return RedirectToAction("List");
        }
        public ActionResult Edit()
        {
            UnitOfWork unitOfWork = new UnitOfWork();
            UsersService usersService = new UsersService(unitOfWork);

            UsersEditVM model = new UsersEditVM();
            TryUpdateModel(model);

            User user;
            if (model.ID == 0)
            {
                user = new User();
            }
            else
            {
                user = usersService.GetByID(model.ID);
                if (user == null)
                {
                    return RedirectToAction("List");
                }
            }

            if (!ModelState.IsValid)
            {
                model.Cities = usersService.GetSelectedCities();
                model.Teams = usersService.GetSelectedTeams(user.Teams, model.SelectedTeams);

                return View(model);
            }

            user.ID = model.ID;
            user.Username = model.Username;
            user.FirstName = model.FirstName;
            user.LastName = model.LastName;
            user.Email = model.Email;
            user.UserRole = model.UserRole;
            user.CityID = model.CityID;

            usersService.UpdateUserTeams(user, model.SelectedTeams);

            usersService.Save(user);

            return RedirectToAction("List");
        }