Esempio n. 1
0
 /// <summary>
 /// Updae JobSeekerRole AppService
 /// </summary>
 /// <returns>bool<bool></returns>
 public async Task <bool> UpdateJobSeekerRole(JobSeekerRoleUpdateDTO jobSeekerRoleUpdateDTO)
 {
     #region Declare a return type with initial value.
     bool isUpdated = false;
     #endregion
     try
     {
         if (jobSeekerRoleUpdateDTO != null)
         {
             isUpdated = await JobSeekerRoleBusinessMapping.UpdateJobSeekerRole(jobSeekerRoleUpdateDTO);
         }
     }
     catch (Exception exception) {}
     return(isUpdated);
 }
        /// <summary>
        /// Update User Action Activity Log
        /// </summary>
        /// <param name=></param>
        /// <returns>bool</returns>
        public async Task <bool> UpdateJobSeekerRole(JobSeekerRoleUpdateDTO JobSeekerRoleUpdateDTO)
        {
            #region Declare a return type with initial value.
            bool isJobSeekerRoleUpdated = default(bool);
            #endregion
            try
            {
                if (JobSeekerRoleUpdateDTO != null)
                {
                    #region Vars
                    JobSeekerRole JobSeekerRole = null;
                    #endregion
                    #region Get Activity By Id
                    JobSeekerRole = await UnitOfWork.JobSeekerRoleRepository.GetById(JobSeekerRoleUpdateDTO.JobSeekerRoleId);

                    #endregion
                    if (JobSeekerRole != null)
                    {
                        #region  Mapping
                        JobSeekerRole = JobSeekerRoleMapping.MappingJobSeekerRoleupdateDTOToJobSeekerRole(JobSeekerRole, JobSeekerRoleUpdateDTO);
                        #endregion
                        if (JobSeekerRole != null)
                        {
                            #region  Update Entity
                            UnitOfWork.JobSeekerRoleRepository.Update(JobSeekerRole);
                            isJobSeekerRoleUpdated = await UnitOfWork.Commit() > default(int);

                            #endregion
                        }
                    }
                }
            }
            catch (Exception exception)
            {
            }
            return(isJobSeekerRoleUpdated);
        }
        public async Task <ActionResult <CommonAPIResponse <bool> > > UpdateJobSeekerRole(JobSeekerRoleUpdateDTO JobSeekerRoleUpdateDTO)
        {
            #region Declare return type with initial value.
            JsonResult jsonResult = GetDefaultJsonResult <bool>();
            #endregion

            try
            {
                #region Validate userUpdateDTO for nullability before prepaing the response.
                if (await JobSeekerRoleAppService.UpdateJobSeekerRole(JobSeekerRoleUpdateDTO))
                {
                    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);
        }
 /// <summary>
 /// Mapping User Activity Log DTO to Action
 /// </summary>
 /// <param name=></param>
 /// <param name=></param>
 /// <returns></returns>
 public JobSeekerRole MappingJobSeekerRoleupdateDTOToJobSeekerRole(JobSeekerRole jobSeekerRole, JobSeekerRoleUpdateDTO JobSeekerRoleUpdateDTO)
 {
     #region Declare Return Var with Intial Value
     JobSeekerRole JobSeekerRole = jobSeekerRole;
     #endregion
     try
     {
         if (JobSeekerRoleUpdateDTO.JobSeekerRoleId > default(int))
         {
             JobSeekerRole.JobSeekerId     = JobSeekerRoleUpdateDTO.JobSeekerId;
             JobSeekerRole.JobRoleId       = JobSeekerRoleUpdateDTO.JobRoleId;
             JobSeekerRole.JobSeekerRoleId = JobSeekerRoleUpdateDTO.JobSeekerRoleId;
         }
     }
     catch (Exception exception) { }
     return(JobSeekerRole);
 }