Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            DR_Car dR_Car = db.DR_Car.Find(id);

            db.DR_Car.Remove(dR_Car);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Type,Catalog,ManufacturedYear,Photo,SeatAmount,Mileage,CarCompany,RentalCompanyId,CarStationId,Price,Feature,Equipment")] DR_Car dR_Car)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dR_Car).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RentalCompanyId = new SelectList(db.DR_RentalCompany, "Id", "Name", dR_Car.RentalCompanyId);
     ViewBag.CarStationId    = new SelectList(db.DR_CarStation, "Id", "Address", dR_Car.CarStationId);
     return(View(dR_Car));
 }
Exemplo n.º 3
0
        // GET: Search/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DR_Car dR_Car = db.DR_Car.Find(id);

            if (dR_Car == null)
            {
                return(HttpNotFound());
            }
            return(View(dR_Car));
        }
Exemplo n.º 4
0
        // GET: Search/Details/5
        public ActionResult Details(int?id)
        {
            ViewData["UserId"] = User.Identity.GetUserId();
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DR_Car dR_Car = db.DR_Car.Find(id);

            if (dR_Car == null)
            {
                return(HttpNotFound());
            }
            return(View(dR_Car));
        }
Exemplo n.º 5
0
        // GET: Search/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DR_Car dR_Car = db.DR_Car.Find(id);

            if (dR_Car == null)
            {
                return(HttpNotFound());
            }
            ViewBag.RentalCompanyId = new SelectList(db.DR_RentalCompany, "Id", "Name", dR_Car.RentalCompanyId);
            ViewBag.CarStationId    = new SelectList(db.DR_CarStation, "Id", "Address", dR_Car.CarStationId);
            return(View(dR_Car));
        }