Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TouristGroupInfo touristGroupInfo = db.TouristGroupInfoes.Find(id);

            db.TouristGroupInfoes.Remove(touristGroupInfo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
        // 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));
        }
Exemplo n.º 4
0
        // 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));
        }