Beispiel #1
0
        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));
        }
Beispiel #2
0
 // GET: Clients/Create
 public ActionResult Create()
 {
     ViewBag.LocalityID = new SelectList(CombosHelper.GetLocalities(), "LocalityID", "Name");
     return(View());
 }