001
014
015 package com.liferay.portlet.shopping.service;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018
019
036 public class ShoppingCouponServiceUtil {
037 public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
038 java.lang.String code, boolean autoCode, java.lang.String name,
039 java.lang.String description, int startDateMonth, int startDateDay,
040 int startDateYear, int startDateHour, int startDateMinute,
041 int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
042 int endDateMinute, boolean neverExpire, boolean active,
043 java.lang.String limitCategories, java.lang.String limitSkus,
044 double minOrder, double discount, java.lang.String discountType,
045 com.liferay.portal.service.ServiceContext serviceContext)
046 throws com.liferay.portal.kernel.exception.PortalException,
047 com.liferay.portal.kernel.exception.SystemException {
048 return getService()
049 .addCoupon(code, autoCode, name, description,
050 startDateMonth, startDateDay, startDateYear, startDateHour,
051 startDateMinute, endDateMonth, endDateDay, endDateYear,
052 endDateHour, endDateMinute, neverExpire, active, limitCategories,
053 limitSkus, minOrder, discount, discountType, serviceContext);
054 }
055
056 public static void deleteCoupon(long groupId, long couponId)
057 throws com.liferay.portal.kernel.exception.PortalException,
058 com.liferay.portal.kernel.exception.SystemException {
059 getService().deleteCoupon(groupId, couponId);
060 }
061
062 public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
063 long groupId, long couponId)
064 throws com.liferay.portal.kernel.exception.PortalException,
065 com.liferay.portal.kernel.exception.SystemException {
066 return getService().getCoupon(groupId, couponId);
067 }
068
069 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> search(
070 long groupId, long companyId, java.lang.String code, boolean active,
071 java.lang.String discountType, boolean andOperator, int start, int end)
072 throws com.liferay.portal.kernel.exception.PortalException,
073 com.liferay.portal.kernel.exception.SystemException {
074 return getService()
075 .search(groupId, companyId, code, active, discountType,
076 andOperator, start, end);
077 }
078
079 public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
080 long couponId, java.lang.String name, java.lang.String description,
081 int startDateMonth, int startDateDay, int startDateYear,
082 int startDateHour, int startDateMinute, int endDateMonth,
083 int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
084 boolean neverExpire, boolean active, java.lang.String limitCategories,
085 java.lang.String limitSkus, double minOrder, double discount,
086 java.lang.String discountType,
087 com.liferay.portal.service.ServiceContext serviceContext)
088 throws com.liferay.portal.kernel.exception.PortalException,
089 com.liferay.portal.kernel.exception.SystemException {
090 return getService()
091 .updateCoupon(couponId, name, description, startDateMonth,
092 startDateDay, startDateYear, startDateHour, startDateMinute,
093 endDateMonth, endDateDay, endDateYear, endDateHour, endDateMinute,
094 neverExpire, active, limitCategories, limitSkus, minOrder,
095 discount, discountType, serviceContext);
096 }
097
098 public static ShoppingCouponService getService() {
099 if (_service == null) {
100 _service = (ShoppingCouponService)PortalBeanLocatorUtil.locate(ShoppingCouponService.class.getName());
101 }
102
103 return _service;
104 }
105
106 public void setService(ShoppingCouponService service) {
107 _service = service;
108 }
109
110 private static ShoppingCouponService _service;
111 }