示例#1
0
 public bool Delete(SaveJobDTO DTO)
 {
     try
     {
         repo.Delete(DTO.SaveJobId);
         repo.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#2
0
 public bool Insert(SaveJobDTO DTO)
 {
     try
     {
         repo.Insert(convertData.ConvertToEF(DTO));
         repo.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#3
0
        public SaveJob ConvertToEF(SaveJobDTO DTO)
        {
            var EF = new SaveJob()
            {
                SaveJobId       = DTO.SaveJobId,
                SJStatus        = DTO.SJStatus,
                SJ_CandidateId  = DTO.SJ_CandidateId,
                SJ_RecruitJobId = DTO.SJ_RecruitJobId
            };

            if (DTO.CandidateDTO != null)
            {
                EF.Candidate = new ConvertDataCandidate().ConvertToEF(DTO.CandidateDTO);
            }

            if (DTO.RecruitJobDTO != null)
            {
                EF.RecruitJob = new ConvertDataRecruitJob().ConvertToEF(DTO.RecruitJobDTO);
            }


            return(EF);
        }
示例#4
0
        public SaveJobDTO ConvertToDTO(SaveJob EF)
        {
            var DTO = new SaveJobDTO()
            {
                SaveJobId       = EF.SaveJobId,
                SJStatus        = EF.SJStatus,
                SJ_CandidateId  = EF.SJ_CandidateId,
                SJ_RecruitJobId = EF.SJ_RecruitJobId
            };

            if (EF.Candidate != null)
            {
                DTO.CandidateDTO = new ConvertDataCandidate().ConvertToDTO(EF.Candidate);
            }

            if (EF.RecruitJob != null)
            {
                DTO.RecruitJobDTO = new ConvertDataRecruitJob().ConvertToDTO(EF.RecruitJob);
            }


            return(DTO);
        }