Exemplo n.º 1
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);
 }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Create User Action Activity Log
        /// </summary>
        /// <param name=></param>
        /// <returns>bool</returns>
        public async Task <bool> AddPostIndustry(PostIndustryAddDTO PostIndustryAddDTO)
        {
            #region Declare a return type with initial value.
            bool isPostIndustryCreated = default(bool);
            #endregion
            try
            {
                #region Vars
                PostIndustry PostIndustry = null;
                #endregion
                PostIndustry = PostIndustryMapping.MappingPostIndustryAddDTOToPostIndustry(PostIndustryAddDTO);
                if (PostIndustry != null)
                {
                    await UnitOfWork.PostIndustryRepository.Insert(PostIndustry);

                    isPostIndustryCreated = await UnitOfWork.Commit() > default(int);
                }
            }
            catch (Exception exception)
            {
            }
            return(isPostIndustryCreated);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Update User Action Activity Log
        /// </summary>
        /// <param name=></param>
        /// <returns>bool</returns>
        public async Task <bool> UpdatePostIndustry(PostIndustryUpdateDTO PostIndustryUpdateDTO)
        {
            #region Declare a return type with initial value.
            bool isPostIndustryUpdated = default(bool);
            #endregion
            try
            {
                if (PostIndustryUpdateDTO != null)
                {
                    #region Vars
                    PostIndustry PostIndustry = null;
                    #endregion
                    #region Get Activity By Id
                    PostIndustry = await UnitOfWork.PostIndustryRepository.GetById(PostIndustryUpdateDTO.PostIndustryId);

                    #endregion
                    if (PostIndustry != null)
                    {
                        #region  Mapping
                        PostIndustry = PostIndustryMapping.MappingPostIndustryupdateDTOToPostIndustry(PostIndustry, PostIndustryUpdateDTO);
                        #endregion
                        if (PostIndustry != null)
                        {
                            #region  Update Entity
                            UnitOfWork.PostIndustryRepository.Update(PostIndustry);
                            isPostIndustryUpdated = await UnitOfWork.Commit() > default(int);

                            #endregion
                        }
                    }
                }
            }
            catch (Exception exception)
            {
            }
            return(isPostIndustryUpdated);
        }