public Recruitee selectRecruiteeByEmail(Recruitee obj) { try { IRecruiteeSvc svc = (IRecruiteeSvc)this.getService(typeof(IRecruiteeSvc).Name); return svc.selectRecruiteeByEmail(obj); } catch (ServiceLoadException ex) { return null; } }
public Boolean deleteRecruitee(Recruitee obj) { try { IRecruiteeSvc svc = (IRecruiteeSvc)this.getService(typeof(IRecruiteeSvc).Name); return svc.deleteRecruitee(obj); } catch (ServiceLoadException ex) { return false; } }
public Boolean removeSkillFromRecruitee(Recruitee obj, String skillId) { try { IRecruiteeSvc svc = (IRecruiteeSvc)this.getService(typeof(IRecruiteeSvc).Name); return svc.removeSkillFromRecruitee(obj, skillId); } catch (Exception ex) { return false; } }
public static RecruiteeDto createRecruiteeDTO(Recruitee obj) { RecruiteeDto rec = new RecruiteeDto(); rec.RecruiteeId = obj.RecruiteeId; rec.RankingId = obj.RankingId; rec.RankingValue = (double)obj.RankingValue; rec.Email = obj.Email; rec.FirstName = obj.FirstName; rec.LastName = obj.LastName; rec.Gender = obj.Gender; rec.AgeId = obj.AgeId; rec.EducationId = obj.EducationId; rec.IncomeId = obj.IncomeId; return rec; }
public Boolean addSkillToRecruitee(Recruitee obj, String skillId) { using (NewRecruiteeBankContext db = new NewRecruiteeBankContext()) { try { Recruitee recruitee = db.Recruitees.SqlQuery("dbo.SelectRecruiteeById @RecruiteeId='" + obj.RecruiteeId.ToString() + "'").Single(); Skill skillAdd = db.Skills.SqlQuery("dbo.SelectSkillById @SkillId='" + skillId + "'").Single(); if (recruitee != null) { if (skillAdd != null) { recruitee.Skills.Add(skillAdd); } #region Database Submission with Rollback try { db.SaveChanges(); return true; } catch (Exception ex) { return false; } #endregion } else { return false; } } catch (Exception ex) { return false; } } }
public Boolean deleteRecruitee(Recruitee obj) { using (NewRecruiteeBankContext db = new NewRecruiteeBankContext()) { try { Recruitee recruitee = db.Recruitees.SqlQuery("dbo.SelectRecruiteeById @RecruiteeId='" + obj.RecruiteeId.ToString() + "'").Single(); if (recruitee != null) { db.Recruitees.Remove(recruitee); #region Database Submission try { db.SaveChanges(); return true; } catch (Exception ex) { return false; } #endregion } else { return false; } } catch (Exception ex) { return false; } } }
public RecruiteeDto selectRecruiteeById(Guid RecruiteeId) { RecruiteeManager mgr = new RecruiteeManager(); Recruitee obj = new Recruitee(); obj.RecruiteeId = RecruiteeId; obj = mgr.selectRecruiteeById(obj); if (obj != null) { return RecruiteeDto.createRecruiteeDTO(obj); } else { return null; } }
public RecruiteeDto selectRecruiteeByEmail(String Email) { RecruiteeManager mgr = new RecruiteeManager(); Recruitee obj = new Recruitee(); obj.Email = Email; obj = mgr.selectRecruiteeByEmail(obj); if (obj != null) { return RecruiteeDto.createRecruiteeDTO(obj); } else { return null; } }
public static Recruitee createRecruitee(Guid RecruiteeId, String RankingId, decimal RankingValue, String Email, String FirstName, String LastName, String Gender, String AgeId, String EducationId, String IncomeId) { Recruitee obj = new Recruitee(); obj.RecruiteeId = RecruiteeId; obj.RankingId = RankingId; obj.RankingValue = RankingValue; obj.Email = Email; obj.FirstName = FirstName; obj.LastName = LastName; obj.Gender = Gender; obj.AgeId = AgeId; obj.EducationId = EducationId; obj.IncomeId = IncomeId; return obj; }
public Boolean insertRecruitee(Recruitee obj) { using (NewRecruiteeBankContext db = new NewRecruiteeBankContext()) { try { db.Recruitees.Add(obj); db.SaveChanges(); return true; } catch (Exception ex) { return false; } } }
public Boolean updateRecruitee(Recruitee obj) { using (NewRecruiteeBankContext db = new NewRecruiteeBankContext()) { try { Recruitee recruitee = db.Recruitees.SqlQuery("dbo.SelectRecruiteeById @RecruiteeId='" + obj.RecruiteeId.ToString() + "'").Single(); if (recruitee != null) { recruitee.RankingId = obj.RankingId; recruitee.RankingValue = obj.RankingValue; recruitee.Email = obj.Email; recruitee.FirstName = obj.FirstName; recruitee.LastName = obj.LastName; recruitee.Gender = obj.Gender; recruitee.AgeId = obj.AgeId; recruitee.EducationId = obj.EducationId; recruitee.IncomeId = obj.IncomeId; #region Database Submission with Rollback try { db.SaveChanges(); return true; } catch (Exception ex) { return false; } #endregion } else { return false; } } catch (Exception ex) { return false; } } }
public Recruitee selectRecruiteeById(Recruitee obj) { NewRecruiteeBankContext db = new NewRecruiteeBankContext(); try { return db.Recruitees.SqlQuery("dbo.SelectRecruiteeById @RecruiteeId='" + obj.RecruiteeId.ToString() + "'").Single(); } catch (Exception ex) { return null; } }