public IHttpActionResult AddDoctorCalendar([FromBody] DoctorCalendarDTO doctorCalendarDTO) { if (doctorCalendarDTO == null) { return(BadRequest()); } var results = _doctorCalendarService.AddDoctorCalender(doctorCalendarDTO); return(Ok(results)); }
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); }
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); }
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); } }