예제 #1
0
 /*
 public void updateDiscountGroup(int id, string name, decimal discount)
 {
     throw new NotImplementedException();
 }
 */
 public void updateDiscountGroup(DiscountGroup discountGroup)
 {
     DiscountGroupCtr discoCtr = new DiscountGroupCtr();
     discoCtr.update(discountGroup.ID, discountGroup.Name, (decimal)discountGroup.Discount);
 }
예제 #2
0
 public void addDiscountGroup(string name, decimal discount)
 {
     DiscountGroupCtr discoCtr = new DiscountGroupCtr();
     int newDiscoGrp = discoCtr.add(name, discount);
 }
예제 #3
0
 public List<DiscountGroup> getAllDiscountGroups()
 {
     DiscountGroupCtr discoCtr = new DiscountGroupCtr();
     List<MDiscountGroup> mDiscoGrps = discoCtr.getAll();
     List<DiscountGroup> discoGrps = new List<DiscountGroup>();
     foreach (MDiscountGroup mDiscoGrp in mDiscoGrps)
     {
         discoGrps.Add(new DiscountGroup
         {
             ID = mDiscoGrp.ID,
             Name = mDiscoGrp.Name,
             Discount = mDiscoGrp.Discount
         });
     }
     return discoGrps;
 }
예제 #4
0
 public DiscountGroup getDiscoutGroup(int id)
 {
     DiscountGroupCtr discoCtr = new DiscountGroupCtr();
     MDiscountGroup mDiscoGrp = discoCtr.get(id, false);
     DiscountGroup discoGrp = new DiscountGroup
     {
         ID = mDiscoGrp.ID,
         Name = mDiscoGrp.Name,
         Discount = mDiscoGrp.Discount
     };
     return discoGrp;
 }
예제 #5
0
 public void deleteDiscountGroup(int id)
 {
     DiscountGroupCtr discoCtr = new DiscountGroupCtr();
     discoCtr.delete(id);
 }