/// <summary> /// Delete User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> DeleteEmployerJobRole(int EmployerJobRoleId) { #region Declare a return type with initial value. bool isEmployerJobRoleDeleted = default(bool); #endregion try { if (EmployerJobRoleId > default(int)) { #region Vars EmployerJobRole EmployerJobRole = null; #endregion #region Get EmployerJobRole by id EmployerJobRole = await UnitOfWork.EmployerJobRoleRepository.GetById(EmployerJobRoleId); #endregion #region check if object is not null if (EmployerJobRole != null) { EmployerJobRole.IsDeleted = (byte)DeleteStatusEnum.Deleted; #region Apply the changes to the database UnitOfWork.EmployerJobRoleRepository.Update(EmployerJobRole); isEmployerJobRoleDeleted = await UnitOfWork.Commit() > default(int); #endregion } #endregion } } catch (Exception exception) { } return(isEmployerJobRoleDeleted); }
/// <summary> /// Mapping User Activity Log DTO to Action /// </summary> /// <param name=></param> /// <param name=></param> /// <returns></returns> public EmployerJobRole MappingEmployerJobRoleupdateDTOToEmployerJobRole(EmployerJobRole employerJobRole, EmployerJobRoleUpdateDTO EmployerJobRoleUpdateDTO) { #region Declare Return Var with Intial Value EmployerJobRole EmployerJobRole = employerJobRole; #endregion try { if (EmployerJobRoleUpdateDTO.EmployerJobRoleId > default(int)) { EmployerJobRole.EmployerJobRoleId = EmployerJobRoleUpdateDTO.EmployerJobRoleId; EmployerJobRole.EmployerId = EmployerJobRoleUpdateDTO.EmployerId; EmployerJobRole.JobRoleId = EmployerJobRoleUpdateDTO.EmployerId; } } catch (Exception exception) { } return(EmployerJobRole); }
/// <summary> /// Mapping user Action Actitvity Log /// </summary> /// <param name=></ param > /// <returns>Task<EmployerJobRole></returns> public EmployerJobRole MappingEmployerJobRoleAddDTOToEmployerJobRole(EmployerJobRoleAddDTO EmployerJobRoleAddDTO) { #region Declare a return type with initial value. EmployerJobRole EmployerJobRole = null; #endregion try { EmployerJobRole = new EmployerJobRole { EmployerId = EmployerJobRoleAddDTO.EmployerId, JobRoleId = EmployerJobRoleAddDTO.JobRoleId, CreationDate = DateTime.Now, IsDeleted = (byte)DeleteStatusEnum.NotDeleted }; } catch (Exception exception) { } return(EmployerJobRole); }
/// <summary> /// Get user Action Activity Log By Id /// </summary> /// <returns>List<EmployerJobRoleReturnDTO></returns> public async Task <EmployerJobRoleReturnDTO> GetEmployerJobRoleById(int EmployerJobRoleId) { #region Declare a return type with initial value. EmployerJobRoleReturnDTO EmployerJobRole = new EmployerJobRoleReturnDTO(); #endregion try { EmployerJobRole employerJobRole = await UnitOfWork.EmployerJobRoleRepository.GetById(EmployerJobRoleId); if (employerJobRole != null) { if (employerJobRole.IsDeleted != (byte)DeleteStatusEnum.Deleted) { EmployerJobRole = EmployerJobRoleMapping.MappingEmployerJobRoleToEmployerJobRoleReturnDTO(employerJobRole); } } } catch (Exception exception) { } return(EmployerJobRole); }
/// <summary> /// Create User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> AddEmployerJobRole(EmployerJobRoleAddDTO EmployerJobRoleAddDTO) { #region Declare a return type with initial value. bool isEmployerJobRoleCreated = default(bool); #endregion try { #region Vars EmployerJobRole EmployerJobRole = null; #endregion EmployerJobRole = EmployerJobRoleMapping.MappingEmployerJobRoleAddDTOToEmployerJobRole(EmployerJobRoleAddDTO); if (EmployerJobRole != null) { await UnitOfWork.EmployerJobRoleRepository.Insert(EmployerJobRole); isEmployerJobRoleCreated = await UnitOfWork.Commit() > default(int); } } catch (Exception exception) { } return(isEmployerJobRoleCreated); }
/// <summary> /// Update User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> UpdateEmployerJobRole(EmployerJobRoleUpdateDTO EmployerJobRoleUpdateDTO) { #region Declare a return type with initial value. bool isEmployerJobRoleUpdated = default(bool); #endregion try { if (EmployerJobRoleUpdateDTO != null) { #region Vars EmployerJobRole EmployerJobRole = null; #endregion #region Get Activity By Id EmployerJobRole = await UnitOfWork.EmployerJobRoleRepository.GetById(EmployerJobRoleUpdateDTO.EmployerJobRoleId); #endregion if (EmployerJobRole != null) { #region Mapping EmployerJobRole = EmployerJobRoleMapping.MappingEmployerJobRoleupdateDTOToEmployerJobRole(EmployerJobRole, EmployerJobRoleUpdateDTO); #endregion if (EmployerJobRole != null) { #region Update Entity UnitOfWork.EmployerJobRoleRepository.Update(EmployerJobRole); isEmployerJobRoleUpdated = await UnitOfWork.Commit() > default(int); #endregion } } } } catch (Exception exception) { } return(isEmployerJobRoleUpdated); }
public EmployerJobRoleReturnDTO MappingEmployerJobRoleToEmployerJobRoleReturnDTO(EmployerJobRole EmployerJobRole) { #region Declare a return type with initial value. EmployerJobRoleReturnDTO EmployerJobRoleReturnDTO = null; #endregion try { if (EmployerJobRole != null) { EmployerJobRoleReturnDTO = new EmployerJobRoleReturnDTO { EmployerJobRoleId = EmployerJobRole.EmployerJobRoleId, EmployerId = (int)EmployerJobRole.EmployerId, JobRoleId = (int)EmployerJobRole.JobRoleId, }; } } catch (Exception exception) { } return(EmployerJobRoleReturnDTO); }