Esempio n. 1
0
        public ActionResult Create([Bind(Exclude = "ClientID")] Client newClient)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            try
            {
                _dataModel.AddToClients(newClient);
                _dataModel.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(RedirectToAction("Create", "Project"));
            }
        }