1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.shopping.service;
24  
25  
26  /**
27   * <a href="ShoppingCouponLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portlet.shopping.service.ShoppingCouponLocalService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * <p>
43   * <code>com.liferay.portlet.shopping.service.ShoppingCouponLocalServiceFactory</code>
44   * is responsible for the lookup of the bean.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   * @see com.liferay.portlet.shopping.service.ShoppingCouponLocalService
50   * @see com.liferay.portlet.shopping.service.ShoppingCouponLocalServiceFactory
51   *
52   */
53  public class ShoppingCouponLocalServiceUtil {
54      public static com.liferay.portlet.shopping.model.ShoppingCoupon addShoppingCoupon(
55          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon)
56          throws com.liferay.portal.SystemException {
57          ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
58  
59          return shoppingCouponLocalService.addShoppingCoupon(shoppingCoupon);
60      }
61  
62      public static void deleteShoppingCoupon(long couponId)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
66  
67          shoppingCouponLocalService.deleteShoppingCoupon(couponId);
68      }
69  
70      public static void deleteShoppingCoupon(
71          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon)
72          throws com.liferay.portal.SystemException {
73          ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
74  
75          shoppingCouponLocalService.deleteShoppingCoupon(shoppingCoupon);
76      }
77  
78      public static java.util.List<Object> dynamicQuery(
79          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
80          throws com.liferay.portal.SystemException {
81          ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
82  
83          return shoppingCouponLocalService.dynamicQuery(dynamicQuery);
84      }
85  
86      public static java.util.List<Object> dynamicQuery(
87          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
88          int end) throws com.liferay.portal.SystemException {
89          ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
90  
91          return shoppingCouponLocalService.dynamicQuery(dynamicQuery, start, end);
92      }
93  
94      public static com.liferay.portlet.shopping.model.ShoppingCoupon getShoppingCoupon(
95          long couponId)
96          throws com.liferay.portal.PortalException,
97              com.liferay.portal.SystemException {
98          ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
99  
100         return shoppingCouponLocalService.getShoppingCoupon(couponId);
101     }
102 
103     public static com.liferay.portlet.shopping.model.ShoppingCoupon updateShoppingCoupon(
104         com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon)
105         throws com.liferay.portal.SystemException {
106         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
107 
108         return shoppingCouponLocalService.updateShoppingCoupon(shoppingCoupon);
109     }
110 
111     public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
112         long userId, long plid, java.lang.String code, boolean autoCode,
113         java.lang.String name, java.lang.String description,
114         int startDateMonth, int startDateDay, int startDateYear,
115         int startDateHour, int startDateMinute, int endDateMonth,
116         int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
117         boolean neverExpire, boolean active, java.lang.String limitCategories,
118         java.lang.String limitSkus, double minOrder, double discount,
119         java.lang.String discountType)
120         throws com.liferay.portal.PortalException,
121             com.liferay.portal.SystemException {
122         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
123 
124         return shoppingCouponLocalService.addCoupon(userId, plid, code,
125             autoCode, name, description, startDateMonth, startDateDay,
126             startDateYear, startDateHour, startDateMinute, endDateMonth,
127             endDateDay, endDateYear, endDateHour, endDateMinute, neverExpire,
128             active, limitCategories, limitSkus, minOrder, discount, discountType);
129     }
130 
131     public static void deleteCoupon(long couponId)
132         throws com.liferay.portal.PortalException,
133             com.liferay.portal.SystemException {
134         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
135 
136         shoppingCouponLocalService.deleteCoupon(couponId);
137     }
138 
139     public static void deleteCoupons(long groupId)
140         throws com.liferay.portal.SystemException {
141         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
142 
143         shoppingCouponLocalService.deleteCoupons(groupId);
144     }
145 
146     public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
147         long couponId)
148         throws com.liferay.portal.PortalException,
149             com.liferay.portal.SystemException {
150         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
151 
152         return shoppingCouponLocalService.getCoupon(couponId);
153     }
154 
155     public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
156         java.lang.String code)
157         throws com.liferay.portal.PortalException,
158             com.liferay.portal.SystemException {
159         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
160 
161         return shoppingCouponLocalService.getCoupon(code);
162     }
163 
164     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> search(
165         long plid, long companyId, java.lang.String code, boolean active,
166         java.lang.String discountType, boolean andOperator, int start, int end)
167         throws com.liferay.portal.SystemException {
168         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
169 
170         return shoppingCouponLocalService.search(plid, companyId, code, active,
171             discountType, andOperator, start, end);
172     }
173 
174     public static int searchCount(long groupId, long companyId,
175         java.lang.String code, boolean active, java.lang.String discountType,
176         boolean andOperator) throws com.liferay.portal.SystemException {
177         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
178 
179         return shoppingCouponLocalService.searchCount(groupId, companyId, code,
180             active, discountType, andOperator);
181     }
182 
183     public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
184         long userId, long couponId, java.lang.String name,
185         java.lang.String description, int startDateMonth, int startDateDay,
186         int startDateYear, int startDateHour, int startDateMinute,
187         int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
188         int endDateMinute, boolean neverExpire, boolean active,
189         java.lang.String limitCategories, java.lang.String limitSkus,
190         double minOrder, double discount, java.lang.String discountType)
191         throws com.liferay.portal.PortalException,
192             com.liferay.portal.SystemException {
193         ShoppingCouponLocalService shoppingCouponLocalService = ShoppingCouponLocalServiceFactory.getService();
194 
195         return shoppingCouponLocalService.updateCoupon(userId, couponId, name,
196             description, startDateMonth, startDateDay, startDateYear,
197             startDateHour, startDateMinute, endDateMonth, endDateDay,
198             endDateYear, endDateHour, endDateMinute, neverExpire, active,
199             limitCategories, limitSkus, minOrder, discount, discountType);
200     }
201 }