public ActionResult Edit(ProprietaireTable proprietairetable) { if (ModelState.IsValid) { db.Entry(proprietairetable).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.AdresseId = new SelectList(db.AdresseTables, "AdresseId", "AptNo", proprietairetable.AdresseId); ViewBag.UserId = new SelectList(db.UserTables, "UserId", "Nom", proprietairetable.UserId); return View(proprietairetable); }
public ActionResult Create(ProprietaireTable proprietairetable) { if (ModelState.IsValid) { db.ProprietaireTables.Add(proprietairetable); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.AdresseId = new SelectList(db.AdresseTables, "AdresseId", "AptNo", proprietairetable.AdresseId); ViewBag.UserId = new SelectList(db.UserTables, "UserId", "Nom", proprietairetable.UserId); return View(proprietairetable); }