Пример #1
0
        private void rptProductTop_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                liPromotiontBind(sender, e);

                VshopTemplatedRepeater vtr = (VshopTemplatedRepeater)e.Item.Controls[0].FindControl("inner");
                if (vtr != null)
                {
                    vtr.ItemDataBound += new RepeaterItemEventHandler(this.liPromotiontBind);
                    vtr.DataSource     = ProductBrowser.GetHomeProductTop("3", ProductInfo.ProductTop.Category, Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "CategoryId")));
                    vtr.DataBind();
                }
            }
        }
Пример #2
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺列表");

            this.rptHotSupplierList = (VshopTemplatedRepeater)this.FindControl("rptHotSupplierList");
            this.rptRecSupplierList = (VshopTemplatedRepeater)this.FindControl("rptRecSupplierList");
            this.rpthistorysearch   = (VshopTemplatedRepeater)this.FindControl("rpthistorysearch");
            this.rptAllSupplierList = (VshopTemplatedRepeater)this.FindControl("rptAllSupplierList");

            int    referUserId;
            Member member = HiContext.Current.User as Member;

            if (member != null)
            {
                referUserId = member.UserId;
            }
            else
            {
                referUserId = 0;
            }

            //热卖
            DataTable hotdt = SupplierConfigHelper.GetConfigSupplier(ClientType.App, SupplierCfgType.Hot, referUserId);

            this.rptHotSupplierList.DataSource = hotdt;
            this.rptHotSupplierList.DataBind();
            //推荐
            DataTable recdt = SupplierConfigHelper.GetConfigSupplier(ClientType.App, SupplierCfgType.Recommend, referUserId);

            this.rptRecSupplierList.DataSource = recdt;
            this.rptRecSupplierList.DataBind();
            //所有
            DataTable recdtAll = SupplierConfigHelper.GetConfigSupplier(ClientType.App, 0, referUserId);

            if (recdtAll != null && recdtAll.Rows.Count > 0)
            {
                rptAllSupplierList.DataSource = recdtAll;
                rptAllSupplierList.DataBind();
            }

            int userId = HiContext.Current.User.UserId;

            if (userId > 0 && this.rpthistorysearch != null)
            {
                this.rpthistorysearch.DataSource = HistorySearchHelp.GetSearchHistory(userId, ClientType.VShop, 6);
                this.rpthistorysearch.DataBind();
            }
        }
