Esempio n. 1
0
        public ActionResult EditClient(FormCollection formValues, int clientID)
        {
            if (formValues["Submit"].Equals("Zapisz", StringComparison.InvariantCultureIgnoreCase))
            {
                ClientsRepository clientRepo = new ClientsRepository();
                Client            client     = clientRepo.GetClient(clientID);
                UpdateModel <Client>(client);
                if (ValidateClient(client.ClientName, client.ClientPrefix))
                {
                    clientRepo.SubmitChanges();
                }
                else
                {
                    return(View(client));
                }
            }

            return(RedirectToAction("Clients"));
        }