示例#1
0
 private void LoadDistributorGradeInfo()
 {
     if (this.GradeId > 0)
     {
         DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(this.GradeId);
         if (distributorGradeInfo == null)
         {
             base.GotoResourceNotFound();
         }
         else
         {
             this.txtName.Text                 = distributorGradeInfo.Name;
             this.txtCommissionsLimit.Text     = distributorGradeInfo.CommissionsLimit.ToString("F2");
             this.txtFirstCommissionRise.Text  = distributorGradeInfo.FirstCommissionRise.ToString();
             this.txtSecondCommissionRise.Text = distributorGradeInfo.SecondCommissionRise.ToString();
             this.txtThirdCommissionRise.Text  = distributorGradeInfo.ThirdCommissionRise.ToString();
             this.rbtnlIsDefault.SelectedIndex = distributorGradeInfo.IsDefault ? 0 : 1;
             if (distributorGradeInfo.IsDefault)
             {
                 this.GIsDefault.Style.Add("display", "none");
             }
             if (distributorGradeInfo.IsDefault)
             {
                 this.rbtnlIsDefault.Enabled = false;
             }
             this.txtDescription.Text = distributorGradeInfo.Description;
             string ico = distributorGradeInfo.Ico;
             if (ico != "/utility/pics/grade.png")
             {
                 this.uploader1.UploadedImageUrl = ico;
             }
         }
     }
 }
 private void AAbiuZJB()
 {
     if (this.m_GradeId > 0)
     {
         DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(this.m_GradeId);
         if (distributorGradeInfo == null)
         {
             base.GotoResourceNotFound();
             return;
         }
         this.txtName.Text = distributorGradeInfo.Name;
         TextBox str = this.txtCommissionsLimit;
         decimal commissionsLimit = distributorGradeInfo.CommissionsLimit;
         str.Text = commissionsLimit.ToString("F2");
         this.txtFirstCommissionRise.Text  = distributorGradeInfo.FirstCommissionRise.ToString();
         this.txtSecondCommissionRise.Text = distributorGradeInfo.SecondCommissionRise.ToString();
         this.txtThirdCommissionRise.Text  = distributorGradeInfo.ThirdCommissionRise.ToString();
         this.rbtnlIsDefault.SelectedIndex = (distributorGradeInfo.IsDefault ? 0 : 1);
         if (distributorGradeInfo.IsDefault)
         {
             this.rbtnlIsDefault.Enabled = false;
         }
         this.txtDescription.Text = distributorGradeInfo.Description;
         string ico = distributorGradeInfo.Ico;
         if (ico != "/utility/pics/grade.png")
         {
             this.uploader1.UploadedImageUrl = ico;
         }
     }
 }
示例#3
0
        protected void btnEditUser_Click(object sender, System.EventArgs e)
        {
            decimal num = 0.0m;
            decimal firstCommissionRise  = 0.0m;
            decimal secondCommissionRise = 0.0m;
            decimal thirdCommissionRise  = 0.0m;
            DistributorGradeInfo distributorGradeInfo = new DistributorGradeInfo();

            if (this.GradeId > 0)
            {
                distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(this.GradeId);
            }
            distributorGradeInfo.Name = this.txtName.Text.Trim();
            decimal.TryParse(this.txtCommissionsLimit.Text.Trim(), out num);
            decimal.TryParse(this.txtFirstCommissionRise.Text.Trim(), out firstCommissionRise);
            decimal.TryParse(this.txtSecondCommissionRise.Text.Trim(), out secondCommissionRise);
            decimal.TryParse(this.txtThirdCommissionRise.Text.Trim(), out thirdCommissionRise);
            distributorGradeInfo.CommissionsLimit     = num;
            distributorGradeInfo.FirstCommissionRise  = firstCommissionRise;
            distributorGradeInfo.SecondCommissionRise = secondCommissionRise;
            distributorGradeInfo.ThirdCommissionRise  = thirdCommissionRise;
            distributorGradeInfo.IsDefault            = (this.rbtnlIsDefault.SelectedIndex == 0);
            distributorGradeInfo.Description          = this.txtDescription.Text.Trim();
            distributorGradeInfo.Ico = this.uploader1.UploadedImageUrl;
            if (DistributorGradeBrower.IsExistsMinAmount(this.GradeId, num))
            {
                this.ShowMsg("已存在相同佣金的分销商等级", false);
                return;
            }
            if (this.GradeId > 0)
            {
                if (DistributorGradeBrower.UpdateDistributor(distributorGradeInfo))
                {
                    if (base.Request.QueryString["reurl"] != null)
                    {
                        this.ReUrl = base.Request.QueryString["reurl"].ToString();
                    }
                    if (string.IsNullOrEmpty(this.ReUrl))
                    {
                        this.ReUrl = "distributorgradelist.aspx";
                    }
                    this.ShowMsgAndReUrl("成功修改了分销商等级", true, this.ReUrl);
                    return;
                }
                this.ShowMsg("分销商等级修改失败", false);
                return;
            }
            else
            {
                if (DistributorGradeBrower.CreateDistributorGrade(distributorGradeInfo))
                {
                    this.ShowMsgAndReUrl("成功新增了分销商等级", true, this.ReUrl);
                    return;
                }
                this.ShowMsg("分销商等级新增失败", false);
                return;
            }
        }
