public OutsideInterest selectOutsideInterest(OutsideInterest obj) { try { IOutsideSvc svc = (IOutsideSvc)this.getService(typeof(IOutsideSvc).Name); return svc.selectOutsideInterest(obj); } catch (ServiceLoadException ex) { throw ex; } }
public bool insertOutsideInterest(OutsideInterest obj) { using (RealReportContext db = new RealReportContext()) { try { db.OutsideInterests.Add(obj); db.SaveChanges(); return true; } catch (Exception ex) { return false; } } }
public Boolean updateOutside(OutsideInterest obj) { try { IOutsideSvc svc = (IOutsideSvc)this.getService(typeof(IOutsideSvc).Name); if (obj.isDataEntered()) { return svc.updateOutsideInterest(obj); } else { throw new BusinessValidationException(CustomErrors.REQUIRED_FIELD); } } catch (ServiceLoadException ex) { throw ex; } }
public bool deleteOutsideInterest(OutsideInterest obj) { using (RealReportContext db = new RealReportContext()) { try { IQueryable<OutsideInterest> OutsideInterestList = from outsideInterest in db.OutsideInterests where outsideInterest.ID == obj.ID select outsideInterest; if ((OutsideInterestList.ToArray().Length > 0)) { db.OutsideInterests.Remove((OutsideInterestList.ToArray()[0])); #region Database Submission try { db.SaveChanges(); return true; } catch (Exception ex) { return false; } #endregion } else { return false; } } catch (Exception ex) { return false; } } }
public OutsideInterest selectOutsideInterest(OutsideInterest obj) { RealReportContext db = new RealReportContext(); try { IQueryable<OutsideInterest> OutsideInterestList = from outsideInterest in db.OutsideInterests where outsideInterest.ID == obj.ID select outsideInterest; return (OutsideInterestList.ToList())[0]; } catch (Exception ex) { return null; } }
public bool updateOutsideInterest(OutsideInterest obj) { using (RealReportContext db = new RealReportContext()) { try { IQueryable<OutsideInterest> OutsideInterestList = from outsideInterest in db.OutsideInterests where outsideInterest.ID == obj.ID select outsideInterest; if ((OutsideInterestList.ToArray()).Length > 0) { foreach (OutsideInterest OutsideInterest in OutsideInterestList) { //Modify Attributes } #region Database Submission with Rollback try { db.SaveChanges(); return true; } catch (Exception ex) { return false; } #endregion } else { return false; } } catch (Exception ex) { return false; } } }