public ActionResult DeleteConfirmed(int id) { TouristGroupInfo touristGroupInfo = db.TouristGroupInfoes.Find(id); db.TouristGroupInfoes.Remove(touristGroupInfo); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,TouristId,GroupId,StartDate,EndDate")] TouristGroupInfo touristGroupInfo) { if (ModelState.IsValid) { db.Entry(touristGroupInfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GroupId = new SelectList(db.Groups, "Id", "Name", touristGroupInfo.GroupId); ViewBag.TouristId = new SelectList(db.Tourists, "Id", "Name", touristGroupInfo.TouristId); return(View(touristGroupInfo)); }
// GET: TouristGroupInfoes/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TouristGroupInfo touristGroupInfo = db.TouristGroupInfoes.Find(id); if (touristGroupInfo == null) { return(HttpNotFound()); } return(View(touristGroupInfo)); }
// GET: TouristGroupInfoes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TouristGroupInfo touristGroupInfo = db.TouristGroupInfoes.Find(id); if (touristGroupInfo == null) { return(HttpNotFound()); } ViewBag.GroupId = new SelectList(db.Groups, "Id", "Name", touristGroupInfo.GroupId); ViewBag.TouristId = new SelectList(db.Tourists, "Id", "Name", touristGroupInfo.TouristId); return(View(touristGroupInfo)); }