Пример #1
0
 //Create
 public CPAStage Insert(CPAStage cpastage)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.CPAStage.Add(cpastage);
         ctx.SaveChanges();
         return(this);
     }
 }
Пример #2
0
 //Create
 public CPAStage Insert(CPAStage cpastage)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.CPAStage.Add(cpastage);
         ctx.SaveChanges();
         return this;
     }
 }
Пример #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);
     }
 }
Пример #4
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;
     }
 }
Пример #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);
 }