public async Task <ActionResult <CommonAPIResponse <CompanyInformationReturnDTO> > > GetCompanyInformationById(int id) { #region Vars CompanyInformationReturnDTO CompanyInformationReturnDTO = null; #endregion #region Declare return type with initial value. JsonResult jsonResult = GetDefaultJsonResult <object>(); #endregion try { if (id != default(int)) { CompanyInformationReturnDTO = await CompanyInformationAppService.GetCompanyInformationById(id); } #region Validate userIdentityDTO for nullability before prepaing the response. if (CompanyInformationReturnDTO != null) { jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), CompanyInformationReturnDTO, HttpStatusCode.OK); } else { jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), new object(), HttpStatusCode.BadRequest); } #endregion } catch (Exception exception) { } return(jsonResult); }
public CompanyInformationReturnDTO MappingCompanyInformationToCompanyInformationReturnDTO(CompanyInformation CompanyInformation) { #region Declare a return type with initial value. CompanyInformationReturnDTO CompanyInformationReturnDTO = null; #endregion try { if (CompanyInformation != null) { CompanyInformationReturnDTO = new CompanyInformationReturnDTO { CompanyInformationId = CompanyInformation.CompanyInformationId, CompanyName = CompanyInformation.CompanyName, CompanyPhone = CompanyInformation.CompanyPhone, CompanyProfile = CompanyInformation.CompanyProfile, CompanySizeId = CompanyInformation.CompanySizeId, CompanyTypeId = (byte)CompanyInformation.CompanyTypeId, CompanyWebsite = CompanyInformation.CompanyWebsite, EmployerId = CompanyInformation.EmployerId, Fax = CompanyInformation.Fax, IsMultinational = (bool)CompanyInformation.IsMultinational, IsStartupCompany = (bool)CompanyInformation.IsStartupCompany, Specialties = CompanyInformation.Specialties, YearFounded = (int)CompanyInformation.YearFounded, Logo = CompanyInformation.Logo, }; } } catch (Exception exception) { } return(CompanyInformationReturnDTO); }
/// <summary> /// Get CompanyInformation By Id /// </summary> /// <returns>CompanyInformationReturnDTO<CompanyInformationReturnDTO></returns> public async Task <CompanyInformationReturnDTO> GetCompanyInformationById(int CompanyInformationId) { #region Declare a return type with initial value. CompanyInformationReturnDTO CompanyInformation = null; #endregion try { if (CompanyInformationId > default(int)) { CompanyInformation = await CompanyInformationBusinessMapping.GetCompanyInformationById(CompanyInformationId); } } catch (Exception exception) {} return(CompanyInformation); }
/// <summary> /// Get user Action Activity Log By Id /// </summary> /// <returns>List<CompanyInformationReturnDTO></returns> public async Task <CompanyInformationReturnDTO> GetCompanyInformationById(int CompanyInformationId) { #region Declare a return type with initial value. CompanyInformationReturnDTO CompanyInformation = new CompanyInformationReturnDTO(); #endregion try { CompanyInformation companyInformation = await UnitOfWork.CompanyInformationRepository.GetById(CompanyInformationId); if (companyInformation != null) { if (companyInformation.IsDeleted != (byte)DeleteStatusEnum.Deleted) { CompanyInformation = CompanyInformationMapping.MappingCompanyInformationToCompanyInformationReturnDTO(companyInformation); } } } catch (Exception exception) { } return(CompanyInformation); }