Beispiel #1
0
 /// <summary>
 /// Add PostRelatedIndustry AppService
 /// </summary>
 /// <returns>bool<bool></returns>
 public async Task <bool> AddPostRelatedIndustry(PostRelatedIndustryAddDTO postRelatedIndustryAddDTO)
 {
     #region Declare a return type with initial value.
     bool isCreated = false;
     #endregion
     try
     {
         if (postRelatedIndustryAddDTO != null)
         {
             isCreated = await PostRelatedIndustryBusinessMapping.AddPostRelatedIndustry(postRelatedIndustryAddDTO);
         }
     }
     catch (Exception exception) {}
     return(isCreated);
 }
        /// <summary>
        /// Create User Action Activity Log
        /// </summary>
        /// <param name=></param>
        /// <returns>bool</returns>
        public async Task <bool> AddPostRelatedIndustry(PostRelatedIndustryAddDTO PostRelatedIndustryAddDTO)
        {
            #region Declare a return type with initial value.
            bool isPostRelatedIndustryCreated = default(bool);
            #endregion
            try
            {
                #region Vars
                PostRelatedIndustry PostRelatedIndustry = null;
                #endregion
                PostRelatedIndustry = PostRelatedIndustryMapping.MappingPostRelatedIndustryAddDTOToPostRelatedIndustry(PostRelatedIndustryAddDTO);
                if (PostRelatedIndustry != null)
                {
                    await UnitOfWork.PostRelatedIndustryRepository.Insert(PostRelatedIndustry);

                    isPostRelatedIndustryCreated = await UnitOfWork.Commit() > default(int);
                }
            }
            catch (Exception exception)
            {
            }
            return(isPostRelatedIndustryCreated);
        }
Beispiel #3
0
        public async Task <ActionResult <CommonAPIResponse <bool> > > AddPostRelatedIndustry(PostRelatedIndustryAddDTO PostRelatedIndustryAddDTO)
        {
            #region Declare return type with initial value.
            JsonResult jsonResult = GetDefaultJsonResult <bool>();
            #endregion

            try
            {
                #region Validate AddPostRelatedIndustry for nullability before prepaing the response.

                if (await PostRelatedIndustryAppService.AddPostRelatedIndustry(PostRelatedIndustryAddDTO))
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), true, HttpStatusCode.OK);
                }
                else
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), false, HttpStatusCode.BadRequest);
                }
                #endregion
            }
            catch (Exception exception)
            {
            }
            return(jsonResult);
        }
Beispiel #4
0
 /// <summary>
 /// Mapping user Action Actitvity Log
 /// </summary>
 /// <param name=></ param >
 /// <returns>Task<PostRelatedIndustry></returns>
 public PostRelatedIndustry MappingPostRelatedIndustryAddDTOToPostRelatedIndustry(PostRelatedIndustryAddDTO PostRelatedIndustryAddDTO)
 {
     #region Declare a return type with initial value.
     PostRelatedIndustry PostRelatedIndustry = null;
     #endregion
     try
     {
         PostRelatedIndustry = new PostRelatedIndustry
         {
             IndustryId   = PostRelatedIndustryAddDTO.IndustryId,
             PostId       = PostRelatedIndustryAddDTO.PostId,
             CreationDate = DateTime.Now,
             IsDeleted    = (byte)DeleteStatusEnum.NotDeleted
         };
     }
     catch (Exception exception) { }
     return(PostRelatedIndustry);
 }