public async Task <ActionResult> Create([Bind(Include = "ClientID,FirstNames,LastNames,BirthDate,Email,LocalityID")] Client client) { if (ModelState.IsValid) { db.Clients.Add(client); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.LocalityID = new SelectList(CombosHelper.GetLocalities(), "LocalityID", "Name", client.LocalityID); return(View(client)); }
// GET: Clients/Create public ActionResult Create() { ViewBag.LocalityID = new SelectList(CombosHelper.GetLocalities(), "LocalityID", "Name"); return(View()); }