/// <summary> /// Add CompanyImage AppService /// </summary> /// <returns>bool<bool></returns> public async Task <bool> AddCompanyImage(CompanyImageAddDTO companyImageAddDTO) { #region Declare a return type with initial value. bool isCreated = false; #endregion try { if (companyImageAddDTO != null) { isCreated = await CompanyImageBusinessMapping.AddCompanyImage(companyImageAddDTO); } } catch (Exception exception) {} return(isCreated); }
/// <summary> /// Mapping user Action Actitvity Log /// </summary> /// <param name=></ param > /// <returns>Task<CompanyImage></returns> public CompanyImage MappingCompanyImageAddDTOToCompanyImage(CompanyImageAddDTO CompanyImageAddDTO) { #region Declare a return type with initial value. CompanyImage CompanyImage = null; #endregion try { CompanyImage = new CompanyImage { CompanyInformationId = CompanyImageAddDTO.CompanyInformationId, CompanyImgeUrl = CompanyImageAddDTO.CompanyImgeURL, IsMainPhoto = CompanyImageAddDTO.IsMainPhoto, CreationDate = DateTime.Now, IsDeleted = (byte)DeleteStatusEnum.NotDeleted }; } catch (Exception exception) { } return(CompanyImage); }
/// <summary> /// Create User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> AddCompanyImage(CompanyImageAddDTO CompanyImageAddDTO) { #region Declare a return type with initial value. bool isCompanyImageCreated = default(bool); #endregion try { #region Vars CompanyImage CompanyImage = null; #endregion CompanyImage = CompanyImageMapping.MappingCompanyImageAddDTOToCompanyImage(CompanyImageAddDTO); if (CompanyImage != null) { await UnitOfWork.CompanyImageRepository.Insert(CompanyImage); isCompanyImageCreated = await UnitOfWork.Commit() > default(int); } } catch (Exception exception) { } return(isCompanyImageCreated); }
public async Task <ActionResult <CommonAPIResponse <bool> > > AddCompanyImage(CompanyImageAddDTO CompanyImageAddDTO) { #region Declare return type with initial value. JsonResult jsonResult = GetDefaultJsonResult <bool>(); #endregion try { #region Validate AddCompanyImage for nullability before prepaing the response. if (await CompanyImageAppService.AddCompanyImage(CompanyImageAddDTO)) { 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); }