Exemple #1
0
 //Create
 public CPAStage Insert(CPAStage cpastage)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.CPAStage.Add(cpastage);
         ctx.SaveChanges();
         return(this);
     }
 }
 //Create
 public CPAStage Insert(CPAStage cpastage)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.CPAStage.Add(cpastage);
         ctx.SaveChanges();
         return this;
     }
 }
Exemple #3
0
 //Update
 public CPAStage Update(CPAStage cpastage)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         CPAStage CPAStage = ctx.CPAStage.First(x => x.CPAStageID == this.CPAStageID);
         CPAStage = cpastage;
         ctx.SaveChanges();
         return(CPAStage);
     }
 }
 //Update
 public CPAStage Update(CPAStage cpastage)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         CPAStage CPAStage = ctx.CPAStage.First(x => x.CPAStageID == this.CPAStageID);
         CPAStage = cpastage;
         ctx.SaveChanges();
         return CPAStage;
     }
 }
Exemple #5
0
 //Delete By ID
 public Boolean Delete(long id)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         try
         {
             CPAStage CPAStage = ctx.CPAStage.First(x => x.CPAStageID == id);
             ctx.CPAStage.Remove(CPAStage);
             ctx.SaveChanges();
             return(true);
         }
         catch (Exception ex)
         {
             return(false);
         }
     }
 }
 public CPAStage Put(CPAStage cpastage)
 {
     return new CPAStage().Insert(cpastage);
 }
 public CPAStage Post(CPAStage cpastage)
 {
     return new CPAStage().Update(cpastage);
 }