コード例 #1
0
 public IActionResult AddAppoinmentData(AppoinmentModel model)
 {
     try
     {
         ResultModel res = new ResultModel();
         if (model == null)
         {
             return(BadRequest(new Exception("Unable to fetch record")));
         }
         else
         {
             res = _scheduleRepository.SaveAppoinmentData(model);
             if (res.Code == 1)
             {
                 res.Response = "Appointment Booked";
             }
             else
             {
                 res.Response = "Appointment not booked due to some error";
             }
             return(Ok(res));
         }
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
コード例 #2
0
        public IActionResult GetAppointmentData(int doctorId, string patientUserName)
        {
            AppoinmentModel data = new AppoinmentModel();

            try
            {
                if (string.IsNullOrEmpty(doctorId.ToString()) && string.IsNullOrEmpty(patientUserName))
                {
                    return(BadRequest(new Exception("Unable to fetch record")));
                }
                else
                {
                    data = _scheduleRepository.GetAppoinmentData(doctorId.ToString(), patientUserName);
                    return(Ok(data));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }