public ActionResult Create(ClientViewModel model)
        {
            if(ModelState.IsValid)
            {
                clientService.Create(model);
                return RedirectToAction("Login");
            }

            return View(model);
        }
        public static ClientViewModel GetClient(this IPrincipal principal)
        {
            ClientViewModel client = new ClientViewModel();

            if (GenericPrincipal.Current.Identity.IsAuthenticated)
            {
                IClientService clientService = ServiceLocator.GetClientService();
                int id = Convert.ToInt32(GenericPrincipal.Current.Identity.Name);
                client = clientService.GetModelById(id);
            }
            return client;
        }
        public void Create(ClientViewModel model)
        {
            Client client = new Client
            {
                FirstName = model.FirstName,
                LastName = model.LastName,
                Login = model.Login,
                Password = model.Password,   //.GetHashCode().ToString(),
                Email = model.Email,
                Phone = model.Phone
            };

            using (var context = new WebShopMVCContext())
            {
                context.Clients.Add(client);
                context.SaveChanges();
            }
        }
 public ActionResult Update(ClientViewModel model)
 {
     if (ModelState.IsValid)
     {
         clientService.Update(model);
         return RedirectToAction("List", "Client");
     }
     return View(model);
 }
 public void Update(ClientViewModel model)
 {
     throw new NotImplementedException();
 }