/// <summary> /// To send deleted vacation of employee to Time Attendance App /// </summary> /// <param name="VacationID"></param> /// <returns></returns> public Result DeleteEmployeeVacation(int VacationID, string DeletedBy) { try { Result result = new Result(); result.EnumType = typeof(VacationsValidationEnum); EditEmployeeVacation EmployeeVacationDTO = new EditEmployeeVacation() { HCMVacationID = VacationID, UserEmployeeCodeNo = DeletedBy, }; var DeleteTask = client.DeleteAsync("EmployeeVacation/ " + VacationID + "/" + DeletedBy); if (DeleteTask.Result.IsSuccessStatusCode) { result.EnumMember = VacationsValidationEnum.Done.ToString(); } else { result.EnumMember = VacationsValidationEnum.RejectedBecauseOfErrorInTimeAttendanceApp.ToString(); } return(result); } catch (Exception) { throw; } }
/// <summary> /// To send updated vacation data of employee to Time Attendance App /// </summary> /// <param name="VacationStartDate"></param> /// <param name="VacationEndDate"></param> /// <param name="UpdatedBy"></param> /// <param name="VacationID"></param> /// <returns></returns> public Result EditEmployeeVacation(int VacationID, DateTime VacationStartDate, DateTime VacationEndDate, string UpdatedBy) { try { Result result = new Result(); result.EnumType = typeof(VacationsValidationEnum); EditEmployeeVacation EmployeeVacationDTO = new EditEmployeeVacation() { HCMVacationID = VacationID, StartDate = VacationStartDate, EndDate = VacationEndDate, UserEmployeeCodeNo = UpdatedBy, }; var PutTask = client.PutAsJsonAsync <EditEmployeeVacation>("EmployeeVacation", EmployeeVacationDTO).Result; if (PutTask.IsSuccessStatusCode) { result.EnumMember = VacationsValidationEnum.Done.ToString(); } else { result.EnumMember = VacationsValidationEnum.RejectedBecauseOfErrorInTimeAttendanceApp.ToString(); } return(result); } catch (Exception) { throw; } }