コード例 #1
0
        public IActionResult Appointment(int id)
        {
            var appVm = new AppointmentViewModel();

            appVm.Patients = _patientrepo.GetAllPatients().Select(x => new SelectListItem()
            {
                Value = x.Id.ToString(), Text = x.Name
            }).ToList();
            appVm.Doctors = _doctorrepo.GetAllDoctors().Select(x => new SelectListItem()
            {
                Value = x.Id.ToString(), Text = x.Name
            }).ToList();
            appVm.Technicians = _techrepo.GetAllTechnicians().Select(x => new SelectListItem()
            {
                Value = x.Id.ToString(), Text = x.Name
            }).ToList();


            if (id == 0)
            {
                return(View(appVm));
            }
            else
            {
                appVm.Appointment = _apprepo.GetAppointmentById(id);
                return(View(appVm));
            }
        }
コード例 #2
0
        public IActionResult ListTechnicians()
        {
            var techsVm = new ListTechniciansViewModel();

            techsVm.Technicians = _techrepo.GetAllTechnicians();
            return(View(techsVm));
        }