Пример #3
0
        protected override void AttachChildControls()
        {
            int.TryParse(this.Page.Request.QueryString["TypeID"], out this.typeID);
            int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId);
            this.keyWord       = this.Page.Request.QueryString["keyWord"];
            this.imgUrl        = (HiImage)this.FindControl("imgUrl");
            this.litContent    = (Literal)this.FindControl("litContent");
            this.rptTypes      = (VshopTemplatedRepeater)this.FindControl("rptTypes");
            this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            this.rptBrandsShow = (VshopTemplatedRepeater)this.FindControl("rptBrandsShow");
            List <ProductTypeInfo> listProductTypeInfo = null;

            //卡拉萌购特殊需求
            if (CustomConfigHelper.Instance.BrandShow)
            {
                rptCategories.Visible = false;
                listProductTypeInfo   = (List <ProductTypeInfo>)ProductTypeHelper.GetProductTypes();
                //定义左侧类型栏
                if (rptTypes != null)
                {
                    listProductTypeInfo.Add(new ProductTypeInfo()
                    {
                        TypeId = -1, TypeName = "品牌", PTCode = "9999", CompanyUrl = "http://shop18230.ewaywin.com/Vshop/SecondPage.aspx?SkinID=6fdd3099-b386-49a8-9348-f3f57f5574a1",
                    });
                    this.rptTypes.DataSource = listProductTypeInfo;
                    this.rptTypes.DataBind();
                }
                if (this.typeID == 0 && listProductTypeInfo.Count > 0)
                {
                    this.typeID = listProductTypeInfo.First().TypeId;
                }
                if (this.typeID > 0)
                {
                    //根据传过来的typeId查找商品
                    string brandIds  = string.Empty;
                    string tableName = "Hishop_Products";
                    string where = "typeID=" + this.typeID + "";
                    DataTable dtProductInfo = DataBaseHelper.GetDataTable(tableName, where);
                    if (dtProductInfo.Rows.Count > 0)
                    {
                        for (int i = 0; i < dtProductInfo.Rows.Count; i++)
                        {
                            if (dtProductInfo.Rows[i]["BrandId"].ToString().Trim() == "")
                            {
                                continue;
                            }
                            string[] brandIdArray = dtProductInfo.Rows[i]["BrandId"].ToString().Trim().Split(',');
                            string   strJoin      = "'" + String.Join("','", brandIdArray) + "'";
                            brandIds += string.Format("{0},", strJoin);
                        }
                        if (brandIds.Length > 0)
                        {
                            brandIds = brandIds.TrimEnd(',');
                            rptBrandsShow.TemplateFile = "/Tags/skin-Common_BrandsShow.ascx";
                            DataTable brandInfo = CategoryBrowser.GetBrandsShow(brandIds);
                            this.rptBrandsShow.DataSource = brandInfo;
                            this.rptBrandsShow.DataBind();
                        }
                    }
                }
                else
                {
                    this.Page.Response.Redirect("http://shop18230.ewaywin.com/Vshop/SecondPage.aspx?SkinID=6fdd3099-b386-49a8-9348-f3f57f5574a1");
                }
            }
            else
            {
                listProductTypeInfo = (List <ProductTypeInfo>)ProductTypeHelper.GetProductTypes();
                if (rptTypes != null)
                {
                    listProductTypeInfo.Add(new ProductTypeInfo()
                    {
                        TypeId = -1, TypeName = "品牌", PTCode = "9999"
                    });
                    this.rptTypes.DataSource = listProductTypeInfo;
                    this.rptTypes.DataBind();
                }

                this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories");
                this.rptCategories.ItemDataBound += new RepeaterItemEventHandler(this.rptCategories_ItemDataBound);

                if (this.typeID == 0 && listProductTypeInfo.Count > 0)
                {
                    this.typeID = listProductTypeInfo.First().TypeId;
                }
                if (this.typeID > 0)
                {
                    rptCategories.TemplateFile = "/Tags/skin-Common_Categories.ascx";
                    IList <CategoryInfo> listCategoryInfo = CatalogHelper.GetSequenceCategories();
                    this.rptCategories.DataSource = listCategoryInfo.Where(p => p.AssociatedProductType == this.typeID);
                    this.rptCategories.DataBind();
                }
                else
                {
                    rptCategories.TemplateFile = "/Tags/skin-Common_Brands.ascx";
                    rptCategories.DataSource   = CatalogHelper.GetBrandCategories();
                    rptCategories.DataBind();
                }

                this.Page.Session["stylestatus"] = "4";

                //IList<CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategoriesRange(this.categoryId, 0x3e8, DistributorsBrower.GetCurrStoreProductRange());
                //this.rptCategories.DataSource = maxSubCategories;
                //this.rptCategories.DataBind();
                PageTitle.AddSiteNameTitle("分类搜索页");
            }
        }
