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

                #region Validate userIdentityDTO for nullability before prepaing the response.
                if (PostIndustryReturnDTO != null)
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), PostIndustryReturnDTO, HttpStatusCode.OK);
                }
                else
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), new object(), HttpStatusCode.BadRequest);
                }
                #endregion
            }
            catch (Exception exception)
            {
            }
            return(jsonResult);
        }
Exemple #2
0
 /// <summary>
 /// Get  PostIndustry By Id
 /// </summary>
 /// <returns>PostIndustryReturnDTO<PostIndustryReturnDTO></returns>
 public async Task <PostIndustryReturnDTO> GetPostIndustryById(int PostIndustryId)
 {
     #region Declare a return type with initial value.
     PostIndustryReturnDTO PostIndustry = null;
     #endregion
     try
     {
         if (PostIndustryId > default(int))
         {
             PostIndustry = await PostIndustryBusinessMapping.GetPostIndustryById(PostIndustryId);
         }
     }
     catch (Exception exception)  {}
     return(PostIndustry);
 }
Exemple #3
0
 public PostIndustryReturnDTO MappingPostIndustryToPostIndustryReturnDTO(PostIndustry PostIndustry)
 {
     #region Declare a return type with initial value.
     PostIndustryReturnDTO PostIndustryReturnDTO = null;
     #endregion
     try
     {
         if (PostIndustry != null)
         {
             PostIndustryReturnDTO = new PostIndustryReturnDTO
             {
                 IndustryId     = PostIndustry.IndustryId,
                 PostId         = PostIndustry.PostId,
                 PostIndustryId = PostIndustry.PostIndustryId
             };
         }
     }
     catch (Exception exception)
     { }
     return(PostIndustryReturnDTO);
 }
Exemple #4
0
        /// <summary>
        /// Get user Action Activity Log By Id
        /// </summary>
        /// <returns>List<PostIndustryReturnDTO></returns>
        public async Task <PostIndustryReturnDTO> GetPostIndustryById(int PostIndustryId)
        {
            #region Declare a return type with initial value.
            PostIndustryReturnDTO PostIndustry = new PostIndustryReturnDTO();
            #endregion
            try
            {
                PostIndustry postIndustry = await UnitOfWork.PostIndustryRepository.GetById(PostIndustryId);

                if (postIndustry != null)
                {
                    if (postIndustry.IsDeleted != (byte)DeleteStatusEnum.Deleted)
                    {
                        PostIndustry = PostIndustryMapping.MappingPostIndustryToPostIndustryReturnDTO(postIndustry);
                    }
                }
            }
            catch (Exception exception)
            {
            }
            return(PostIndustry);
        }