Beispiel #1
0
        public void addReliantDiscountSameProduct(int store, int session, double percentage, String duration, int numOfProducts, int product)
        {
            if (product < 0)
            {
                throw new ILLArgumentException("illegal product number");
            }

            if (store < 0)
            {
                throw new ILLArgumentException("illegal store number");
            }
            if (percentage <= 0 || percentage >= 1)
            {
                throw new IllegalAmountException("percentage of discount must be a number between 0 to 1");
            }
            if (session < 0)
            {
                throw new NullReferenceException("session is a null reference");
            }
            db.addReliantdiscountSameProduct(store, product, percentage, numOfProducts, duration, session);
        }