Esempio n. 1
0
        public void Ready()
        {
            this.Bank.Bind(HostSite.GetBanks());
            var idNamePairs = DealWayService.Query().Where(x => x.State == DealWayStates.Normal && new ApplyToModel(x.ApplyTo).EnabledShop).Select(x => new IdNamePair()
            {
                Key = x.DealWayId, Name = x.DisplayName
            });

            this.DealWay.Bind(idNamePairs);

            if (this._owner != null)
            {
                Mobile.Value1 = _owner.Mobile;
                Mobile.Value2 = _owner.Mobile2;
            }
            Mobile.HasBinding       = !string.IsNullOrWhiteSpace(HostSite.MessageTemplateOfIdentity);
            this.PhoneNumber.Value1 = InnerObject.PhoneNumber;
            this.PhoneNumber.Value2 = InnerObject.PhoneNumber2;
        }
Esempio n. 2
0
        /// <summary>
        /// 保存时短信验证绑定
        /// </summary>
        /// <param name="distributor"></param>
        /// <param name="owner"></param>
        protected void OnSave(Distributor distributor, DistributorUser owner)
        {
            if (!string.IsNullOrWhiteSpace(HostSite.MessageTemplateOfIdentity))
            {
                var code   = CodeHelper.GetObject <string>("sms", false);
                var mobile = CodeHelper.GetObject <string>("sms_mobile", false);
                // 校验成功
                if (!string.IsNullOrWhiteSpace(code) && code == Mobile.Code)
                {
                    // 校验成功,并且提交号码和校验号码相同,则为绑定
                    if (Mobile.Value1 == mobile)
                    {
                        owner.Mobile            = mobile;
                        owner.IsMobileAvailable = true;
                    }
                    else // 否则为取消绑定
                    {
                        owner.Mobile            = "";
                        owner.IsMobileAvailable = false;
                    }
                }
            }
            else
            {
                owner.Mobile            = Mobile.Value1;
                owner.IsMobileAvailable = !string.IsNullOrWhiteSpace(owner.Mobile);
            }

            owner.Mobile2               = Mobile.Value2;
            owner.PhoneNumber           = PhoneNumber.Value1;
            owner.PhoneNumber2          = PhoneNumber.Value2;
            distributor.Address         = Address;
            distributor.Bank            = HostSite.GetBank(this.Bank);
            distributor.BankAccountName = BankAccountName;
            distributor.BankPoint       = BankPoint;
            distributor.BankUserName    = BankUserName;
            distributor.DealWayId       = DealWay;
            distributor.Description     = Description;

            //----提成比例;
            //----
        }
 public IJobSearch WhereHostSite(HostSite value) {
     _CountryCode = value.ToString();
     return this;
 }
 public ICategoryRequest WhereHostSite(HostSite value)
 {
     _countryCode = value.ToString();
     return(this);
 }
 public IEmployeeTypesRequest WhereHostSite(HostSite value)
 {
     _countryCode = value.ToString();
     return this;
 }
Esempio n. 6
0
 public IEmployeeTypesRequest WhereHostSite(HostSite value)
 {
     _countryCode = value.ToString();
     return(this);
 }
Esempio n. 7
0
 public IJobSearch WhereHostSite(HostSite value)
 {
     _CountryCode = value.ToString();
     return(this);
 }
 public ICategoryRequest WhereHostSite(HostSite value)
 {
     _countryCode = value.ToString();
     return this;
 }
