1
14
15 package com.liferay.portlet.shopping.service;
16
17 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18
19
39 public class ShoppingCouponServiceUtil {
40 public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
41 java.lang.String code, boolean autoCode, java.lang.String name,
42 java.lang.String description, int startDateMonth, int startDateDay,
43 int startDateYear, int startDateHour, int startDateMinute,
44 int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
45 int endDateMinute, boolean neverExpire, boolean active,
46 java.lang.String limitCategories, java.lang.String limitSkus,
47 double minOrder, double discount, java.lang.String discountType,
48 com.liferay.portal.service.ServiceContext serviceContext)
49 throws com.liferay.portal.kernel.exception.PortalException,
50 com.liferay.portal.kernel.exception.SystemException {
51 return getService()
52 .addCoupon(code, autoCode, name, description,
53 startDateMonth, startDateDay, startDateYear, startDateHour,
54 startDateMinute, endDateMonth, endDateDay, endDateYear,
55 endDateHour, endDateMinute, neverExpire, active, limitCategories,
56 limitSkus, minOrder, discount, discountType, serviceContext);
57 }
58
59 public static void deleteCoupon(long groupId, long couponId)
60 throws com.liferay.portal.kernel.exception.PortalException,
61 com.liferay.portal.kernel.exception.SystemException {
62 getService().deleteCoupon(groupId, couponId);
63 }
64
65 public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
66 long groupId, long couponId)
67 throws com.liferay.portal.kernel.exception.PortalException,
68 com.liferay.portal.kernel.exception.SystemException {
69 return getService().getCoupon(groupId, couponId);
70 }
71
72 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> search(
73 long groupId, long companyId, java.lang.String code, boolean active,
74 java.lang.String discountType, boolean andOperator, int start, int end)
75 throws com.liferay.portal.kernel.exception.PortalException,
76 com.liferay.portal.kernel.exception.SystemException {
77 return getService()
78 .search(groupId, companyId, code, active, discountType,
79 andOperator, start, end);
80 }
81
82 public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
83 long couponId, java.lang.String name, java.lang.String description,
84 int startDateMonth, int startDateDay, int startDateYear,
85 int startDateHour, int startDateMinute, int endDateMonth,
86 int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
87 boolean neverExpire, boolean active, java.lang.String limitCategories,
88 java.lang.String limitSkus, double minOrder, double discount,
89 java.lang.String discountType,
90 com.liferay.portal.service.ServiceContext serviceContext)
91 throws com.liferay.portal.kernel.exception.PortalException,
92 com.liferay.portal.kernel.exception.SystemException {
93 return getService()
94 .updateCoupon(couponId, name, description, startDateMonth,
95 startDateDay, startDateYear, startDateHour, startDateMinute,
96 endDateMonth, endDateDay, endDateYear, endDateHour, endDateMinute,
97 neverExpire, active, limitCategories, limitSkus, minOrder,
98 discount, discountType, serviceContext);
99 }
100
101 public static ShoppingCouponService getService() {
102 if (_service == null) {
103 _service = (ShoppingCouponService)PortalBeanLocatorUtil.locate(ShoppingCouponService.class.getName());
104 }
105
106 return _service;
107 }
108
109 public void setService(ShoppingCouponService service) {
110 _service = service;
111 }
112
113 private static ShoppingCouponService _service;
114 }