Esempio n. 1
0
 /// <summary>
 /// Updae PostIndustry AppService
 /// </summary>
 /// <returns>bool<bool></returns>
 public async Task <bool> UpdatePostIndustry(PostIndustryUpdateDTO postIndustryUpdateDTO)
 {
     #region Declare a return type with initial value.
     bool isUpdated = false;
     #endregion
     try
     {
         if (postIndustryUpdateDTO != null)
         {
             isUpdated = await PostIndustryBusinessMapping.UpdatePostIndustry(postIndustryUpdateDTO);
         }
     }
     catch (Exception exception) {}
     return(isUpdated);
 }
Esempio n. 2
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);
        }
Esempio n. 3
0
 /// <summary>
 /// Mapping User Activity Log DTO to Action
 /// </summary>
 /// <param name=></param>
 /// <param name=></param>
 /// <returns></returns>
 public PostIndustry MappingPostIndustryupdateDTOToPostIndustry(PostIndustry postIndustry, PostIndustryUpdateDTO PostIndustryUpdateDTO)
 {
     #region Declare Return Var with Intial Value
     PostIndustry PostIndustry = postIndustry;
     #endregion
     try
     {
         if (PostIndustryUpdateDTO.PostIndustryId > default(int))
         {
             PostIndustry.IndustryId     = PostIndustryUpdateDTO.IndustryId;
             PostIndustry.PostId         = PostIndustryUpdateDTO.PostId;
             PostIndustry.PostIndustryId = PostIndustryUpdateDTO.PostIndustryId;
         }
     }
     catch (Exception exception) { }
     return(PostIndustry);
 }
Esempio n. 4
0
        public async Task <ActionResult <CommonAPIResponse <bool> > > UpdatePostIndustry(PostIndustryUpdateDTO PostIndustryUpdateDTO)
        {
            #region Declare return type with initial value.
            JsonResult jsonResult = GetDefaultJsonResult <bool>();
            #endregion

            try
            {
                #region Validate userUpdateDTO for nullability before prepaing the response.
                if (await PostIndustryAppService.UpdatePostIndustry(PostIndustryUpdateDTO))
                {
                    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);
        }