public ServiceResponse UpdateSchedule(UpdateScheduleViewModel updateScheduleViewModel) { var procUpdateSolidarity = $"Proc_UpdateSchedule @employeeId , @inter , @interviewTime , @interviewAddress "; var param = new object[] { updateScheduleViewModel.EmployeeId,updateScheduleViewModel.InterviewerId,updateScheduleViewModel.InterviewTime,updateScheduleViewModel.InterviewAddress }; var result = base.Update(procUpdateSolidarity, param); return result; }
public static ScheduleDTO UpdateScheduleVMToDTO(UpdateScheduleViewModel updateSchedule) { return(new ScheduleDTO { Id = updateSchedule.Id, UserId = updateSchedule.UserId, StartTime = updateSchedule.StartTime, EndTime = updateSchedule.EndTime }); }
public IActionResult UpdateSchedule(int id, [FromBody] UpdateScheduleViewModel updateSchedule) { if (id != updateSchedule.Id) { return(BadRequest()); } if (!_scheduleService.Exist(id) && !_userService.Exist(updateSchedule.UserId)) { return(NotFound()); } var scheduleDTO = ScheduleMapper.UpdateScheduleVMToDTO(updateSchedule); _scheduleService.Update(scheduleDTO); return(NoContent()); }
public IActionResult UpdateSchedule([FromBody] UpdateScheduleViewModel updateScheduleViewModel) { var result = _employeeRepository.UpdateSchedule(updateScheduleViewModel); return(Ok(result)); }