/// <summary> /// Delete User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> DeleteJobSeekerFieldOfStudy(int JobSeekerFieldOfStudyId) { #region Declare a return type with initial value. bool isJobSeekerFieldOfStudyDeleted = default(bool); #endregion try { if (JobSeekerFieldOfStudyId > default(int)) { #region Vars JobSeekerFieldOfStudy JobSeekerFieldOfStudy = null; #endregion #region Get JobSeekerFieldOfStudy by id JobSeekerFieldOfStudy = await UnitOfWork.JobSeekerFieldOfStudyRepository.GetById(JobSeekerFieldOfStudyId); #endregion #region check if object is not null if (JobSeekerFieldOfStudy != null) { JobSeekerFieldOfStudy.IsDeleted = (byte)DeleteStatusEnum.Deleted; #region Apply the changes to the database UnitOfWork.JobSeekerFieldOfStudyRepository.Update(JobSeekerFieldOfStudy); isJobSeekerFieldOfStudyDeleted = await UnitOfWork.Commit() > default(int); #endregion } #endregion } } catch (Exception exception) { } return(isJobSeekerFieldOfStudyDeleted); }
/// <summary> /// Mapping User Activity Log DTO to Action /// </summary> /// <param name=></param> /// <param name=></param> /// <returns></returns> public JobSeekerFieldOfStudy MappingJobSeekerFieldOfStudyupdateDTOToJobSeekerFieldOfStudy(JobSeekerFieldOfStudy jobSeekerFieldOfStudy, JobSeekerFieldOfStudyUpdateDTO JobSeekerFieldOfStudyUpdateDTO) { #region Declare Return Var with Intial Value JobSeekerFieldOfStudy JobSeekerFieldOfStudy = jobSeekerFieldOfStudy; #endregion try { if (JobSeekerFieldOfStudyUpdateDTO.JobSeekerFieldOfStudyId > default(int)) { JobSeekerFieldOfStudy.JobSeekerFieldOfStudyId = JobSeekerFieldOfStudyUpdateDTO.JobSeekerFieldOfStudyId; JobSeekerFieldOfStudy.JobSeekerId = JobSeekerFieldOfStudyUpdateDTO.JobSeekerId; JobSeekerFieldOfStudy.JobSeekerFieldOfStudyName = JobSeekerFieldOfStudyUpdateDTO.JobSeekerFieldOfStudyName; } } catch (Exception exception) { } return(JobSeekerFieldOfStudy); }
/// <summary> /// Mapping user Action Actitvity Log /// </summary> /// <param name=></ param > /// <returns>Task<JobSeekerFieldOfStudy></returns> public JobSeekerFieldOfStudy MappingJobSeekerFieldOfStudyAddDTOToJobSeekerFieldOfStudy(JobSeekerFieldOfStudyAddDTO JobSeekerFieldOfStudyAddDTO) { #region Declare a return type with initial value. JobSeekerFieldOfStudy JobSeekerFieldOfStudy = null; #endregion try { JobSeekerFieldOfStudy = new JobSeekerFieldOfStudy { JobSeekerId = JobSeekerFieldOfStudyAddDTO.JobSeekerId, JobSeekerFieldOfStudyName = JobSeekerFieldOfStudyAddDTO.JobSeekerFieldOfStudyName, CreationDate = DateTime.Now, IsDeleted = (byte)DeleteStatusEnum.NotDeleted }; } catch (Exception exception) { } return(JobSeekerFieldOfStudy); }
/// <summary> /// Get user Action Activity Log By Id /// </summary> /// <returns>List<JobSeekerFieldOfStudyReturnDTO></returns> public async Task <JobSeekerFieldOfStudyReturnDTO> GetJobSeekerFieldOfStudyById(int JobSeekerFieldOfStudyId) { #region Declare a return type with initial value. JobSeekerFieldOfStudyReturnDTO JobSeekerFieldOfStudy = new JobSeekerFieldOfStudyReturnDTO(); #endregion try { JobSeekerFieldOfStudy jobSeekerFieldOfStudy = await UnitOfWork.JobSeekerFieldOfStudyRepository.GetById(JobSeekerFieldOfStudyId); if (jobSeekerFieldOfStudy != null) { if (jobSeekerFieldOfStudy.IsDeleted != (byte)DeleteStatusEnum.Deleted) { JobSeekerFieldOfStudy = JobSeekerFieldOfStudyMapping.MappingJobSeekerFieldOfStudyToJobSeekerFieldOfStudyReturnDTO(jobSeekerFieldOfStudy); } } } catch (Exception exception) { } return(JobSeekerFieldOfStudy); }
/// <summary> /// Create User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> AddJobSeekerFieldOfStudy(JobSeekerFieldOfStudyAddDTO JobSeekerFieldOfStudyAddDTO) { #region Declare a return type with initial value. bool isJobSeekerFieldOfStudyCreated = default(bool); #endregion try { #region Vars JobSeekerFieldOfStudy JobSeekerFieldOfStudy = null; #endregion JobSeekerFieldOfStudy = JobSeekerFieldOfStudyMapping.MappingJobSeekerFieldOfStudyAddDTOToJobSeekerFieldOfStudy(JobSeekerFieldOfStudyAddDTO); if (JobSeekerFieldOfStudy != null) { await UnitOfWork.JobSeekerFieldOfStudyRepository.Insert(JobSeekerFieldOfStudy); isJobSeekerFieldOfStudyCreated = await UnitOfWork.Commit() > default(int); } } catch (Exception exception) { } return(isJobSeekerFieldOfStudyCreated); }
/// <summary> /// Update User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> UpdateJobSeekerFieldOfStudy(JobSeekerFieldOfStudyUpdateDTO JobSeekerFieldOfStudyUpdateDTO) { #region Declare a return type with initial value. bool isJobSeekerFieldOfStudyUpdated = default(bool); #endregion try { if (JobSeekerFieldOfStudyUpdateDTO != null) { #region Vars JobSeekerFieldOfStudy JobSeekerFieldOfStudy = null; #endregion #region Get Activity By Id JobSeekerFieldOfStudy = await UnitOfWork.JobSeekerFieldOfStudyRepository.GetById(JobSeekerFieldOfStudyUpdateDTO.JobSeekerFieldOfStudyId); #endregion if (JobSeekerFieldOfStudy != null) { #region Mapping JobSeekerFieldOfStudy = JobSeekerFieldOfStudyMapping.MappingJobSeekerFieldOfStudyupdateDTOToJobSeekerFieldOfStudy(JobSeekerFieldOfStudy, JobSeekerFieldOfStudyUpdateDTO); #endregion if (JobSeekerFieldOfStudy != null) { #region Update Entity UnitOfWork.JobSeekerFieldOfStudyRepository.Update(JobSeekerFieldOfStudy); isJobSeekerFieldOfStudyUpdated = await UnitOfWork.Commit() > default(int); #endregion } } } } catch (Exception exception) { } return(isJobSeekerFieldOfStudyUpdated); }
public JobSeekerFieldOfStudyReturnDTO MappingJobSeekerFieldOfStudyToJobSeekerFieldOfStudyReturnDTO(JobSeekerFieldOfStudy JobSeekerFieldOfStudy) { #region Declare a return type with initial value. JobSeekerFieldOfStudyReturnDTO JobSeekerFieldOfStudyReturnDTO = null; #endregion try { if (JobSeekerFieldOfStudy != null) { JobSeekerFieldOfStudyReturnDTO = new JobSeekerFieldOfStudyReturnDTO { JobSeekerFieldOfStudyId = JobSeekerFieldOfStudy.JobSeekerFieldOfStudyId, JobSeekerId = JobSeekerFieldOfStudy.JobSeekerId, JobSeekerFieldOfStudyName = JobSeekerFieldOfStudy.JobSeekerFieldOfStudyName }; } } catch (Exception exception) { } return(JobSeekerFieldOfStudyReturnDTO); }