Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            OwnersInformation ownersInformation = db.OwnersInformations.Find(id);

            db.OwnersInformations.Remove(ownersInformation);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "TicketNumber,FirstName,LastName,Make,Model,Color,LicensePlate,ParkedLocation,ParkedBy,exp")] OwnersInformation ownersInformation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ownersInformation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ParkedBy = new SelectList(db.Drivers, "DriversId", "Firstname", ownersInformation.ParkedBy);
     return(View(ownersInformation));
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "TicketNumber,FirstName,LastName,Make,Model,Color,LicensePlate,ParkedLocation,ParkedBy,exp")] OwnersInformation ownersInformation)
        {
            if (ModelState.IsValid)
            {
                ownersInformation.Arrival = DateTime.Now;
                db.OwnersInformations.Add(ownersInformation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ParkedBy = new SelectList(db.Drivers, "DriversId", "Firstname", ownersInformation.ParkedBy);
            return(View(ownersInformation));
        }
Esempio n. 4
0
        // GET: OwnersInformations/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OwnersInformation ownersInformation = db.OwnersInformations.Find(id);

            if (ownersInformation == null)
            {
                return(HttpNotFound());
            }
            return(View(ownersInformation));
        }
Esempio n. 5
0
        // GET: OwnersInformations/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OwnersInformation ownersInformation = db.OwnersInformations.Find(id);

            if (ownersInformation == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ParkedBy = new SelectList(db.Drivers, "DriversId", "Firstname", ownersInformation.ParkedBy);
            return(View(ownersInformation));
        }