Пример #4
0
        private VshopTemplatedRepeater vStatisticsList; //分销商信息列表

        protected override void AttachChildControls()
        {
            this.visitCount      = (Literal)this.FindControl("visitCount");            //访问次数
            this.memberCount     = (Literal)this.FindControl("memberCount");           //会员总数
            this.memberAdd       = (Literal)this.FindControl("memberAdd");             //今日新增会员
            this.orderCount      = (Literal)this.FindControl("orderCount");            //订单总数
            this.orderToday      = (Literal)this.FindControl("orderToday");            //今日订单
            this.visitCountToday = (Literal)this.FindControl("visitCountToday");       //今日访问次数
            this.hiddenIsAgent   = (HtmlInputHidden)this.FindControl("hiddenIsAgent"); //是否代理商
            this.vStatisticsList = (VshopTemplatedRepeater)this.FindControl("vStatisticsList");
            //绑定数据
            MemberInfo       currentMember      = MemberProcessor.GetCurrentMember();
            DistributorsInfo currentDistributor = DistributorsBrower.GetUserIdDistributors(currentMember.UserId);


            if (currentDistributor == null)
            {
                return;
            }

            if (currentDistributor.IsAgent == 0)
            {
                hiddenIsAgent.Value = "0";
                //访问次数
                string visitCount = DistributorsBrower.GetDistributorVisitCount(currentMember.UserId).ToString();
                this.visitCount.Text = string.Format("<li><i>{0}</i><p>店铺访问量</p></li>", visitCount);
                //会员的总数
                string memberCount = DistributorsBrower.GetDistributorMemberCount(currentMember.UserId).ToString();
                this.memberCount.Text = string.Format("<li><i>{0}</i><p>我的会员总数</p></li>", memberCount);
                //今日新增会员
                string memberAddCount = DistributorsBrower.GetDistributorMemberCount(currentMember.UserId, DateTime.Now.ToString("yyyy-MM-dd")).ToString();
                this.memberAdd.Text = string.Format("<li><i>{0}</i><p>今日新增会员</p></li>", memberAddCount);
                //订单总数
                OrderQuery query = new OrderQuery
                {
                    UserId = new int?(Globals.GetCurrentMemberUserId())
                };
                string orderCount = DistributorsBrower.GetDistributorOrderCount(query).ToString();
                this.orderCount.Text = string.Format("<li><i>{0}</i><p>订单总数</p></li>", orderCount);
                //今日订单
                query.Status = OrderStatus.Today;
                string orderToday = DistributorsBrower.GetDistributorOrderCount(query).ToString();
                this.orderToday.Text = string.Format("<li><i>{0}</i><p>今日订单</p></li>", orderToday);
                //今日点击量
                string visitCountT = DistributorsBrower.GetDistributorVisitCount(currentMember.UserId, DateTime.Now.ToString("yyyy-MM-dd")).ToString();
                this.visitCountToday.Text = string.Format("<li><i>{0}</i><p>今日访问量</p></li>", visitCountT);
            }
            else if (currentDistributor.IsAgent == 1)//代理商载入列表页
            {
                hiddenIsAgent.Value = "1";
                DistributorsQuery queryAgent = new DistributorsQuery
                {
                    PageIndex = 1,
                    PageSize  = int.MaxValue,
                    UserId    = currentDistributor.UserId,
                    GradeId   = 3,
                    AgentPath = currentDistributor.UserId.ToString(),
                };
                DataTable all      = DistributorsBrower.GetDownDistributorsAndAgents(queryAgent);//DistributorsBrower.GetAgentDistributorsVisitInfo(currentDistributor.UserId);
                DataTable infoList = new DataTable();
                infoList.Columns.Add("name", typeof(string));
                infoList.Columns.Add("visitCount", typeof(string));
                infoList.Columns.Add("memberCount", typeof(string));
                infoList.Columns.Add("memberAddCount", typeof(string));
                infoList.Columns.Add("orderCount", typeof(string));
                infoList.Columns.Add("orderToday", typeof(string));
                infoList.Columns.Add("visitCountT", typeof(string));

                for (int i = 0; i < all.Rows.Count; i++)
                {
                    int        currentDistributorId = all.Rows[i]["userId"].ToInt();
                    string     visitCount           = DistributorsBrower.GetDistributorVisitCount(currentDistributorId).ToString();
                    string     memberCount          = DistributorsBrower.GetDistributorMemberCount(currentDistributorId).ToString();
                    string     memberAddCount       = DistributorsBrower.GetDistributorMemberCount(currentDistributorId, DateTime.Now.ToString("yyyy-MM-dd")).ToString();
                    OrderQuery query = new OrderQuery
                    {
                        UserId = currentDistributorId
                    };
                    string orderCount = DistributorsBrower.GetDistributorOrderCount(query).ToString();
                    query.Status = OrderStatus.Today;
                    string orderToday  = DistributorsBrower.GetDistributorOrderCount(query).ToString();
                    string visitCountT = DistributorsBrower.GetDistributorVisitCount(currentDistributorId, DateTime.Now.ToString("yyyy-MM-dd")).ToString();
                    string name        = all.Rows[i]["StoreName"].ToString();
                    infoList.Rows.Add(name, visitCount, memberCount, memberAddCount, orderCount, orderToday, visitCountT);
                }
                vStatisticsList.DataSource = infoList;
                vStatisticsList.DataBind();
            }
        }