public Wish selectWish(Wish obj) { try { IWishSvc svc = (IWishSvc)this.getService(typeof(IWishSvc).Name); return svc.selectWish(obj); } catch (ServiceLoadException ex) { throw ex; } }
public Boolean objectDataEquals(Wish obj) { if (!(this.Wish_ID.Equals(obj.Wish_ID))) { return false; } if (!(this.Agent_ID.Equals(obj.Agent_ID))) { return false; } return true; }
public bool insertWish(Wish obj) { using (RealReportContext db = new RealReportContext()) { try { db.Wishes.Add(obj); db.SaveChanges(); return true; } catch (Exception ex) { return false; } } }
public Boolean insertWish(Wish obj) { try { IWishSvc svc = (IWishSvc)this.getService(typeof(IWishSvc).Name); if (obj.isDataEntered()) { return svc.insertWish(obj); } else { throw new BusinessValidationException(CustomErrors.REQUIRED_FIELD); } } catch (ServiceLoadException ex) { throw ex; } }
public bool deleteWish(Wish obj) { using (RealReportContext db = new RealReportContext()) { try { IQueryable<Wish> WishList = from Wish in db.Wishes where Wish.Wish_ID == obj.Wish_ID select Wish; if ((WishList.ToArray().Length > 0)) { db.Wishes.Remove((WishList.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 Wish selectWish(Wish obj) { RealReportContext db = new RealReportContext(); try { IQueryable<Wish> WishList = from Wish in db.Wishes where Wish.Wish_ID == obj.Wish_ID select Wish; return (WishList.ToList())[0]; } catch (Exception ex) { return null; } }
public bool updateWish(Wish obj) { using (RealReportContext db = new RealReportContext()) { try { IQueryable<Wish> WishList = from Wish in db.Wishes where Wish.Wish_ID == obj.Wish_ID select Wish; if ((WishList.ToArray()).Length > 0) { foreach (Wish Wish in WishList) { //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; } } }