/// <summary>
 /// Updae PostJobRole AppService
 /// </summary>
 /// <returns>bool<bool></returns>
 public async Task <bool> UpdatePostJobRole(PostJobRoleUpdateDTO postJobRoleUpdateDTO)
 {
     #region Declare a return type with initial value.
     bool isUpdated = false;
     #endregion
     try
     {
         if (postJobRoleUpdateDTO != null)
         {
             isUpdated = await PostJobRoleBusinessMapping.UpdatePostJobRole(postJobRoleUpdateDTO);
         }
     }
     catch (Exception exception) {}
     return(isUpdated);
 }
Exemple #2
0
        /// <summary>
        /// Update User Action Activity Log
        /// </summary>
        /// <param name=></param>
        /// <returns>bool</returns>
        public async Task <bool> UpdatePostJobRole(PostJobRoleUpdateDTO PostJobRoleUpdateDTO)
        {
            #region Declare a return type with initial value.
            bool isPostJobRoleUpdated = default(bool);
            #endregion
            try
            {
                if (PostJobRoleUpdateDTO != null)
                {
                    #region Vars
                    PostJobRole PostJobRole = null;
                    #endregion
                    #region Get Activity By Id
                    PostJobRole = await UnitOfWork.PostJobRoleRepository.GetById(PostJobRoleUpdateDTO.PostJobRoleId);

                    #endregion
                    if (PostJobRole != null)
                    {
                        #region  Mapping
                        PostJobRole = PostJobRoleMapping.MappingPostJobRoleupdateDTOToPostJobRole(PostJobRole, PostJobRoleUpdateDTO);
                        #endregion
                        if (PostJobRole != null)
                        {
                            #region  Update Entity
                            UnitOfWork.PostJobRoleRepository.Update(PostJobRole);
                            isPostJobRoleUpdated = await UnitOfWork.Commit() > default(int);

                            #endregion
                        }
                    }
                }
            }
            catch (Exception exception)
            {
            }
            return(isPostJobRoleUpdated);
        }
 /// <summary>
 /// Mapping User Activity Log DTO to Action
 /// </summary>
 /// <param name=></param>
 /// <param name=></param>
 /// <returns></returns>
 public PostJobRole MappingPostJobRoleupdateDTOToPostJobRole(PostJobRole postJobRole, PostJobRoleUpdateDTO PostJobRoleUpdateDTO)
 {
     #region Declare Return Var with Intial Value
     PostJobRole PostJobRole = postJobRole;
     #endregion
     try
     {
         if (PostJobRoleUpdateDTO.PostJobRoleId > default(int))
         {
             PostJobRole.JobRoleId     = PostJobRoleUpdateDTO.JobRoleId;
             PostJobRole.PostId        = PostJobRoleUpdateDTO.PostId;
             PostJobRole.PostJobRoleId = PostJobRoleUpdateDTO.PostJobRoleId;
         }
     }
     catch (Exception exception) { }
     return(PostJobRole);
 }
Exemple #4
0
        public async Task <ActionResult <CommonAPIResponse <bool> > > UpdatePostJobRole(PostJobRoleUpdateDTO PostJobRoleUpdateDTO)
        {
            #region Declare return type with initial value.
            JsonResult jsonResult = GetDefaultJsonResult <bool>();
            #endregion

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