public ActionResult Create(Otel otel) { if (ModelState.IsValid) { db.Otel.Add(otel); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.firmaId = new SelectList(db.Firmalar, "firmaId", "firmaAdi", otel.firmaId); return PartialView(otel); }
public ActionResult Edit(Otel otel) { if (ModelState.IsValid) { db.Entry(otel).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.firmaId = new SelectList(db.Firmalar, "firmaId", "firmaAdi", otel.firmaId); return PartialView(otel); }