示例#4
0
        protected void btnEditUser_Click(object sender, EventArgs e)
        {
            decimal result = 0.0M;
            decimal num2   = 0.0M;
            decimal num3   = 0.0M;
            decimal num4   = 0.0M;
            DistributorGradeInfo distributorgrade = new DistributorGradeInfo();

            if (this.GradeId > 0)
            {
                distributorgrade = DistributorGradeBrower.GetDistributorGradeInfo(this.GradeId);
            }
            distributorgrade.Name = this.txtName.Text.Trim();
            decimal.TryParse(this.txtCommissionsLimit.Text.Trim(), out result);
            decimal.TryParse(this.txtFirstCommissionRise.Text.Trim(), out num2);
            decimal.TryParse(this.txtSecondCommissionRise.Text.Trim(), out num3);
            decimal.TryParse(this.txtThirdCommissionRise.Text.Trim(), out num4);
            distributorgrade.CommissionsLimit     = result;
            distributorgrade.FirstCommissionRise  = num2;
            distributorgrade.SecondCommissionRise = num3;
            distributorgrade.ThirdCommissionRise  = num4;
            distributorgrade.IsDefault            = this.rbtnlIsDefault.SelectedIndex == 0;
            distributorgrade.Description          = this.txtDescription.Text.Trim();
            distributorgrade.Ico = this.uploader1.UploadedImageUrl;
            if (DistributorGradeBrower.IsExistsMinAmount(this.GradeId, result))
            {
                this.ShowMsg("已存在相同佣金的分销商等级", false);
            }
            else if (this.GradeId > 0)
            {
                if (DistributorGradeBrower.UpdateDistributor(distributorgrade))
                {
                    if (base.Request.QueryString["reurl"] != null)
                    {
                        this.ReUrl = base.Request.QueryString["reurl"].ToString();
                    }
                    if (string.IsNullOrEmpty(this.ReUrl))
                    {
                        this.ReUrl = "distributorgradelist.aspx";
                    }
                    this.ShowMsgAndReUrl("成功修改了分销商等级", true, this.ReUrl);
                }
                else
                {
                    this.ShowMsg("分销商等级修改失败", false);
                }
            }
            else if (DistributorGradeBrower.CreateDistributorGrade(distributorgrade))
            {
                this.ShowMsgAndReUrl("成功新增了分销商等级", true, this.ReUrl);
            }
            else
            {
                this.ShowMsg("分销商等级新增失败", false);
            }
        }
示例#5
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺中心");
            int currentMemberUserId             = Globals.GetCurrentMemberUserId();
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);

            if (userIdDistributors != null)
            {
                this.litTodayOrdersNum = (Literal)this.FindControl("litTodayOrdersNum");
                OrderQuery query = new OrderQuery {
                    UserId = new int?(currentMemberUserId),
                    Status = OrderStatus.Today
                };
                this.litTodayOrdersNum.Text = DistributorsBrower.GetDistributorOrderCount(query).ToString();
                this.imglogo              = (HiImage)this.FindControl("imglogo");
                this.imgGrade             = (Image)this.FindControl("imgGrade");
                this.litStroeName         = (Literal)this.FindControl("litStroeName");
                this.saletotal            = (FormatedMoneyLabel)this.FindControl("saletotal");
                this.refrraltotal         = (FormatedMoneyLabel)this.FindControl("refrraltotal");
                this.litStoreNum          = (Literal)this.FindControl("litStoreNum");
                this.litdistirbutors      = (Literal)this.FindControl("litdistirbutors");
                this.litQRcode            = (Literal)this.FindControl("litQRcode");
                this.litOrders            = (Literal)this.FindControl("litOrders");
                this.litdistirbutors.Text = "<li><a href=\"ChirldrenDistributors.aspx\" class=\"shop-underling\">我的下属</a></li>";
                this.litQRcode.Text       = "<li><a href=\"QRcode.aspx?ReferralId=" + userIdDistributors.UserId + "\" class=\"shop-qr\">店铺推广码</a></li>";
                this.litStroeName.Text    = userIdDistributors.StoreName;
                this.saletotal.Money      = userIdDistributors.OrdersTotal;
                DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(userIdDistributors.DistriGradeId);
                if ((distributorGradeInfo != null) && (distributorGradeInfo.Ico.Length > 10))
                {
                    this.imgGrade.ImageUrl = distributorGradeInfo.Ico;
                }
                else
                {
                    this.imgGrade.Visible = false;
                }
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                else
                {
                    SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                    if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
                    {
                        this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
                    }
                }
                this.litStoreNum.Text   = DistributorsBrower.GetDistributorNum(DistributorGrade.All).ToString();
                this.refrraltotal.Money = DistributorsBrower.GetUserCommissions(userIdDistributors.UserId, DateTime.Now);
                if (userIdDistributors.ReferralStatus == 1)
                {
                    this.litOrders.Text = "style=\"display:none;\"";
                }
            }
        }
示例#6
0
        private void GradeCheck_Click(object sender, System.EventArgs e)
        {
            string strIds = "";

            if (!string.IsNullOrEmpty(base.Request["CheckBoxGroup"]))
            {
                strIds = base.Request["CheckBoxGroup"];
            }
            string EditGrade = this.GradeCheckList.SelectedValue.ToString();

            if (strIds.Length <= 0)
            {
                this.ShowMsg("请先选择要修改等级的分销商", false);
                return;
            }
            int num = DistributorsBrower.EditCommisionsGrade(strIds, EditGrade);

            if (num > 0)
            {
                new System.Threading.Thread(() =>
                {
                    DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(int.Parse(EditGrade));
                    if (distributorGradeInfo != null)
                    {
                        string[] array = strIds.Split(new char[]
                        {
                            ','
                        });
                        string[] array2 = array;
                        for (int i = 0; i < array2.Length; i++)
                        {
                            string s   = array2[i];
                            int userId = 0;
                            if (int.TryParse(s, out userId))
                            {
                                try
                                {
                                    MemberInfo member = MemberProcessor.GetMember(userId, true);
                                    if (member != null)
                                    {
                                        Messenger.SendWeiXinMsg_DistributorGradeChange(member, distributorGradeInfo.Name);
                                    }
                                }
                                catch (System.Exception ex)
                                {
                                    Globals.Debuglog("升级变动提醒发送错误:" + ex.Message + "-- " + strIds, "_Debuglog.txt");
                                }
                            }
                        }
                    }
                }).Start();
            }
            this.ShowMsg(string.Format("成功修改了{0}个分销商的等级", num), true);
            this.BindData();
        }
        private void GradeCheck_Click(object sender, EventArgs e)
        {
            ThreadStart start  = null;
            string      strIds = "";

            if (!string.IsNullOrEmpty(base.Request["CheckBoxGroup"]))
            {
                strIds = base.Request["CheckBoxGroup"];
            }
            string EditGrade = this.GradeCheckList.SelectedValue.ToString();

            if (strIds.Length <= 0)
            {
                this.ShowMsg("请先选择要修改等级的分销商", false);
            }
            else
            {
                int num = DistributorsBrower.EditCommisionsGrade(strIds, EditGrade);
                if (num > 0)
                {
                    if (start == null)
                    {
                        start = delegate {
                            DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(int.Parse(EditGrade));
                            if (distributorGradeInfo != null)
                            {
                                foreach (string str in strIds.Split(new char[] { ',' }))
                                {
                                    int result = 0;
                                    if (int.TryParse(str, out result))
                                    {
                                        try
                                        {
                                            MemberInfo member = MemberProcessor.GetMember(result, true);
                                            if (member != null)
                                            {
                                                Messenger.SendWeiXinMsg_DistributorGradeChange(member, distributorGradeInfo.Name);
                                            }
                                        }
                                        catch (Exception exception)
                                        {
                                            Globals.Debuglog("升级变动提醒发送错误:" + exception.Message + "-- " + strIds, "_Debuglog.txt");
                                        }
                                    }
                                }
                            }
                        };
                    }
                    new Thread(start).Start();
                }
                this.ShowMsgAndReUrl(string.Format("成功修改了{0}个分销商的等级", num), true, this.localUrl);
                this.BindData();
            }
        }
