Ejemplo n.º 1
0
        public IConversionMemberIntegralBase Create(MemberIntegralInfo.IntegralType type, int Integral = 0)
        {
            switch (type)
            {
            case MemberIntegralInfo.IntegralType.Reg: return(new RegisteGenerateIntegral());

            case MemberIntegralInfo.IntegralType.BindWX: return(new BindWXGenerateIntegral());

            case MemberIntegralInfo.IntegralType.Comment: return(new CommentGenerateIntegral());

            case MemberIntegralInfo.IntegralType.InvitationMemberRegiste: return(new InvitationMemberRegisteGenerateIntegral());

            //case MemberIntegral.IntegralType.ProportionRebate: return new ProportionRebateGenerateIntegral();
            case MemberIntegralInfo.IntegralType.Login: return(new LoginGenerateIntegral());

            case MemberIntegralInfo.IntegralType.Exchange: return(new ExchangeGenerateIntegral(Integral));

            case MemberIntegralInfo.IntegralType.Cancel:
            case MemberIntegralInfo.IntegralType.SystemOper:
            case MemberIntegralInfo.IntegralType.Consumption:
            case MemberIntegralInfo.IntegralType.Others:
            case MemberIntegralInfo.IntegralType.SignIn:
            case MemberIntegralInfo.IntegralType.WeiActivity:
                return(new GenralIntegral(Integral));

            case MemberIntegralInfo.IntegralType.Share:
                return(new OrderShareGenerateIntegral());

            default: return(null);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 通过多个RecordAction,增加用户积分
        /// </summary>
        /// <param name="model"></param>
        /// <param name="type"></param>
        public static void AddMemberIntegralByEnum(MemberIntegralRecordInfo model, MemberIntegralInfo.IntegralType type)
        {
            var conversionService = ServiceProvider.Instance <IMemberIntegralConversionFactoryService> .Create;
            var conversionMemberIntegralEntity = conversionService.Create(MemberIntegralInfo.IntegralType.Share);

            _iMemberIntegralService.AddMemberIntegralByRecordAction(model, conversionMemberIntegralEntity);
        }
Ejemplo n.º 3
0
        private string GetRemarkFromIntegralType(MemberIntegralInfo.IntegralType type, ICollection <MemberIntegralRecordActionInfo> recordAction, string remark = "")
        {
            if (recordAction == null || recordAction.Count == 0)
            {
                return(remark);
            }
            switch (type)
            {
            //case MemberIntegral.IntegralType.InvitationMemberRegiste:
            //    remark = "邀请用户(用户ID:" + recordAction.FirstOrDefault().VirtualItemId+")";
            //    break;
            case Mall.Entities.MemberIntegralInfo.IntegralType.Consumption:
                var orderIds = "";
                foreach (var item in recordAction)
                {
                    orderIds += item.VirtualItemId + ",";
                }
                remark = "使用订单号(" + orderIds.TrimEnd(',') + ")";
                break;

            //case MemberIntegral.IntegralType.Comment:
            //    remark = "商品评价(商品ID:" + recordAction.FirstOrDefault().VirtualItemId + ")";
            //    break;
            //case MemberIntegral.IntegralType.ProportionRebate:
            //    remark = "使用订单号(" +recordAction.FirstOrDefault().VirtualItemId + ")";
            //    break;
            default:
                return(remark);
            }
            return(remark);
        }
Ejemplo n.º 4
0
        private string GetRemarkFromIntegralType(MemberIntegralInfo.IntegralType type, ICollection <MemberIntegralRecordActionInfo> recordAction, string remark = "")
        {
            if (recordAction == null || recordAction.Count == 0)
            {
                return(remark);
            }
            switch (type)
            {
            case MemberIntegralInfo.IntegralType.Consumption:
                var orderIds = "";
                foreach (var item in recordAction)
                {
                    orderIds += item.VirtualItemId + ",";
                }
                remark = "订单号:" + orderIds.TrimEnd(',');
                break;

            default:
                return(remark);
            }
            return(remark);
        }