コード例 #1
0
        public IActionResult CreatePrescription()
        {
            var doctors      = _selectService.GetDoctorSelectList();
            var apothecaries = _selectService.GetApothecarySelectList();

            if (!doctors.IsSuccess)
            {
                return(RedirectToIndex(doctors.FailureMessage));
            }
            if (!apothecaries.IsSuccess)
            {
                return(RedirectToIndex(apothecaries.FailureMessage));
            }

            var model = new CreatePrescriptionViewModel
            {
                ApothecarySelect = apothecaries.Value,
                DoctorSelect     = doctors.Value,
                PrescriptionDate = DateTime.Now
            };

            return(View(model));
        }