示例#8
0
        private void GradeCheck_Click(object sender, System.EventArgs e)
        {
            string item = "";

            if (!string.IsNullOrEmpty(base.Request["CheckBoxGroup"]))
            {
                item = base.Request["CheckBoxGroup"];
            }
            string str1 = this.GradeCheckList.SelectedValue.ToString();

            if (item.Length <= 0)
            {
                this.ShowMsg("请先选择要修改等级的分销商", false);
                return;
            }
            int num1 = DistributorsBrower.EditCommisionsGrade(item, str1);

            if (num1 > 0)
            {
                (new Thread(() =>
                {
                    DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(int.Parse(str1));
                    if (distributorGradeInfo != null)
                    {
                        string[] strArrays = item.Split(new char[] { ',' });
                        for (int i = 0; i < (int)strArrays.Length; i++)
                        {
                            string str = strArrays[i];
                            int num = 0;
                            if (int.TryParse(str, out num))
                            {
                                try
                                {
                                    MemberInfo member = MemberProcessor.GetMember(num, true);
                                    if (member != null)
                                    {
                                        Messenger.SendWeiXinMsg_DistributorGradeChange(member, distributorGradeInfo.Name);
                                    }
                                }
                                catch (Exception exception)
                                {
                                    Globals.Debuglog(string.Concat("升级变动提醒发送错误:", exception.Message, "-- ", item), "_Debuglog.txt");
                                }
                            }
                        }
                    }
                })).Start();
            }
            this.ShowMsgAndReUrl(string.Format("成功修改了{0}个分销商的等级", num1), true, this.localUrl);
            this.BindData();
        }
        //private bool ABdcZUiWNfsGNbV(oArVIo9LHFJa(MemberInfo memberInfo)
        //{
        //    string[] strArrays = new string[] { "ValMember" };
        //    ValidationResults validationResults = Validation.Validate<MemberInfo>(memberInfo, strArrays);
        //    string empty = string.Empty;
        //    if (!validationResults.IsValid)
        //    {
        //        foreach (ValidationResult validationResult in (IEnumerable<ValidationResult>)validationResults)
        //        {
        //            empty = string.Concat(empty, Formatter.FormatErrorMessage(validationResult.Message));
        //        }
        //        this.ShowMsg(empty, false);
        //    }
        //    return validationResults.IsValid;
        //}

        protected void btnEditUser_Click(object sender, EventArgs e)
        {
            decimal num  = new decimal(0, 0, 0, false, 1);
            decimal num1 = new decimal(0, 0, 0, false, 1);
            decimal num2 = new decimal(0, 0, 0, false, 1);
            decimal num3 = new decimal(0, 0, 0, false, 1);
            DistributorGradeInfo distributorGradeInfo = new DistributorGradeInfo();

            if (this.m_GradeId > 0)
            {
                distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(this.m_GradeId);
            }
            distributorGradeInfo.Name = this.txtName.Text.Trim();
            decimal.TryParse(this.txtCommissionsLimit.Text.Trim(), out num);
            decimal.TryParse(this.txtFirstCommissionRise.Text.Trim(), out num1);
            decimal.TryParse(this.txtSecondCommissionRise.Text.Trim(), out num2);
            decimal.TryParse(this.txtThirdCommissionRise.Text.Trim(), out num3);
            distributorGradeInfo.CommissionsLimit     = num;
            distributorGradeInfo.FirstCommissionRise  = num1;
            distributorGradeInfo.SecondCommissionRise = num2;
            distributorGradeInfo.ThirdCommissionRise  = num3;
            distributorGradeInfo.IsDefault            = (this.rbtnlIsDefault.SelectedIndex == 0 ? true : false);
            distributorGradeInfo.Description          = this.txtDescription.Text.Trim();
            distributorGradeInfo.Ico = this.uploader1.UploadedImageUrl;
            if (DistributorGradeBrower.IsExistsMinAmount(this.m_GradeId, num))
            {
                this.ShowMsg("已存在相同佣金的分销商等级", false);
                return;
            }
            if (this.m_GradeId <= 0)
            {
                if (!DistributorGradeBrower.CreateDistributorGrade(distributorGradeInfo))
                {
                    this.ShowMsg("分销商等级新增失败", false);
                    return;
                }
                this.ShowMsgAndReUrl("成功新增了分销商等级", true, this.ReUrl);
                return;
            }
            if (!DistributorGradeBrower.UpdateDistributor(distributorGradeInfo))
            {
                this.ShowMsg("分销商等级修改失败", false);
                return;
            }
            if (base.Request.QueryString["reurl"] != null)
            {
                this.ReUrl = base.Request.QueryString["reurl"].ToString();
            }
            this.ShowMsgAndReUrl("成功修改了分销商等级", true, this.ReUrl);
        }
