public ActionResult DeleteConfirmed(int id) { SpecialServiceDay specialServiceDay = db.SpecialServiceDays.Find(id); db.SpecialServiceDays.Remove(specialServiceDay); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "SpecialServiceDayID,Date,ServiceAddressID")] SpecialServiceDay specialServiceDay) { if (ModelState.IsValid) { db.Entry(specialServiceDay).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ServiceAddressID = new SelectList(db.ServiceAddresses, "ServiceAddressID", "Address1", specialServiceDay.ServiceAddressID); return(View(specialServiceDay)); }
// GET: SpecialServiceDays/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SpecialServiceDay specialServiceDay = db.SpecialServiceDays.Find(id); if (specialServiceDay == null) { return(HttpNotFound()); } return(View(specialServiceDay)); }
// GET: SpecialServiceDays/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SpecialServiceDay specialServiceDay = db.SpecialServiceDays.Find(id); if (specialServiceDay == null) { return(HttpNotFound()); } ViewBag.ServiceAddressID = new SelectList(db.ServiceAddresses, "ServiceAddressID", "Address1", specialServiceDay.ServiceAddressID); return(View(specialServiceDay)); }