public ActionResult DeleteConfirmed(int id)
 {
     ManagerTimeSlot managerTimeSlot = db.managerTimeSlots.Find(id);
     db.managerTimeSlots.Remove(managerTimeSlot);
     db.SaveChanges();
     return RedirectToAction("Index");
 }
 public ActionResult Edit([Bind(Include = "ManagerTimeSlotId,TimeSlotId,ManagerEmail")] ManagerTimeSlot managerTimeSlot)
 {
     if (ModelState.IsValid)
     {
         db.Entry(managerTimeSlot).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.TimeSlotId = new SelectList(db.timeslots, "TimeSlotID", "TimeS", managerTimeSlot.TimeSlotId);
     return View(managerTimeSlot);
 }
 // GET: ManagerTimeSlots/Details/5
 public ActionResult Details(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     ManagerTimeSlot managerTimeSlot = db.managerTimeSlots.Find(id);
     if (managerTimeSlot == null)
     {
         return HttpNotFound();
     }
     return View(managerTimeSlot);
 }
 // GET: ManagerTimeSlots/Edit/5
 public ActionResult Edit(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     ManagerTimeSlot managerTimeSlot = db.managerTimeSlots.Find(id);
     if (managerTimeSlot == null)
     {
         return HttpNotFound();
     }
     ViewBag.TimeSlotId = new SelectList(db.timeslots, "TimeSlotID", "TimeS", managerTimeSlot.TimeSlotId);
     return View(managerTimeSlot);
 }
        public ActionResult Create([Bind(Include = "ManagerTimeSlotId,TimeSlotId,ManagerEmail")] ManagerTimeSlot managerTimeSlot)
        {
            if (ModelState.IsValid)
            {
                var userName = User.Identity.GetUserName();
                managerTimeSlot.ManagerEmail = userName;
                db.managerTimeSlots.Add(managerTimeSlot);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.TimeSlotId = new SelectList(db.timeslots, "TimeSlotID", "TimeS", managerTimeSlot.TimeSlotId);
            return View(managerTimeSlot);
        }
예제 #6
0
 public bool Update(ManagerTimeSlot managerTimeSlot)
 {
     return(_databaseService.Update(managerTimeSlot));
 }
예제 #7
0
 public bool Insert(ManagerTimeSlot managerTimeSlot)
 {
     return(_databaseService.Insert(managerTimeSlot));
 }
예제 #8
0
 public bool Delete(ManagerTimeSlot managerTimeSlot)
 {
     return(_databaseService.Delete(managerTimeSlot));
 }