示例#10
0
        private Literal litUserName; //昵称
        protected override void AttachChildControls()
        {
            this.image       = (Image)this.FindControl("image");
            this.litUserType = (Literal)this.FindControl("litUserType");
            this.litUserName = (Literal)this.FindControl("litUserName");
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (currentMember != null)
            {
                HtmlInputText control = (HtmlInputText)this.FindControl("txtUserName");
                HtmlInputText text2   = (HtmlInputText)this.FindControl("txtRealName");
                HtmlInputText text3   = (HtmlInputText)this.FindControl("txtPhone");
                HtmlInputText text4   = (HtmlInputText)this.FindControl("txtEmail");
                litUserName.SetWhenIsNotNull(currentMember.UserName);
                control.SetWhenIsNotNull(currentMember.UserName);
                text2.SetWhenIsNotNull(currentMember.RealName);
                text3.SetWhenIsNotNull(currentMember.CellPhone);
                text4.SetWhenIsNotNull(currentMember.QQ);
            }
            if (!string.IsNullOrEmpty(currentMember.UserHead) && image != null)
            {
                this.image.ImageUrl = currentMember.UserHead;
            }
            //通过当前用户id查找分销商信息,从而来判断用户类型
            DistributorsInfo currentDistributor = DistributorsBrower.GetDistributorInfo(currentMember.UserId);

            if (this.litUserType != null)
            {
                /*
                 * if (currentDistributor == null)
                 *  this.litUserType.Text = "普通用户";
                 * else if (!string.IsNullOrEmpty(currentDistributor.ReferralPath))
                 *  this.litUserType.Text = "分仓";
                 * else if (currentDistributor.IsAgent == 0)
                 *  this.litUserType.Text = "分销商";
                 */
                if (currentDistributor == null)
                {
                    this.litUserType.Text = Hidistro.ControlPanel.Members.MemberHelper.GetMemberGrade(currentMember.GradeId).Name;
                }
                else
                {
                    this.litUserType.Text = DistributorGradeBrower.GetDistributorGradeInfo(currentDistributor.DistriGradeId).Name;
                }
            }
            PageTitle.AddSiteNameTitle("修改用户信息");
        }
        protected override void AttachChildControls()
        {
            SiteSettings masterSettings        = SettingsManager.GetMasterSettings(true);
            string       distributorCenterName = masterSettings.DistributorCenterName;
            string       commissionName        = masterSettings.CommissionName;

            this.fxCenter             = (Literal)this.FindControl("fxCenter");
            this.fxCenter.Text        = distributorCenterName;
            this.commissionName1      = (Literal)this.FindControl("commissionName1");
            this.commissionName2      = (Literal)this.FindControl("commissionName2");
            this.commissionName1.Text = commissionName;
            this.commissionName2.Text = commissionName;
            this.fxTeamName           = (Literal)this.FindControl("fxTeamName");
            this.fxTeamName.Text      = masterSettings.DistributionTeamName;
            this.shopName             = (Literal)this.FindControl("shopName");
            this.shopName.Text        = masterSettings.MyShopName;
            this.firstShop            = (Literal)this.FindControl("firstShop");
            this.firstShop.Text       = masterSettings.FirstShopName;
            this.secondShop           = (Literal)this.FindControl("secondShop");
            this.secondShop.Text      = masterSettings.SecondShopName;
            this.myCommission         = (Literal)this.FindControl("myCommission");
            this.myCommission.Text    = masterSettings.MyCommissionName;
            this.fxExplain            = (Literal)this.FindControl("fxExplain");
            this.fxExplain.Text       = masterSettings.DistributionDescriptionName;
            PageTitle.AddSiteNameTitle(distributorCenterName);
            int currentMemberUserId             = Globals.GetCurrentMemberUserId(false);
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);

            if (userIdDistributors == null)
            {
                HttpContext.Current.Response.Redirect("DistributorRegCheck.aspx");
            }
            else if (userIdDistributors.ReferralStatus != 0)
            {
                HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                this.imglogo = (Image)this.FindControl("image");
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                if (masterSettings.IsShowDistributorSelfStoreName)
                {
                    this.imglogo.Attributes.Add("onclick", "window.location.href = 'DistributorInfo.aspx'");
                }
                this.litStroeName      = (Literal)this.FindControl("litStroeName");
                this.litStroeName.Text = userIdDistributors.StoreName;
                this.litrGradeName     = (Literal)this.FindControl("litrGradeName");
                DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(userIdDistributors.DistriGradeId);
                if (distributorGradeInfo != null)
                {
                    this.litrGradeName.Text = distributorGradeInfo.Name;
                }
                this.litReferralBlance      = (Literal)this.FindControl("litReferralBlance");
                this.litReferralBlance.Text = userIdDistributors.ReferralBlance.ToString("F2");
                this.litUserId         = (Literal)this.FindControl("litUserId");
                this.litUserId1        = (Literal)this.FindControl("litUserId1");
                this.litUserId2        = (Literal)this.FindControl("litUserId2");
                this.litUserId3        = (Literal)this.FindControl("litUserId3");
                this.litUserId4        = (Literal)this.FindControl("litUserId4");
                this.litUserId.Text    = userIdDistributors.UserId.ToString();
                this.litUserId1.Text   = userIdDistributors.UserId.ToString();
                this.litUserId2.Text   = userIdDistributors.UserId.ToString();
                this.litUserId3.Text   = userIdDistributors.UserId.ToString();
                this.litUserId4.Text   = userIdDistributors.UserId.ToString();
                this.litTodayOrdersNum = (Literal)this.FindControl("litTodayOrdersNum");
                OrderQuery query = new OrderQuery {
                    UserId = new int?(currentMemberUserId),
                    Status = OrderStatus.Today
                };
                this.litTodayOrdersNum.Text = DistributorsBrower.GetDistributorOrderCount(query).ToString();
                this.refrraltotal           = (FormatedMoneyLabel)this.FindControl("refrraltotal");
                this.refrraltotal.Money     = DistributorsBrower.GetUserCommissions(userIdDistributors.UserId, DateTime.Now, null, null, null, "");
                this.saletotal       = (FormatedMoneyLabel)this.FindControl("saletotal");
                this.saletotal.Money = userIdDistributors.OrdersTotal;
                this.litMysubMember  = (Literal)this.FindControl("litMysubMember");
                this.litMysubFirst   = (Literal)this.FindControl("litMysubFirst");
                this.litMysubSecond  = (Literal)this.FindControl("litMysubSecond");
                DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId);
                if ((distributorsSubStoreNum != null) || (distributorsSubStoreNum.Rows.Count > 0))
                {
                    this.litMysubMember.Text = distributorsSubStoreNum.Rows[0]["memberCount"].ToString();
                    this.litMysubFirst.Text  = distributorsSubStoreNum.Rows[0]["firstV"].ToString();
                    this.litMysubSecond.Text = distributorsSubStoreNum.Rows[0]["secondV"].ToString();
                }
                else
                {
                    this.litMysubMember.Text = "0";
                    this.litMysubFirst.Text  = "0";
                    this.litMysubSecond.Text = "0";
                }
                this.litProtuctNum      = (Literal)this.FindControl("litProtuctNum");
                this.litProtuctNum.Text = ProductBrowser.GetProductsNumber(true).ToString();
                query.Status            = OrderStatus.All;
                this.litOrders          = (Literal)this.FindControl("litOrders");
                this.litOrders.Text     = DistributorsBrower.GetDistributorOrderCount(query).ToString();
                this.UpClassInfo        = (HtmlContainerControl)this.FindControl("UpClassInfo");
                IList <DistributorGradeInfo> distributorGradeInfos = VShopHelper.GetDistributorGradeInfos();
                DistributorGradeInfo         info3 = null;
                foreach (DistributorGradeInfo info4 in distributorGradeInfos)
                {
                    if (distributorGradeInfo.CommissionsLimit < info4.CommissionsLimit)
                    {
                        if (info3 == null)
                        {
                            info3 = info4;
                        }
                        else if (info3.CommissionsLimit > info4.CommissionsLimit)
                        {
                            info3 = info4;
                        }
                    }
                }
                if (info3 == null)
                {
                    this.UpClassInfo.Visible = false;
                }
                else
                {
                    decimal num2 = (info3.CommissionsLimit - userIdDistributors.ReferralBlance) - userIdDistributors.ReferralRequestBalance;
                    if (num2 < 0M)
                    {
                        num2 = 0.01M;
                    }
                    this.UpClassInfo.InnerHtml = "再获得<span> " + num2.ToString("F2") + " 元</span>" + commissionName + "升级为 <span>" + info3.Name + "</span>";
                }
            }
        }
