public ActionResult DeleteConfirmed(int id) { CompanyOpeningHour companyOpeningHour = db.CompanyOpeningHours.Find(id); db.CompanyOpeningHours.Remove(companyOpeningHour); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "OpeningTimeID,CompanyID,DayOfWeek,OpeningTime,ClosingTime,NotesIfClosed")] CompanyOpeningHour companyOpeningHour) { if (ModelState.IsValid) { db.Entry(companyOpeningHour).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CompanyID = new SelectList(db.Companies, "CompanyID", "CompanyName", companyOpeningHour.CompanyID); return(View(companyOpeningHour)); }
// GET: CompanyOpeningHours/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CompanyOpeningHour companyOpeningHour = db.CompanyOpeningHours.Find(id); if (companyOpeningHour == null) { return(HttpNotFound()); } return(View(companyOpeningHour)); }
// GET: CompanyOpeningHours/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CompanyOpeningHour companyOpeningHour = db.CompanyOpeningHours.Find(id); if (companyOpeningHour == null) { return(HttpNotFound()); } ViewBag.CompanyID = new SelectList(db.Companies, "CompanyID", "CompanyName", companyOpeningHour.CompanyID); return(View(companyOpeningHour)); }