예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            timeslot timeslot = db.timeslots.Find(id);

            db.timeslots.Remove(timeslot);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "TimeSlotID,TimeS")] timeslot timeslot)
 {
     if (ModelState.IsValid)
     {
         db.Entry(timeslot).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(timeslot));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "TimeSlotID,TimeS")] timeslot timeslot)
        {
            if (ModelState.IsValid)
            {
                db.timeslots.Add(timeslot);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(timeslot));
        }
예제 #4
0
        // GET: timeslots/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            timeslot timeslot = db.timeslots.Find(id);

            if (timeslot == null)
            {
                return(HttpNotFound());
            }
            return(View(timeslot));
        }
예제 #5
0
 public bool Update(timeslot timeslot)
 {
     return(_databaseService.Update(timeslot));
 }
예제 #6
0
 public bool Insert(timeslot timeslot)
 {
     return(_databaseService.Insert(timeslot));
 }
예제 #7
0
 public bool Delete(timeslot timeslot)
 {
     return(_databaseService.Delete(timeslot));
 }