示例#12
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (currentMember != null)
            {
                MemberGradeInfo memberGrade   = MemberProcessor.GetMemberGrade(currentMember.GradeId);
                OrderInfo       userLastOrder = MemberProcessor.GetUserLastOrder(currentMember.UserId);
                string          arg           = (!string.IsNullOrEmpty(currentMember.UserBindName)) ? currentMember.UserBindName : currentMember.UserName;
                string          arg2          = (!string.IsNullOrEmpty(currentMember.OpenId)) ? currentMember.UserName : string.Empty;
                int             port          = context.Request.Url.Port;
                string          text          = (port == 80) ? "" : (":" + port.ToString());
                string.Concat(new string[]
                {
                    "http://",
                    context.Request.Url.Host,
                    text,
                    Globals.ApplicationPath,
                    "/Admin/member/managemembers.aspx?Username="******"&pageSize=10"
                });
                string           arg3 = currentMember.UserBindName + "【" + ((memberGrade != null) ? memberGrade.Name : "普通会员") + "】";
                string           arg4 = currentMember.OrderNumber.ToString() + "单(¥" + currentMember.Expenditure.ToString("F2") + ")";
                string           arg5 = (userLastOrder != null) ? userLastOrder.OrderDate.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty;
                string           arg6 = string.Empty;
                string           arg7 = string.Empty;
                string           arg8 = string.Empty;
                string           arg9 = string.Empty;
                int              currentMemberUserId = Globals.GetCurrentMemberUserId(false);
                DistributorsInfo userIdDistributors  = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);
                if (userIdDistributors != null)
                {
                    DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(userIdDistributors.DistriGradeId);
                    string           text2           = "0.00";
                    DistributorsInfo distributorInfo = DistributorsBrower.GetDistributorInfo(userIdDistributors.UserId);
                    if (distributorInfo != null)
                    {
                        text2 = distributorInfo.ReferralBlance.ToString("F2");
                    }
                    string str  = "0";
                    string str2 = "0";
                    System.Data.DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId);
                    if (distributorsSubStoreNum != null || distributorsSubStoreNum.Rows.Count > 0)
                    {
                        str  = distributorsSubStoreNum.Rows[0]["firstV"].ToString();
                        str2 = distributorsSubStoreNum.Rows[0]["secondV"].ToString();
                    }
                    string.Concat(new string[]
                    {
                        "http://",
                        context.Request.Url.Host,
                        text,
                        Globals.ApplicationPath,
                        "/Admin/Fenxiao/distributorlist.aspx?MicroSignal=",
                        currentMember.UserName,
                        "&Status=0&pageSize=10"
                    });
                    arg6 = userIdDistributors.StoreName + "【" + distributorGradeInfo.Name + "】";
                    arg7 = "¥" + userIdDistributors.OrdersTotal.ToString("F2");
                    arg8 = string.Concat(new string[]
                    {
                        "¥",
                        text2,
                        "(待提现¥",
                        userIdDistributors.ReferralBlance.ToString("F2"),
                        ",已提现¥",
                        userIdDistributors.ReferralRequestBalance.ToString("F2"),
                        ")"
                    });
                    arg9 = "一级分店数" + str + ",二级分店数" + str2;
                }
                stringBuilder.Append("<script>");
                stringBuilder.Append("var mechatMetadataInter = setInterval(function() {");
                stringBuilder.Append("if (window.mechatMetadata) {");
                stringBuilder.Append("clearInterval(mechatMetadataInter);");
                stringBuilder.Append("window.mechatMetadata({");
                stringBuilder.AppendFormat("appUserName: '******',", arg);
                stringBuilder.AppendFormat("appNickName: '{0}',", currentMember.UserName);
                stringBuilder.AppendFormat("realName: '{0}',", currentMember.RealName);
                stringBuilder.AppendFormat("avatar: '{0}',", currentMember.UserHead);
                stringBuilder.AppendFormat("tel: '{0}',", currentMember.CellPhone);
                stringBuilder.AppendFormat("email: '{0}',", currentMember.Email);
                stringBuilder.AppendFormat("QQ: '{0}',", currentMember.QQ);
                stringBuilder.AppendFormat("weibo: '',", new object[0]);
                stringBuilder.AppendFormat("weixin: '{0}',", arg2);
                stringBuilder.AppendFormat("address: '{0}',", currentMember.Address);
                stringBuilder.Append("extraParams: {");
                stringBuilder.AppendFormat("'会员帐号': '{0}',", arg3);
                stringBuilder.AppendFormat("'会员订单': '{0}',", arg4);
                stringBuilder.AppendFormat("'会员积分': '{0}',", currentMember.Points.ToString());
                stringBuilder.AppendFormat("'最近购买': '{0}',", arg5);
                stringBuilder.AppendFormat("'店铺名称': '{0}',", arg6);
                stringBuilder.AppendFormat("'销售额': '{0}',", arg7);
                stringBuilder.AppendFormat("'佣金信息': '{0}',", arg8);
                stringBuilder.AppendFormat("'分店数量': '{0}'", arg9);
                stringBuilder.Append("}");
                stringBuilder.Append("});");
                stringBuilder.Append("}");
                stringBuilder.Append("}, 500);");
                stringBuilder.Append("</script>");
            }
            context.Response.Write(stringBuilder.ToString() + " ");
        }
