Esempio n. 1
0
        /// <summary>
        /// 赠送客户积分校验
        /// </summary>
        /// <param name="pointRequest"></param>
        public static void PresentedCustomerPointPrecheck(AdjustPointRequestInfo pointRequest)
        {
            if (pointRequest == null)
            {
                return;
            }

            string baseUrl      = System.Configuration.ConfigurationManager.AppSettings["InvoiceMgmtRestFulBaseUrl"];
            string languageCode = System.Configuration.ConfigurationManager.AppSettings["LanguageCode"];
            string companyCode  = System.Configuration.ConfigurationManager.AppSettings["CompanyCode"];

            ECCentral.Job.Utility.RestClient       client = new ECCentral.Job.Utility.RestClient(baseUrl, languageCode);
            ECCentral.Job.Utility.RestServiceError error;
            string relativeUrl = "/InvoiceService/Job/AdjustPointPreCheck";

            var ar             = client.Create(relativeUrl, pointRequest, out error);
            var messageBuilder = new StringBuilder();

            if (error != null && error.Faults != null && error.Faults.Count > 0)
            {
                foreach (var errorItem in error.Faults)
                {
                    messageBuilder.AppendFormat(" {0} <br/>", errorItem.ErrorDescription);
                }

                throw new Exception(messageBuilder.ToString());
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 赠送客户积分校验
        /// </summary>
        /// <param name="customerSysNo">客户系统编号</param>
        /// <param name="pointPay">赠送积分数</param>
        public static void PresentedCustomerPointPrecheck(int customerSysNo, int pointPay)
        {
            AdjustPointRequestInfo pointRequest = new AdjustPointRequestInfo
            {
                CustomerSysNo = customerSysNo,
                Point         = pointPay,
                PointLogType  = (int)AdjustPointType.SalesGivePoints, //促销活动送积分(枚举值:25)
                OptType       = 0,                                    //OperationType=0 添加积分,当OperationType=1 积分撤销;
                SOSysNo       = null,
                Note          = "VIP卡用户年购满10000元送500积分",
                Memo          = "VIP卡用户年购满10000元送500积分",
            };

            PresentedCustomerPointPrecheck(pointRequest);
        }