public void Persist(Factory repositoryFactory) { Models.Resident resident = new Models.Resident { FirstName = this.FirstName, LastName = this.LastName, LotNumber = this.LotNumber, PhoneNumber = this.PhoneNumber, Email = this.Email }; repositoryFactory.GetResidentRepository().Save(resident); }
public ActionResult Client(Client c) { if (ModelState.IsValid) { Session["Client"] = c; c.add(); Session["RClient"] = c.Client_ID; return(RedirectToAction("Application")); } Models.Country country = new Models.Country(); ViewBag.allcountry = country.GetallCountry(); Models.Gender g = new Models.Gender(); ViewBag.allgender = g.Getallgender(); Models.Resident r = new Models.Resident(); ViewBag.allresident = r.getallresident(); return(View(c)); }
public ActionResult Client() { Session["Client"] = null; if (Session["Request"] == null) { return(RedirectToAction("Request")); } Models.Country country = new Models.Country(); ViewBag.allcountry = country.GetallCountry(); Models.Gender g = new Models.Gender(); ViewBag.allgender = g.Getallgender(); Models.Resident r = new Models.Resident(); ViewBag.allresident = r.getallresident(); if (Session["Nationality"] != null) { Client c = new Client(); c.Country_ID = Convert.ToInt32(Session["Nationality"]); return(View(c)); } return(View()); }