示例#13
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("分销中心");
            int currentMemberUserId             = Globals.GetCurrentMemberUserId();
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);

            if (userIdDistributors == null)
            {
                System.Web.HttpContext.Current.Response.Redirect("DistributorRegCheck.aspx");
            }
            else if (userIdDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                this.imglogo = (System.Web.UI.WebControls.Image) this.FindControl("image");
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                this.litStroeName      = (System.Web.UI.WebControls.Literal) this.FindControl("litStroeName");
                this.litStroeName.Text = userIdDistributors.StoreName;
                this.litrGradeName     = (System.Web.UI.WebControls.Literal) this.FindControl("litrGradeName");
                DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(userIdDistributors.DistriGradeId);
                if (distributorGradeInfo != null)
                {
                    this.litrGradeName.Text = distributorGradeInfo.Name;
                }
                this.litReferralBlance      = (System.Web.UI.WebControls.Literal) this.FindControl("litReferralBlance");
                this.litReferralBlance.Text = userIdDistributors.ReferralBlance.ToString("F2");
                this.litUserId         = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId");
                this.litUserId1        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId1");
                this.litUserId2        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId2");
                this.litUserId3        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId3");
                this.litUserId4        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId4");
                this.litUserId.Text    = userIdDistributors.UserId.ToString();
                this.litUserId1.Text   = userIdDistributors.UserId.ToString();
                this.litUserId2.Text   = userIdDistributors.UserId.ToString();
                this.litUserId3.Text   = userIdDistributors.UserId.ToString();
                this.litUserId4.Text   = userIdDistributors.UserId.ToString();
                this.litTodayOrdersNum = (System.Web.UI.WebControls.Literal) this.FindControl("litTodayOrdersNum");
                OrderQuery orderQuery = new OrderQuery();
                orderQuery.UserId           = new int?(currentMemberUserId);
                orderQuery.Status           = OrderStatus.Today;
                this.litTodayOrdersNum.Text = DistributorsBrower.GetDistributorOrderCount(orderQuery).ToString();
                this.refrraltotal           = (FormatedMoneyLabel)this.FindControl("refrraltotal");
                this.refrraltotal.Money     = DistributorsBrower.GetUserCommissions(userIdDistributors.UserId, System.DateTime.Now, null, null, null, "");
                this.saletotal       = (FormatedMoneyLabel)this.FindControl("saletotal");
                this.saletotal.Money = userIdDistributors.OrdersTotal;
                this.litMysubMember  = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubMember");
                this.litMysubFirst   = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubFirst");
                this.litMysubSecond  = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubSecond");
                DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId);
                if (distributorsSubStoreNum != null || distributorsSubStoreNum.Rows.Count > 0)
                {
                    this.litMysubMember.Text = distributorsSubStoreNum.Rows[0]["memberCount"].ToString();
                    this.litMysubFirst.Text  = distributorsSubStoreNum.Rows[0]["firstV"].ToString();
                    this.litMysubSecond.Text = distributorsSubStoreNum.Rows[0]["secondV"].ToString();
                }
                else
                {
                    this.litMysubMember.Text = "0";
                    this.litMysubFirst.Text  = "0";
                    this.litMysubSecond.Text = "0";
                }
                this.litProtuctNum      = (System.Web.UI.WebControls.Literal) this.FindControl("litProtuctNum");
                this.litProtuctNum.Text = ProductBrowser.GetProductsNumber(true).ToString();
                orderQuery.Status       = OrderStatus.All;
                this.litOrders          = (System.Web.UI.WebControls.Literal) this.FindControl("litOrders");
                this.litOrders.Text     = DistributorsBrower.GetDistributorOrderCount(orderQuery).ToString();
                this.UpClassInfo        = (System.Web.UI.HtmlControls.HtmlContainerControl) this.FindControl("UpClassInfo");
                System.Collections.Generic.IList <DistributorGradeInfo> distributorGradeInfos = VShopHelper.GetDistributorGradeInfos();
                DistributorGradeInfo distributorGradeInfo2 = null;
                foreach (DistributorGradeInfo current in distributorGradeInfos)
                {
                    if (!(distributorGradeInfo.CommissionsLimit >= current.CommissionsLimit))
                    {
                        if (distributorGradeInfo2 == null)
                        {
                            distributorGradeInfo2 = current;
                        }
                        else if (distributorGradeInfo2.CommissionsLimit > current.CommissionsLimit)
                        {
                            distributorGradeInfo2 = current;
                        }
                    }
                }
                if (distributorGradeInfo2 == null)
                {
                    this.UpClassInfo.Visible = false;
                }
                else
                {
                    decimal d = distributorGradeInfo2.CommissionsLimit - userIdDistributors.ReferralBlance - userIdDistributors.ReferralRequestBalance;
                    if (d < 0m)
                    {
                        d = 0.01m;
                    }
                    this.UpClassInfo.InnerHtml = string.Concat(new string[]
                    {
                        "再获得<span> ",
                        d.ToString("F2"),
                        " 元</span>佣金升级为 <span>",
                        distributorGradeInfo2.Name,
                        "</span>"
                    });
                }
            }
        }
