Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            checkIN checkIN = db.Checkin.Find(id);

            db.Checkin.Remove(checkIN);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "ID,CheckInDate,name")] checkIN checkIN)
 {
     if (ModelState.IsValid)
     {
         db.Entry(checkIN).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(checkIN));
 }
Ejemplo n.º 3
0
        // GET: checkINs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            checkIN checkIN = db.Checkin.Find(id);

            if (checkIN == null)
            {
                return(HttpNotFound());
            }
            return(View(checkIN));
        }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "ID,CheckInDate,name")] checkIN checkIN)
        {
            if (ModelState.IsValid)
            {
                var    Tlist = db.NewDrivers.Find(checkIN.ID);
                string iname = " ";

                iname               = Tlist.DriverFullName;
                checkIN.name        = iname;
                checkIN.CheckInDate = System.DateTime.UtcNow;
                db.Checkin.Add(checkIN);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(checkIN));
        }