Exemple #1
0
        public ViewResult EditDoctorShedule(int id, string personid, int emplolyeeid)
        {
            Employee               employee               = _employeeRepository.GetEmployee(emplolyeeid);
            ApplicationUser        person                 = _employeeRepository.GetPerson(personid);
            DoctorsSchedule        doctorsSchedule        = _doctorsScheduleRepository.GetDoctorsSchedule(id);
            DoctorSheduleViewModel doctorSheduleViewModel = new DoctorSheduleViewModel
            {
                Id         = doctorsSchedule.Id,
                Name       = person.Name,
                EmployeeId = doctorsSchedule.EmployeeId,
                Day        = doctorsSchedule.Day,
                Time       = doctorsSchedule.Time
            };

            return(View(doctorSheduleViewModel));
        }
Exemple #2
0
        public ViewResult EditDoctorShedule(DoctorSheduleViewModel model)
        {
            if (ModelState.IsValid)
            {
                //Employee employee = _employeeRepository.GetEmployee(model.EmployeeId);
                //ApplicationUser person = _employeeRepository.GetPerson(model.PersonId);
                DoctorsSchedule doctorsSchedule = _doctorsScheduleRepository.GetDoctorsSchedule(model.Id);

                doctorsSchedule.Id         = model.Id;
                doctorsSchedule.EmployeeId = model.EmployeeId;
                doctorsSchedule.Day        = model.Day;
                doctorsSchedule.Time       = model.Time;
                DoctorsSchedule updatedoctorschedule = _doctorsScheduleRepository.Update(doctorsSchedule);
            }
            //return RedirectToAction("ListDoctorShedule");
            return(View(model));
        }