Esempio n. 9
0
        public string GenerateQuery()
        {
            var query = $@" 
IF(NOT EXISTS(SELECT TOP (1) 1 from [dbo].[GenericAnnouncements] where ExternalId={ID.Safe()} ))
BEGIN
    INSERT INTO [dbo].[GenericAnnouncements]
               ([Id]
               ,[ExternalId]
               ,[HostSite]
               ,[Title]
               ,[Description]
               ,[Owner]
               ,[Images]
               ,[ThumbImages]
               ,[SmallImages]
               ,[LargeUrls]
               ,[Price]
               ,[First_Publication_Date]
               ,[Expiration_Date]
               ,[Category_Id]
               ,[Category_Name]
               ,[LinkUrl]
               ,[Extra]
               ,[LinkText]
               ,[City]
               ,[Latitude]
               ,[Langitude]
               ,[Region]
               ,[SourceType])
         VALUES
               (NEWID()
               ,{ID.Safe()}
               ,{HostSite.Safe()}
               ,{Title.Safe()}
               ,{Description.Safe()}
               ,{Owner.Safe()}
               ,{Images.Safe()}
               ,{ThumbImages.Safe()}
               ,{SmallImages.Safe()}
               ,{LargeUrls.Safe()}
               ,{Price.Safe()}
               ,{first_publication_date.Safe()}
               ,{expiration_date.Safe()}
               ,{category_id.Safe()}
               ,{category_name.Safe()}
               ,{LinkUrl.Safe()}
               ,{Extra.Safe()}
               ,{LinkText.Safe()}
               ,{City.Safe()}
               ,{Latitude.Safe()}
               ,{Langitude.Safe()}
               ,{Region.Safe()}
               ,0)
END;
ELSE
BEGIN
    UPDATE [dbo].[GenericAnnouncements]
       SET 
           [HostSite] = {HostSite.Safe()}
          ,[Title] = {Title.Safe()}
          ,[Description] = {Description.Safe()}
          ,[Owner] = {Owner.Safe()}
          ,[Images] = {Images.Safe()}
          ,[ThumbImages] = {ThumbImages.Safe()}
          ,[SmallImages] = {SmallImages.Safe()}
          ,[LargeUrls] = {LargeUrls.Safe()}
          ,[Price] = {Price.Safe()}
          ,[First_Publication_Date] = {first_publication_date.Safe()}
          ,[Expiration_Date] = {expiration_date.Safe()}
          ,[Category_Id] = {category_id.Safe()}
          ,[Category_Name] = {category_name.Safe()}
          ,[LinkUrl] = {LinkUrl.Safe()}
          ,[Extra] = {Extra.Safe()}
          ,[LinkText] = {LinkText.Safe()}
          ,[City] = {City.Safe()}
          ,[Latitude] = {Latitude.Safe()}
          ,[Langitude] = {Langitude.Safe()}
          ,[Region] = {Region.Safe()}
          --,[SourceType] = <SourceType, int,>
     WHERE ExternalId={ID.Safe()}

END;
";


            return(query);
        }
Esempio n. 10
0
        public void Ready()
        {
            //支付方式
            var idNamePairs = DealWayService.Query().Where(x => x.State == DealWayStates.Normal).Select(x => new IdNamePair()
            {
                Key = x.DealWayId, Name = x.DisplayName
            });

            this.DealWay.Bind(idNamePairs);
            //银行
            this.Bank.Bind(HostSite.GetBanks());
            //经销商级别
            var user = this.SecurityHelper.GetCurrentUser();

            if (user is AdminUserModel)
            {
                List <IdNamePair> li = new List <IdNamePair>()
                {
                    new IdNamePair()
                    {
                        Key = 1, Name = "总经销商"
                    }
                };
                this.DistributorLevel.Items = li;
            }
            else if (user is DistributorUserModel)
            {
                List <IdNamePair> li = new List <IdNamePair>()
                {
                    new IdNamePair()
                    {
                        Key = 2, Name = "分经销商"
                    }
                };
                this.DistributorLevel.Items = li;
            }


            if (_owner != null)
            {
                Mobile.Value1 = _owner.Mobile;
                Mobile.Value2 = _owner.Mobile2;
            }
            Mobile.HasBinding  = !string.IsNullOrWhiteSpace(HostSite.MessageTemplateOfIdentity);
            PhoneNumber.Value1 = Owner.PhoneNumber;
            PhoneNumber.Value2 = Owner.PhoneNumber2;
            List <Distributor> distributors =
                DistributorService.Query().Where(x => x.DistributorId != InnerObject.DistributorId).ToList();
            List <User> users = MembershipService.GetByIds(distributors.Select(x => x.UserId).ToArray()).ToList();
            List <Ecard.Models.DistributorAccountLevelRate> rateDtos = this.DistributorService.GetAccountLevelPolicyRates(this.InnerObject.DistributorId);

            if (rateDtos.Count > 0)
            {
                this.AccountLevelPolicyRates = new DistributorAccountLevelRate()
                {
                    AccountLevelPolicyId = rateDtos[0].AccountLevelPolicyId,
                    Rate = rateDtos[0].Rate * 100
                };
            }
            else
            {
                this.AccountLevelPolicyRates = new DistributorAccountLevelRate()
                {
                    AccountLevelPolicyId = 1,
                    Rate = 0
                };
            }

/*
 *          List<Ecard.Models.DistributorAccountLevelRate> rateDtos = this.DistributorService.GetAccountLevelPolicyRates(this.InnerObject.DistributorId);
 *          var rates = AccountLevelPolicyService.Query().Where(x => x.State == AccountLevelPolicyStates.Normal).ToList();
 *          this.AccountLevelPolicyRates = (from x in rates
 *                                          let rateDto = rateDtos.FirstOrDefault(d => d.DistributorId == InnerObject.DistributorId && d.AccountLevelPolicyId == x.AccountLevelPolicyId)
 *                                          select new DistributorAccountLevelRate
 *                                                     {
 *                                                         AccountLevelPolicyId = x.AccountLevelPolicyId,
 *                                                         Rate = rateDto == null ? 0 : rateDto.Rate * 100,
 *                                                         AccountLevelPolicyText = x.DisplayName,
 *                                                     }).FirstOrDefault();
 * */
        }