Example #1
0
        public ActionResult Create(Client client)
        {
            if (ModelState.IsValid)
            {
                if (CVM.ExistDataBase(client))
                {
                    ModelState.AddModelError("name", "Este cliente ya existe");

                    return(View(client));
                }
                else
                {
                    CVM.Create(client);

                    return(RedirectToAction("Index"));
                }
            }
            else
            {
                return(View(client));
            }
        }