コード例 #1
0
        public async Task <IActionResult> Edit(string id, PatientEditInputModel patientEditInputModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(patientEditInputModel));
            }

            PatientServiceModel patientServiceModel = AutoMapper.Mapper.Map <PatientServiceModel>(patientEditInputModel);

            await patientService.Edit(id, patientServiceModel);

            return(Redirect("/Patient/All"));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(string id)
        {
            PatientEditInputModel patientEditInputModel = (await patientService.GetById(id)
                                                           ).To <PatientEditInputModel>();

            if (patientEditInputModel == null)
            {
                return(Redirect("/Patient/All"));
            }

            await GetAllDepartments();

            return(View(patientEditInputModel));
        }