示例#14
0
        protected override void Render(HtmlTextWriter writer)
        {
            base.Text = "";
            SiteSettings  masterSettings = SettingsManager.GetMasterSettings(false);
            StringBuilder builder        = new StringBuilder();
            bool          flag           = false;
            string        str            = string.Empty;
            string        str2           = string.Empty;

            if (masterSettings.EnableSaleService)
            {
                if (!string.IsNullOrEmpty(masterSettings.MeiQiaEntId))
                {
                    flag = true;
                    string     str3          = "name: '游客'";
                    MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                    if (currentMember == null)
                    {
                        string getCurrentWXOpenId = Globals.GetCurrentWXOpenId;
                        if (!string.IsNullOrEmpty(getCurrentWXOpenId))
                        {
                            currentMember = MemberProcessor.GetOpenIdMember(getCurrentWXOpenId, "wx");
                        }
                    }
                    if (currentMember != null)
                    {
                        StringBuilder builder2 = new StringBuilder();
                        builder2.Append("name: '" + (string.IsNullOrEmpty(currentMember.RealName) ? currentMember.UserName : currentMember.RealName) + "'");
                        if (!string.IsNullOrEmpty(currentMember.Email))
                        {
                            builder2.Append(",email: '" + currentMember.Email + "'");
                        }
                        if (!string.IsNullOrEmpty(currentMember.Address))
                        {
                            builder2.Append(",address: '" + currentMember.Address.Replace("'", "’") + "'");
                        }
                        if (!string.IsNullOrEmpty(currentMember.CellPhone))
                        {
                            builder2.Append(",tel: '" + currentMember.CellPhone + "'");
                        }
                        if (!string.IsNullOrEmpty(currentMember.QQ))
                        {
                            builder2.Append(",qq: '" + currentMember.QQ + "'");
                        }
                        MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(currentMember.GradeId);
                        builder2.Append(",会员帐号: '" + currentMember.UserBindName + "【" + ((memberGrade != null) ? memberGrade.Name : "普通会员") + "】'");
                        builder2.Append(",注册日期: '" + currentMember.CreateDate.ToString("yyyy-MM-dd") + "'");
                        builder2.Append(",订单量: '" + currentMember.OrderNumber + "'");
                        builder2.Append(",积分: '" + currentMember.Points + "'");
                        if (currentMember.LastOrderDate.HasValue)
                        {
                            builder2.Append(",最近下单: '" + currentMember.LastOrderDate.Value.ToString("yyyy-MM-dd") + "'");
                        }
                        DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMember.UserId);
                        if (userIdDistributors != null)
                        {
                            DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(userIdDistributors.DistriGradeId);
                            string           str5            = "0.00";
                            DistributorsInfo distributorInfo = DistributorsBrower.GetDistributorInfo(userIdDistributors.UserId);
                            if (distributorInfo != null)
                            {
                                str5 = distributorInfo.ReferralBlance.ToString("F2");
                            }
                            string    str6 = "0";
                            string    str7 = "0";
                            DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId);
                            if ((distributorsSubStoreNum != null) || (distributorsSubStoreNum.Rows.Count > 0))
                            {
                                str6 = distributorsSubStoreNum.Rows[0]["firstV"].ToString();
                                str7 = distributorsSubStoreNum.Rows[0]["secondV"].ToString();
                            }
                            builder2.Append(",店铺名称: '" + userIdDistributors.StoreName + "【" + distributorGradeInfo.Name + "】'");
                            builder2.Append(",销售额: '¥" + userIdDistributors.OrdersTotal.ToString("F2") + "'");
                            builder2.Append(",佣金信息: '¥" + str5 + "(待提现¥" + userIdDistributors.ReferralBlance.ToString("F2") + ",已提现¥" + userIdDistributors.ReferralRequestBalance.ToString("F2") + ")'");
                            builder2.Append(",comment: '" + ("一级分店数" + str6 + ",二级分店数" + str7) + "'");
                        }
                        str3 = builder2.ToString();
                    }
                    str  = "<script>function MeiQiaInit() {$('#meiqia_serviceico').show();}(function(m, ei, q, i, a, j, s) {m[a] = m[a] || function() {(m[a].a = m[a].a || []).push(arguments)};j = ei.createElement(q),s = ei.getElementsByTagName(q)[0];j.async = true;j.charset = 'UTF-8';j.src = i + '?v=' + new Date().getUTCDate();s.parentNode.insertBefore(j, s);})(window, document, 'script', '//static.meiqia.com/dist/meiqia.js', '_MEIQIA');_MEIQIA('entId', " + masterSettings.MeiQiaEntId + ");_MEIQIA('withoutBtn');_MEIQIA('metadata', {" + str3 + "});</script><script>_MEIQIA('allSet', MeiQiaInit);</script>";
                    str2 = "<!-- 在线客服 -->\n<div class=\"customer-service\" id=\"meiqia_serviceico\" style=\"position:fixed;bottom:100px;right:10%;width:38px;height:38px;background:url(/Utility/pics/service.png?v1026) no-repeat;background-size:100%;cursor:pointer;display:none\" onclick=\"javascript:_MEIQIA._SHOWPANEL();\"></div>";
                }
                else
                {
                    CustomerServiceSettings settings2 = CustomerServiceManager.GetMasterSettings(false);
                    if ((!string.IsNullOrEmpty(settings2.unitid) && !string.IsNullOrEmpty(settings2.unit)) && !string.IsNullOrEmpty(settings2.password))
                    {
                        str  = string.Format("<script src='//meiqia.com/js/mechat.js?unitid={0}&btn=hide' charset='UTF-8' async='async'></script>", settings2.unitid);
                        flag = true;
                        builder.Append("<script type=\"text/javascript\">");
                        builder.Append("function mechatFuc()");
                        builder.Append("{");
                        builder.Append("$.get(\"/Api/Hi_Ajax_OnlineServiceConfig.ashx\", function (data) {");
                        builder.Append("if (data != \"\") {");
                        builder.Append("$(data).appendTo('head');");
                        builder.Append("}");
                        builder.Append("mechatClick();");
                        builder.Append("});");
                        builder.Append("}");
                        builder.Append("</script>");
                        str2 = "<!-- 在线客服 -->\n<div class=\"customer-service\" style=\"position:fixed;bottom:100px;right:10%;width:38px;height:38px;background:url(/Utility/pics/service.png?v1026) no-repeat;background-size:100%;cursor:pointer;\" onclick=\"javascript:mechatFuc();\"></div>";
                    }
                }
                if (flag)
                {
                    base.Text = str + "\n" + builder.ToString() + "\n" + str2;
                }
            }
            base.Render(writer);
        }
