Exemplo n.º 1
0
        private void LL()
        {
            string    sql;
            DataTable dt;

            //一级分类
            dtC = PubData.GetDataTable("TaoCan_Class");
            DataRow[] dr = dtC.Select("ClassLevel=1", "Taxis asc");
            dt = dtC.Clone();
            Fn.DrwToDt(dr, dt);
            Bind.BGRepeater(dt, rpClass1);

            //推荐1
            sql = "select top 2 ProSN,ProName,PicS from vgTaoCan_Info where Item&2=2 order by EditDate desc";
            dt  = DbHelp.GetDataTable(sql);
            Bind.BGRepeater(dt, rpTJ1);

            //推荐2
            sql = "select top 4 ProSN,ProName,PicS from vgTaoCan_Info where Item&4=4 order by EditDate desc";
            dt  = DbHelp.GetDataTable(sql);
            Bind.BGRepeater(dt, rpTJ2);

            //精品
            sql = "select top 12 ProSN,ProName,PicS from vgTaoCan_Info where Item&1=1 order by EditDate desc";
            dt  = DbHelp.GetDataTable(sql);
            Bind.BGRepeater(dt, rpJP);
        }
Exemplo n.º 2
0
        public static DataTable GetTree(DataTable pDt, int pClassID, int pMaxLevel, string pOrderBy)
        {
            //DataTable dtClassAll = List();
            GetClassTree gct = new GetClassTree();
            ClassTree    ct  = new ClassTree(pDt, gct, pOrderBy);

            ct.Exe(pClassID);

            DataTable dt = pDt.Clone();

            if (pMaxLevel > 0)
            {
                IList <DataRow> rowList = new List <DataRow>();
                foreach (DataRow drw in gct.DataRowList)
                {
                    if (Convert.ToInt32(drw["ClassLevel"]) < pMaxLevel)
                    {
                        rowList.Add(drw);
                    }
                }

                Fn.DrwToDt(rowList, dt);
            }
            else
            {
                Fn.DrwToDt(gct.DataRowList, dt);
            }

            return(dt);
        }
Exemplo n.º 3
0
        protected void rpClass_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            int      ID = Convert.ToInt32(((Label)e.Item.FindControl("ClassID")).Text);
            Repeater r  = (Repeater)e.Item.FindControl("rpList");

            DataTable dt1 = dtL.Clone();

            DataRow[] dr = dtL.Select("FK_Help_Class=" + ID, "Taxis asc");
            Fn.DrwToDt(dr, dt1);

            r.DataSource = dt1;
            r.DataBind();
        }
Exemplo n.º 4
0
        protected DataTable dtHotSell2; //本月热卖
        private void LL()
        {
            string sSQL;

            //推荐
            sSQL = string.Format("select top 4 ProSN,ProName,PicS,Price,Item from vgPro_Info where Item&{0}={0} order by EditDate desc", (int)PubEnum.ProItem.新品);
            this.rpRecommend.dt = dbCac.GetDataTable("Pro_rpRecommend", ref sSQL);

            //热门
            sSQL          = string.Format("select top 5 ProSN,ProName,PicS,Price,Item from vgPro_Info where Item&{0}={0} order by EditDate desc", (int)PubEnum.ProItem.热销);
            this.rpHot.dt = dbCac.GetDataTable("Pro_rpHot", ref sSQL);

            //网站公告
            sSQL = "select top 5 BulletinSN,Title from Bulletin where BulletinType=0 order by EditDate desc";
            Bind.BGRepeater(dbCac.GetDataTable("Bulletin_rpWebNotice", ref sSQL), this.rpWebNotice, false);

            //活运通知
            sSQL = "select top 5 BulletinSN,Title from Bulletin where BulletinType=1 order by EditDate desc";
            Bind.BGRepeater(dbCac.GetDataTable("Bulletin_rpWebActive", ref sSQL), this.rpWebActive, false);

            //幻灯片
            sSQL = "select AdvName,AdvImg,AdvURL from Adv_Info where Keyword='default_ppt' order by Taxis asc";
            Bind.BGRepeater(dbCac.GetDataTable("Adv_rpPPT", ref sSQL), this.rpPPT, false);

            #region 热卖
            //本周热卖
            Pro_Info_HotSell pihHotSell1 = new Pro_Info_HotSell("Pro_pihHotSell1", DateTime.Now.Add(new TimeSpan(-7, 0, 0, 0)));
            dtHotSell1 = dbCac.GetDataTable(pihHotSell1);

            //本月热卖
            Pro_Info_HotSell pihHotSell2 = new Pro_Info_HotSell("Pro_pihHotSell2", Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")));
            dtHotSell2 = dbCac.GetDataTable(pihHotSell2);
            #endregion

            //分类商品
            this.rpClassPro1.dt = dbCac.GetDataTable("Pro_Class_rpClassPro1", GetClassSQL(2));
            this.rpClassPro2.dt = dbCac.GetDataTable("Pro_Class_rpClassPro2", GetClassSQL(1));
            this.rpClassPro3.dt = dbCac.GetDataTable("Pro_Class_rpClassPro3", GetClassSQL(19));

            //子级分类列表
            DataTable classPro1 = dtProClass.Clone();
            DataTable classPro2 = dtProClass.Clone();
            DataTable classPro3 = dtProClass.Clone();
            Fn.DrwToDt(dtProClass.Select("PClassSN=" + 2, "Taxis asc"), classPro1);
            Fn.DrwToDt(dtProClass.Select("PClassSN=" + 1, "Taxis asc"), classPro2);
            Fn.DrwToDt(dtProClass.Select("PClassSN=" + 19, "Taxis asc"), classPro3);
            Bind.BGRepeater(classPro1, this.rpClass1, false);
            Bind.BGRepeater(classPro2, this.rpClass2, false);
            Bind.BGRepeater(classPro3, this.rpClass3, false);
        }