public async Task <ActionResult <CommonAPIResponse <EmployerReturnDTO> > > GetEmployerById(int id)
        {
            #region Vars
            EmployerReturnDTO EmployerReturnDTO = null;
            #endregion
            #region Declare return type with initial value.
            JsonResult jsonResult = GetDefaultJsonResult <object>();
            #endregion
            try
            {
                if (id != default(int))
                {
                    EmployerReturnDTO = await EmployerAppService.GetEmployerById(id);
                }

                #region Validate userIdentityDTO for nullability before prepaing the response.
                if (EmployerReturnDTO != null)
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), EmployerReturnDTO, HttpStatusCode.OK);
                }
                else
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), new object(), HttpStatusCode.BadRequest);
                }
                #endregion
            }
            catch (Exception exception)
            {
            }
            return(jsonResult);
        }
Exemplo n.º 2
0
 public EmployerReturnDTO MappingEmployerToEmployerReturnDTO(Employer Employer)
 {
     #region Declare a return type with initial value.
     EmployerReturnDTO EmployerReturnDTO = null;
     #endregion
     try
     {
         if (Employer != null)
         {
             EmployerReturnDTO = new EmployerReturnDTO
             {
                 EmployerId    = Employer.EmployerId,
                 FirstName     = Employer.FirstName,
                 LastName      = Employer.LastName,
                 BusinessEmail = Employer.BusinessEmail,
                 MobileNumber  = Employer.MobileNumber,
                 MobileNumber1 = Employer.MobileNumber1,
                 ReferralId    = Employer.ReferralId,
                 Title         = Employer.Title,
             };
         }
     }
     catch (Exception exception)
     { }
     return(EmployerReturnDTO);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Get  Employer By Id
 /// </summary>
 /// <returns>EmployerReturnDTO<EmployerReturnDTO></returns>
 public async Task <EmployerReturnDTO> GetEmployerById(int EmployerId)
 {
     #region Declare a return type with initial value.
     EmployerReturnDTO Employer = null;
     #endregion
     try
     {
         if (EmployerId > default(int))
         {
             Employer = await EmployerBusinessMapping.GetEmployerById(EmployerId);
         }
     }
     catch (Exception exception)  {}
     return(Employer);
 }
        /// <summary>
        /// Get user Action Activity Log By Id
        /// </summary>
        /// <returns>List<EmployerReturnDTO></returns>
        public async Task <EmployerReturnDTO> GetEmployerById(int EmployerId)
        {
            #region Declare a return type with initial value.
            EmployerReturnDTO Employer = new EmployerReturnDTO();
            #endregion
            try
            {
                Employer employer = await UnitOfWork.EmployerRepository.GetById(EmployerId);

                if (employer != null)
                {
                    if (employer.IsDeleted != (byte)DeleteStatusEnum.Deleted)
                    {
                        Employer = EmployerMapping.MappingEmployerToEmployerReturnDTO(employer);
                    }
                }
            }
            catch (Exception exception)
            {
            }
            return(Employer);
        }