public static EducationDto createEducationDTO(Education obj) { EducationDto edu = new EducationDto(); edu.EducationId = obj.EducationId; edu.EducationDescription = obj.EducationDescription; return edu; }
public static Education createEducation(String EducationId, String EducationDescription) { Education obj = new Education(); obj.EducationId = EducationId; obj.EducationDescription = EducationDescription; return obj; }
public Education selectEducationById(Education obj) { try { IEducationSvc svc = (IEducationSvc)this.getService(typeof(IEducationSvc).Name); return svc.selectEducationById(obj); } catch (ServiceLoadException ex) { return null; } }
public Boolean deleteEducation(Education obj) { try { IEducationSvc svc = (IEducationSvc)this.getService(typeof(IEducationSvc).Name); return svc.deleteEducation(obj); } catch (ServiceLoadException ex) { return false; } }
public Education selectEducationById(Education obj) { NewRecruiteeBankContext db = new NewRecruiteeBankContext(); try { return db.Educations.SqlQuery("dbo.SelectEducationById @EducationId='" + obj.EducationId.ToString() + "'").Single(); } catch (Exception ex) { return null; } }
public Boolean insertEducation(Education obj) { using (NewRecruiteeBankContext db = new NewRecruiteeBankContext()) { try { db.Educations.Add(obj); db.SaveChanges(); return true; } catch (Exception ex) { return false; } } }
public Boolean deleteEducation(Education obj) { using (NewRecruiteeBankContext db = new NewRecruiteeBankContext()) { try { Education edu = db.Educations.SqlQuery("dbo.SelectEducationById @EducationId='" + obj.EducationId.ToString() + "'").Single(); if (edu != null) { db.Educations.Remove(edu); #region Database Submission try { db.SaveChanges(); return true; } catch (Exception ex) { return false; } #endregion } else { return false; } } catch (Exception ex) { return false; } } }