/// <summary> /// Updae TypeOfJob AppService /// </summary> /// <returns>bool<bool></returns> public async Task <bool> UpdateTypeOfJob(TypeOfJobUpdateDTO typeOfJobUpdateDTO) { #region Declare a return type with initial value. bool isUpdated = false; #endregion try { if (typeOfJobUpdateDTO != null) { isUpdated = await TypeOfJobBusinessMapping.UpdateTypeOfJob(typeOfJobUpdateDTO); } } catch (Exception exception) {} return(isUpdated); }
/// <summary> /// Mapping User Activity Log DTO to Action /// </summary> /// <param name=></param> /// <param name=></param> /// <returns></returns> public TypeOfJob MappingTypeOfJobupdateDTOToTypeOfJob(TypeOfJob typeOfJob, TypeOfJobUpdateDTO TypeOfJobUpdateDTO) { #region Declare Return Var with Intial Value TypeOfJob TypeOfJob = typeOfJob; #endregion try { if (TypeOfJobUpdateDTO.TypeOfJobId > default(int)) { TypeOfJob.TypeOfJobId = TypeOfJobUpdateDTO.TypeOfJobId; TypeOfJob.TypeOfJobName = TypeOfJobUpdateDTO.TypeOfJobName; } } catch (Exception exception) { } return(TypeOfJob); }
/// <summary> /// Update User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> UpdateTypeOfJob(TypeOfJobUpdateDTO TypeOfJobUpdateDTO) { #region Declare a return type with initial value. bool isTypeOfJobUpdated = default(bool); #endregion try { if (TypeOfJobUpdateDTO != null) { #region Vars TypeOfJob TypeOfJob = null; #endregion #region Get Activity By Id TypeOfJob = await UnitOfWork.TypeOfJobRepository.GetById(TypeOfJobUpdateDTO.TypeOfJobId); #endregion if (TypeOfJob != null) { #region Mapping TypeOfJob = TypeOfJobMapping.MappingTypeOfJobupdateDTOToTypeOfJob(TypeOfJob, TypeOfJobUpdateDTO); #endregion if (TypeOfJob != null) { #region Update Entity UnitOfWork.TypeOfJobRepository.Update(TypeOfJob); isTypeOfJobUpdated = await UnitOfWork.Commit() > default(int); #endregion } } } } catch (Exception exception) { } return(isTypeOfJobUpdated); }
public async Task <ActionResult <CommonAPIResponse <bool> > > UpdateTypeOfJob(TypeOfJobUpdateDTO TypeOfJobUpdateDTO) { #region Declare return type with initial value. JsonResult jsonResult = GetDefaultJsonResult <bool>(); #endregion try { #region Validate userUpdateDTO for nullability before prepaing the response. if (await TypeOfJobAppService.UpdateTypeOfJob(TypeOfJobUpdateDTO)) { 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); }