示例#15
0
        private void bindValues()
        {
            PageTitle.AddSiteNameTitle("店铺中心");
            int currentMemberUserId = Globals.GetCurrentMemberUserId();
            DistributorsInfo     userIdDistributors   = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);
            DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(userIdDistributors.DistriGradeId);

            if (userIdDistributors != null)
            {
                OrderQuery query = new OrderQuery
                {
                    UserId = new int?(currentMemberUserId),
                    Status = OrderStatus.Today
                };
                this.litTodayOrdersNum.Text = DistributorsBrower.GetDistributorOrderCount(query).ToString();
                //新模板--------------
                this.litStroeName.Text  = userIdDistributors.StoreName;                                                   //店名
                this.saletotal.Money    = userIdDistributors.OrdersTotal;                                                 //订单总额
                this.refrraltotal.Money = DistributorsBrower.GetUserCommissions(userIdDistributors.UserId, DateTime.Now); //今日佣金
                //头像
                if ((distributorGradeInfo != null) && (distributorGradeInfo.Ico.Length > 10))
                {
                    this.imgGrade.ImageUrl = distributorGradeInfo.Ico;
                }
                else
                {
                    this.imgGrade.Visible = false;
                }
                //店铺logo
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                else
                {
                    SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                    if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
                    {
                        this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
                    }
                }
                //当前用户是不是分销商
                val_isAgent.Value = userIdDistributors.IsAgent.ToString();
                //加入时间
                val_joinTime.Value = userIdDistributors.CreateTime.ToLongDateString();
                //可提现佣金
                lblsurpluscommission.Money = userIdDistributors.ReferralBlance;
                //我的佣金=剩余可体现佣金+提现中的佣金
                val_MyCommission.Value = (userIdDistributors.ReferralBlance + userIdDistributors.ReferralRequestBalance).ToString("F2");
                //我的下属分销商数量
                val_MyChirldrenDistributors.Value = DistributorsBrower.GetDownDistributorNum(userIdDistributors.UserId.ToString()).ToString();
                //店铺订单数量
                OrderQuery distributorOrderQuery = new OrderQuery {
                    UserId = userIdDistributors.UserId,
                };
                val_MyDistributorOrders.Value = DistributorsBrower.GetDistributorOrderCount(distributorOrderQuery).ToString();
                //我的下属店铺订单数量
                OrderQuery underOrderQuery = new OrderQuery {
                    UserId = userIdDistributors.UserId,
                };
                val_MyUnderOrder.Value = DistributorsBrower.GetUnderOrders(underOrderQuery).TotalRecords.ToString();
                //粉丝数量(对代理商,对分销商)
                val_MyVisitCount.Value = DistributorsBrower.GetDistributorVisitCount(userIdDistributors.UserId).ToString();
                //特殊字眼处理
                name_MyCommission.Value            = CustomConfigHelper.Instance.MyCashText;        //我的佣金
                name_MyChirldrenDistributors.Value = CustomConfigHelper.Instance.MyDistributorText; //我的下属
                //传递爽爽挝啡的特殊名到前端,前端用jquery进行相应的功能隐藏
                if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.AutoShipping)
                {
                    specialHideShow.Value = "sswk";//爽爽挝啡
                }
            }
        }
示例#16
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺中心");
            int currentMemberUserId             = Globals.GetCurrentMemberUserId();
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);

            if (userIdDistributors == null)
            {
                HttpContext.Current.Response.Redirect("DistributorRegCheck.aspx");
            }
            else if (userIdDistributors.ReferralStatus != 0)
            {
                HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                this.imglogo = (Image)this.FindControl("image");
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                this.litStroeName      = (Literal)this.FindControl("litStroeName");
                this.litStroeName.Text = userIdDistributors.StoreName;
                this.litrGradeName     = (Literal)this.FindControl("litrGradeName");
                DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(userIdDistributors.DistriGradeId);
                this.litrGradeName.Text     = distributorGradeInfo.Name;
                this.litReferralBlance      = (Literal)this.FindControl("litReferralBlance");
                this.litReferralBlance.Text = userIdDistributors.ReferralBlance.ToString("F2");
                this.litUserId         = (Literal)this.FindControl("litUserId");
                this.litUserId1        = (Literal)this.FindControl("litUserId1");
                this.litUserId2        = (Literal)this.FindControl("litUserId2");
                this.litUserId.Text    = userIdDistributors.UserId.ToString();
                this.litUserId1.Text   = userIdDistributors.UserId.ToString();
                this.litUserId2.Text   = userIdDistributors.UserId.ToString();
                this.litTodayOrdersNum = (Literal)this.FindControl("litTodayOrdersNum");
                OrderQuery query = new OrderQuery {
                    UserId = new int?(currentMemberUserId),
                    Status = OrderStatus.Today
                };
                this.litTodayOrdersNum.Text = DistributorsBrower.GetDistributorOrderCount(query).ToString();
                this.refrraltotal           = (FormatedMoneyLabel)this.FindControl("refrraltotal");
                this.refrraltotal.Money     = DistributorsBrower.GetUserCommissions(userIdDistributors.UserId, DateTime.Now, null, null, null);
                this.saletotal       = (FormatedMoneyLabel)this.FindControl("saletotal");
                this.saletotal.Money = userIdDistributors.OrdersTotal;
                this.saletotal       = (FormatedMoneyLabel)this.FindControl("saletotal");
                this.saletotal.Money = userIdDistributors.OrdersTotal;
                this.litMysubStore   = (Literal)this.FindControl("litMysubStore");
                this.litMysubFirst   = (Literal)this.FindControl("litMysubFirst");
                this.litMysubSecond  = (Literal)this.FindControl("litMysubSecond");
                DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId);
                if ((distributorsSubStoreNum != null) || (distributorsSubStoreNum.Rows.Count > 0))
                {
                    this.litMysubFirst.Text  = distributorsSubStoreNum.Rows[0]["firstV"].ToString();
                    this.litMysubSecond.Text = distributorsSubStoreNum.Rows[0]["secondV"].ToString();
                    this.litMysubStore.Text  = (int.Parse(this.litMysubFirst.Text) + int.Parse(this.litMysubSecond.Text)).ToString();
                }
                else
                {
                    this.litMysubFirst.Text  = "0";
                    this.litMysubSecond.Text = "0";
                    this.litMysubStore.Text  = "0";
                }
                this.litProtuctNum      = (Literal)this.FindControl("litProtuctNum");
                this.litProtuctNum.Text = ProductBrowser.GetProductsNumber().ToString();
                query.Status            = OrderStatus.All;
                this.litOrders          = (Literal)this.FindControl("litOrders");
                this.litOrders.Text     = DistributorsBrower.GetDistributorOrderCount(query).ToString();
            }
        }