public AddDiscountResponse AddDiscount(AddDiscountRequest request)
        {
            AdministrationServiceDAO adminDAO = new AdministrationServiceDAO();
            bool result = adminDAO.AddDiscount(request.discounts);

            return(new AddDiscountResponse(result));
        }
Esempio n. 2
0
        public AddDiscountResponse AddDiscount(AddDiscountRequest request)
        {
            AdministrationServiceDAO adminDAO = new AdministrationServiceDAO();
            int itemId = adminDAO.AddDiscount(request.discounts);

            if (itemId != -1)
            {
                return(new AddDiscountResponse(true, itemId));
            }
            else
            {
                ThrowDatabaseAccessException();
                return(new AddDiscountResponse(false, -1));
            }
        }