Exemplo n.º 1
0
        public ActionResult EditReceptionistSchedule(int id)
        {
            var collection = new ReceptionistScheduleCollection
            {
                ReceptionistSchedule = db.ReceptionistSchedules.Single(c => c.Id == id),
                Receptionists        = db.Receptionists.ToList()
            };

            return(View(collection));
        }
Exemplo n.º 2
0
        public ActionResult AddReceptionistSchedule()
        {
            var collection = new ReceptionistScheduleCollection
            {
                ReceptionistSchedule = new ReceptionistSchedule(),
                Receptionists        = db.Receptionists.ToList()
            };

            return(View(collection));
        }
Exemplo n.º 3
0
        public ActionResult AddReceptionistSchedule(ReceptionistScheduleCollection model)
        {
            if (!ModelState.IsValid)
            {
                var collection = new ReceptionistScheduleCollection
                {
                    ReceptionistSchedule = model.ReceptionistSchedule,
                    Receptionists        = db.Receptionists.ToList()
                };
                return(View(collection));
            }

            db.ReceptionistSchedules.Add(model.ReceptionistSchedule);
            db.SaveChanges();
            return(RedirectToAction("ListOfReceptionistSchedules"));
        }
Exemplo n.º 4
0
        public ActionResult EditReceptionistSchedule(int id, ReceptionistScheduleCollection model)
        {
            if (!ModelState.IsValid)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var ReceptionistSchedule = db.ReceptionistSchedules.Single(c => c.Id == id);

            ReceptionistSchedule.ReceptionistId     = model.ReceptionistSchedule.ReceptionistId;
            ReceptionistSchedule.AvailableEndDay    = model.ReceptionistSchedule.AvailableEndDay;
            ReceptionistSchedule.AvailableEndTime   = model.ReceptionistSchedule.AvailableEndTime;
            ReceptionistSchedule.AvailableStartDay  = model.ReceptionistSchedule.AvailableStartDay;
            ReceptionistSchedule.AvailableStartTime = model.ReceptionistSchedule.AvailableStartTime;
            ReceptionistSchedule.Status             = model.ReceptionistSchedule.Status;

            db.SaveChanges();
            return(RedirectToAction("ListOfReceptionistSchedules"));
        }