//Create public CPA Insert(CPA cpa) { using (OrderTrackEntities ctx = new OrderTrackEntities()) { ctx.CPA.Add(cpa); ctx.SaveChanges(); return(this); } }
//Create public CPA Insert(CPA cpa) { using (OrderTrackEntities ctx = new OrderTrackEntities()) { ctx.CPA.Add(cpa); ctx.SaveChanges(); return this; } }
//Update public CPA Update(CPA cpa) { using (OrderTrackEntities ctx = new OrderTrackEntities()) { CPA CPA = ctx.CPA.First(x => x.CPAID == this.CPAID); CPA = cpa; ctx.SaveChanges(); return(CPA); } }
//Update public CPA Update(CPA cpa) { using (OrderTrackEntities ctx = new OrderTrackEntities()) { CPA CPA = ctx.CPA.First(x => x.CPAID == this.CPAID); CPA = cpa; ctx.SaveChanges(); return CPA; } }
//Delete By ID public Boolean Delete(long id) { using (OrderTrackEntities ctx = new OrderTrackEntities()) { try { CPA CPA = ctx.CPA.First(x => x.CPAID == id); ctx.CPA.Remove(CPA); ctx.SaveChanges(); return(true); } catch (Exception ex) { return(false); } } }
public CPA Put(CPA cpa) { return new CPA().Insert(cpa); }
public CPA Post(CPA cpa) { return new CPA().Update(cpa); }