예제 #1
0
 public void addProductVisibleDiscount(int product, int session, double percentage, string duration)
 {
     if (percentage <= 0 || percentage >= 1)
     {
         throw new IllegalAmountException("percentage of discount must be a number between 0 to 1");
     }
     if (product < 0)
     {
         throw new ILLArgumentException("illegal product number");
     }
     if (session < 0)
     {
         throw new NullReferenceException("session is a null reference");
     }
     db.addProductVisibleDiscount(product, percentage, duration, session);
 }