public IActionResult PatientData(DoctorDateViewModel viewModel)
 {
     if (ModelState.IsValid)
     {
         if (viewModel.DoctorDatas.Id == Guid.Empty)
         {
             patientDataService.Create(viewModel.DoctorDatas);
         }
         else
         {
             patientDataService.Update(viewModel.DoctorDatas);
         }
         return(RedirectToAction("AppointmentResult", new { schedId = viewModel.DoctorDatas.ScheduleId }));
     }
     return(View(viewModel));
 }
        public IActionResult Save(PatientData patientData)
        {
            var result = patientData.Id == 0 ? _patientDataService.Create(patientData) : _patientDataService.Update(patientData);

            if (result.Success)
            {
                return(Ok(patientData));
            }
            return(BadRequest());
        }
Exemple #3
0
 public async Task <Patient> UpdatePatient(int id, Patient patient)
 {
     return(await _patientDataService.Update(id, patient));
 }