コード例 #1
0
        /// <summary>
        /// Delete User Action Activity Log
        /// </summary>
        /// <param name=></param>
        /// <returns>bool</returns>
        public async Task <bool> DeleteJobSeekerRole(int JobSeekerRoleId)
        {
            #region Declare a return type with initial value.
            bool isJobSeekerRoleDeleted = default(bool);
            #endregion
            try
            {
                if (JobSeekerRoleId > default(int))
                {
                    #region Vars
                    JobSeekerRole JobSeekerRole = null;
                    #endregion
                    #region Get JobSeekerRole by id
                    JobSeekerRole = await UnitOfWork.JobSeekerRoleRepository.GetById(JobSeekerRoleId);

                    #endregion
                    #region check if object is not null
                    if (JobSeekerRole != null)
                    {
                        JobSeekerRole.IsDeleted = (byte)DeleteStatusEnum.Deleted;
                        #region Apply the changes to the database
                        UnitOfWork.JobSeekerRoleRepository.Update(JobSeekerRole);
                        isJobSeekerRoleDeleted = await UnitOfWork.Commit() > default(int);

                        #endregion
                    }
                    #endregion
                }
            }
            catch (Exception exception)
            {
            }
            return(isJobSeekerRoleDeleted);
        }
コード例 #2
0
 /// <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);
 }
コード例 #3
0
 /// <summary>
 /// Mapping user Action Actitvity Log
 /// </summary>
 /// <param name=></ param >
 /// <returns>Task<JobSeekerRole></returns>
 public JobSeekerRole MappingJobSeekerRoleAddDTOToJobSeekerRole(JobSeekerRoleAddDTO JobSeekerRoleAddDTO)
 {
     #region Declare a return type with initial value.
     JobSeekerRole JobSeekerRole = null;
     #endregion
     try
     {
         JobSeekerRole = new JobSeekerRole
         {
             JobSeekerId  = JobSeekerRoleAddDTO.JobSeekerId,
             JobRoleId    = JobSeekerRoleAddDTO.JobRoleId,
             CreationDate = DateTime.Now,
             IsDeleted    = (byte)DeleteStatusEnum.NotDeleted
         };
     }
     catch (Exception exception) { }
     return(JobSeekerRole);
 }
コード例 #4
0
 public JobSeekerRoleReturnDTO MappingJobSeekerRoleToJobSeekerRoleReturnDTO(JobSeekerRole JobSeekerRole)
 {
     #region Declare a return type with initial value.
     JobSeekerRoleReturnDTO JobSeekerRoleReturnDTO = null;
     #endregion
     try
     {
         if (JobSeekerRole != null)
         {
             JobSeekerRoleReturnDTO = new JobSeekerRoleReturnDTO
             {
                 JobSeekerId     = JobSeekerRole.JobSeekerId,
                 JobRoleId       = JobSeekerRole.JobRoleId,
                 JobSeekerRoleId = JobSeekerRole.JobSeekerRoleId
             };
         }
     }
     catch (Exception exception)
     { }
     return(JobSeekerRoleReturnDTO);
 }
コード例 #5
0
        /// <summary>
        /// Get user Action Activity Log By Id
        /// </summary>
        /// <returns>List<JobSeekerRoleReturnDTO></returns>
        public async Task <JobSeekerRoleReturnDTO> GetJobSeekerRoleById(int JobSeekerRoleId)
        {
            #region Declare a return type with initial value.
            JobSeekerRoleReturnDTO JobSeekerRole = new JobSeekerRoleReturnDTO();
            #endregion
            try
            {
                JobSeekerRole jobSeekerRole = await UnitOfWork.JobSeekerRoleRepository.GetById(JobSeekerRoleId);

                if (jobSeekerRole != null)
                {
                    if (jobSeekerRole.IsDeleted != (byte)DeleteStatusEnum.Deleted)
                    {
                        JobSeekerRole = JobSeekerRoleMapping.MappingJobSeekerRoleToJobSeekerRoleReturnDTO(jobSeekerRole);
                    }
                }
            }
            catch (Exception exception)
            {
            }
            return(JobSeekerRole);
        }
コード例 #6
0
        /// <summary>
        /// Create User Action Activity Log
        /// </summary>
        /// <param name=></param>
        /// <returns>bool</returns>
        public async Task <bool> AddJobSeekerRole(JobSeekerRoleAddDTO JobSeekerRoleAddDTO)
        {
            #region Declare a return type with initial value.
            bool isJobSeekerRoleCreated = default(bool);
            #endregion
            try
            {
                #region Vars
                JobSeekerRole JobSeekerRole = null;
                #endregion
                JobSeekerRole = JobSeekerRoleMapping.MappingJobSeekerRoleAddDTOToJobSeekerRole(JobSeekerRoleAddDTO);
                if (JobSeekerRole != null)
                {
                    await UnitOfWork.JobSeekerRoleRepository.Insert(JobSeekerRole);

                    isJobSeekerRoleCreated = await UnitOfWork.Commit() > default(int);
                }
            }
            catch (Exception exception)
            {
            }
            return(isJobSeekerRoleCreated);
        }
コード例 #7
0
        /// <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);
        }