public ActionResult DeleteConfirmed(int id)
        {
            ReservationDossier reservationDossier = db.ReservationDossiers.Find(id);

            db.ReservationDossiers.Remove(reservationDossier);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ID,Insurance,CreditCardNumber,TotalPrice,TravelID,ClientID,ReservationDossierStatus,ReasonCancellationDossier,CreatedAt,Deleted,DeletedAt")] ReservationDossier reservationDossier)
 {
     if (ModelState.IsValid)
     {
         db.Entry(reservationDossier).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ClientID = new SelectList(db.Clients, "ID", "Mail", reservationDossier.ClientID);
     ViewBag.TravelID = new SelectList(db.Travels, "ID", "ID", reservationDossier.TravelID);
     return(View(reservationDossier));
 }
        // GET: BackOffice/ReservationDossiersBO/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ReservationDossier reservationDossier = db.ReservationDossiers.Find(id);

            if (reservationDossier == null)
            {
                return(HttpNotFound());
            }
            return(View(reservationDossier));
        }
Example #4
0
        public ActionResult Create([Bind(Include = "ID,Insurance,CreditCardNumber,TotalPrice,TravelID,ClientID,ReservationDossierStatus")] ReservationDossier reservationDossier)
        {
            if (ModelState.IsValid)
            {
                db.Configuration.ValidateOnSaveEnabled = false;
                reservationDossier.CreditCardNumber    = reservationDossier.CreditCardNumber.HashMD5();
                db.ReservationDossiers.Add(reservationDossier);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ClientID = new SelectList(db.Clients, "ID", "Mail", reservationDossier.ClientID);
            ViewBag.TravelID = new SelectList(db.Travels, "ID", "ID", reservationDossier.TravelID);
            return(View(reservationDossier));
        }
Example #5
0
        // GET: ReservationDossiers/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            //ReservationDossier reservationDossier = db.ReservationDossiers.Find(id);
            ReservationDossier reservationDossier = db.ReservationDossiers.Include(x => x.Participants).Include(x => x.Client).SingleOrDefault(x => x.ID == id);

            if (reservationDossier == null)
            {
                return(HttpNotFound());
            }
            return(View(reservationDossier));
        }
        // GET: BackOffice/ReservationDossiersBO/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ReservationDossier reservationDossier = db.ReservationDossiers.Find(id);

            if (reservationDossier == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ClientID = new SelectList(db.Clients, "ID", "Mail", reservationDossier.ClientID);
            ViewBag.TravelID = new SelectList(db.Travels, "ID", "ID", reservationDossier.TravelID);
            return(View(reservationDossier));
        }