public AddDiscountResponse AddDiscount(AddDiscountRequest request) { AdministrationServiceDAO adminDAO = new AdministrationServiceDAO(); bool result = adminDAO.AddDiscount(request.discounts); return(new AddDiscountResponse(result)); }
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)); } }