/// <summary> /// Updae EmployerJobRole AppService /// </summary> /// <returns>bool<bool></returns> public async Task <bool> UpdateEmployerJobRole(EmployerJobRoleUpdateDTO employerJobRoleUpdateDTO) { #region Declare a return type with initial value. bool isUpdated = false; #endregion try { if (employerJobRoleUpdateDTO != null) { isUpdated = await EmployerJobRoleBusinessMapping.UpdateEmployerJobRole(employerJobRoleUpdateDTO); } } catch (Exception exception) {} return(isUpdated); }
/// <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); }
/// <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); }
public async Task <ActionResult <CommonAPIResponse <bool> > > UpdateEmployerJobRole(EmployerJobRoleUpdateDTO EmployerJobRoleUpdateDTO) { #region Declare return type with initial value. JsonResult jsonResult = GetDefaultJsonResult <bool>(); #endregion try { #region Validate userUpdateDTO for nullability before prepaing the response. if (await EmployerJobRoleAppService.UpdateEmployerJobRole(EmployerJobRoleUpdateDTO)) { jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), true, HttpStatusCode.OK); } else { jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), false, HttpStatusCode.BadRequest); } #endregion } catch (Exception exception) { } return(jsonResult); }