Beispiel #1
0
        public SuccessResponse <IAPIResponseData> SetCouponStates(SetCouponCodeRP setCouponCodeRP)
        {
            var coupon = _currentDAO.Query(
                new IWhereCondition[] {
                new EqualsCondition()
                {
                    FieldName = "CouponID", Value = setCouponCodeRP.CouponIDs[0]
                }
                , new EqualsCondition()
                {
                    FieldName = "IsDelete", Value = setCouponCodeRP.IsDelete
                }
            }, null);
            SuccessResponse <IAPIResponseData> sr = new SuccessResponse <IAPIResponseData>();

            if (coupon.Length == 0)
            {
                //逻辑删除或恢复优惠券
                this._currentDAO.DeleteNew(setCouponCodeRP.CouponIDs[0], null, Convert.ToInt32(setCouponCodeRP.IsDelete));

                sr.Message = "更新成功!";
            }
            else
            {
                sr.Message = "更新失败!";
            }

            return(sr);
        }
Beispiel #2
0
        public SuccessResponse <IAPIResponseData> SetCouponCode(SetCouponCodeRP setCouponCodeRP)
        {
            var coupon = _currentDAO.Query(
                new IWhereCondition[] {
                new EqualsCondition()
                {
                    FieldName = "CouponCode", Value = setCouponCodeRP.CouponCode
                }
                , new EqualsCondition()
                {
                    FieldName = "CustomerID", Value = CurrentUserInfo.ClientID
                }
            }, null);
            SuccessResponse <IAPIResponseData> sr = new SuccessResponse <IAPIResponseData>();

            if (coupon.Length == 0)
            {
                this._currentDAO.Update(new CouponEntity()
                {
                    CouponID = setCouponCodeRP.CouponID, CouponCode = setCouponCodeRP.CouponCode
                }, false);
                sr.Message = "更新成功!";
            }
            else
            {
                sr.Message = "系统已经存在了该编号!";
            }

            return(sr);
        }