public ActionResult Edit(TimeSlot timeslot) { if (ModelState.IsValid) { db.Entry(timeslot).State = EntityState.Modified; db.SaveChanges(); return PartialView("GridData", new TimeSlot[] { timeslot }); } return PartialView(timeslot); }
public ActionResult Create(TimeSlot timeslot) { if (ModelState.IsValid) { db.TimeSlots.Add(timeslot); db.SaveChanges(); return PartialView("GridData", new TimeSlot[] { timeslot }); } return PartialView("Edit", timeslot); }