Пример #1
0
 /// <summary>
 /// Add PostType AppService
 /// </summary>
 /// <returns>bool<bool></returns>
 public async Task <bool> AddPostType(PostTypeAddDTO postTypeAddDTO)
 {
     #region Declare a return type with initial value.
     bool isCreated = false;
     #endregion
     try
     {
         if (postTypeAddDTO != null)
         {
             isCreated = await PostTypeBusinessMapping.AddPostType(postTypeAddDTO);
         }
     }
     catch (Exception exception) {}
     return(isCreated);
 }
Пример #2
0
 /// <summary>
 /// Mapping user Action Actitvity Log
 /// </summary>
 /// <param name=></ param >
 /// <returns>Task<PostType></returns>
 public PostType MappingPostTypeAddDTOToPostType(PostTypeAddDTO PostTypeAddDTO)
 {
     #region Declare a return type with initial value.
     PostType PostType = null;
     #endregion
     try
     {
         PostType = new PostType
         {
             PostTypeName = PostTypeAddDTO.PostTypeName,
             CreationDate = DateTime.Now,
             IsDeleted    = (byte)DeleteStatusEnum.NotDeleted
         };
     }
     catch (Exception exception) { }
     return(PostType);
 }
Пример #3
0
        /// <summary>
        /// Create User Action Activity Log
        /// </summary>
        /// <param name=></param>
        /// <returns>bool</returns>
        public async Task <bool> AddPostType(PostTypeAddDTO PostTypeAddDTO)
        {
            #region Declare a return type with initial value.
            bool isPostTypeCreated = default(bool);
            #endregion
            try
            {
                #region Vars
                PostType PostType = null;
                #endregion
                PostType = PostTypeMapping.MappingPostTypeAddDTOToPostType(PostTypeAddDTO);
                if (PostType != null)
                {
                    await UnitOfWork.PostTypeRepository.Insert(PostType);

                    isPostTypeCreated = await UnitOfWork.Commit() > default(int);
                }
            }
            catch (Exception exception)
            {
            }
            return(isPostTypeCreated);
        }