public ActionResult Create(Province province) { if (ModelState.IsValid) { db.Provinces.Add(province); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.CountryID = new SelectList(db.Countries, "CountryID", "CountryName", province.CountryID); return View(province); }
public ActionResult Edit(Province province) { if (ModelState.IsValid) { db.Entry(province).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.CountryID = new SelectList(db.Countries, "CountryID", "CountryName", province.CountryID); return View(province); }