Пример #1
0
        public IHttpActionResult AddDoctorCalendar([FromBody] DoctorCalendarDTO doctorCalendarDTO)
        {
            if (doctorCalendarDTO == null)
            {
                return(BadRequest());
            }
            var results = _doctorCalendarService.AddDoctorCalender(doctorCalendarDTO);

            return(Ok(results));
        }
Пример #2
0
        public DoctorCalendarDTO ConvertTODTO(DoctorCalendar obj)
        {
            var doctorCalendarDTO = new DoctorCalendarDTO()
            {
                DoctorCalendarID = obj.DoctorCalendarID,
                DoctorID         = obj.DoctorID,
                Date             = obj.Date,
                StartTime        = obj.StartTime,
                EndTime          = obj.EndTime
            };

            return(doctorCalendarDTO);
        }
Пример #3
0
        public DoctorCalendar ConvertTOModel(DoctorCalendarDTO obj)
        {
            var doctorCalendar = new DoctorCalendar()
            {
                DoctorCalendarID = obj.DoctorCalendarID,
                DoctorID         = obj.DoctorID,
                Date             = obj.Date,
                StartTime        = obj.StartTime,
                EndTime          = obj.EndTime
            };

            return(doctorCalendar);
        }
Пример #4
0
 public DoctorCalendarDTO AddDoctorCalender(DoctorCalendarDTO obj)
 {
     try
     {
         var objDoctorCalendar = ConvertTOModel(obj);
         var results           = _doctorCalendarRepository.SaveorUpdate(objDoctorCalendar);
         return(ConvertTODTO(results));
     }
     catch (Exception ex)
     {
         log.ErrorFormat("Exception occured while Adding new DoctorCalendar Info Ex:{0}", ex.Message);
         return(null);
     }
 }