Esempio n. 1
0
        //public List<Goods> goodsList { get; set; }
        //GoodsService goodsService=new GoodsService();
        protected void Page_Load(object sender, EventArgs e)
        {
            //sgname = Request.Form["sgname"];

            BigClassService bigclassService = new BigClassService();
            CarService      addorderService = new CarService();
            TagService      tagService      = new TagService();

            BigClassList = bigclassService.GetModelList("");
            CarList      = addorderService.GetModelList("");
            TagList      = tagService.GetModelList("");
            Car carer  = new Car();
            int?userid = carer.account;

            if (Session["userList"] == null)
            {
                count = addorderService.GetRecordCount("carstatus='" + 1 + "'");
            }
            else
            {
                userid = ((User)Session["userList"]).uid;
                count  = addorderService.GetRecordCount("carstatus='" + 1 + "' and account='" + userid + "'");
            }
            if (count > 0)
            {
                count = count;
            }
            else
            {
                count = 0;
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //占位标签
            SearchBigId = Int32.Parse(Request["SearchBigId"]);
            BigClassService bigclassService = new BigClassService();
            BigClass        bigClass        = new BigClass();

            bigClass = bigclassService.GetModel(SearchBigId);
            nav      = bigClass.bigname;

            SearchSmallId = Int32.Parse(Request["SearchSmallId"]);
            if (SearchSmallId > 0)
            {
                SmallClassService smallclassService = new SmallClassService();
                SmallClass        smallClass        = new SmallClass();
                smallClass = smallclassService.GetModel(SearchSmallId);
                Code       = smallClass.smallname;

                NoticeService noticeService = new NoticeService();
                NoticeList = noticeService.GetModelList("");
                //分页
                int pageNumber = 1;
                if (!Int32.TryParse(Request["page"], out pageNumber))
                {
                    pageNumber = 1;
                }
                GoodsService goodsService = new GoodsService();
                //goodsList = goodsService.GetModelList("smallid=" +SearchSmallId);
                int maxPage     = 0;
                int recordCount = goodsService.GetRecordCount("smallid=" + SearchSmallId);
                if (recordCount % goodsService.pageCount == 0)
                {
                    maxPage = recordCount / goodsService.pageCount;
                }
                else
                {
                    maxPage = recordCount / goodsService.pageCount + 1;
                }
                if (pageNumber > maxPage)
                {
                    pageNumber = maxPage;
                }
                goodsList = goodsService.FindAllGoodsList(pageNumber, "smallid=" + SearchSmallId);
                pageCode  = PageUtil.genPagination("/goods/GoodsList.aspx", recordCount, pageNumber, goodsService.pageCount, "SearchSmallId=" + SearchSmallId.ToString() + "&SearchBigId=" + SearchBigId);
            }
            else
            {
            }
        }
Esempio n. 3
0
        }                                 //最近浏览
        protected void Page_Load(object sender, EventArgs e)
        {
            BigClassService bigclassService = new BigClassService();

            SmallClassService smallclassService = new SmallClassService();
            GoodsService      goodsService      = new GoodsService();


            BigClassList = bigclassService.GetModelList("");

            foreach (BigClass bigclass in BigClassList)
            {
                bigclass.SmallClassList = smallclassService.GetModelList("bigid = " + bigclass.bigid);
            }
        }
Esempio n. 4
0
        protected void show(object sender, EventArgs e)
        {
            SmallClassService smallclassService = new SmallClassService();
            BigClassService   bigclassService   = new BigClassService();
            GoodsService      goodsService      = new GoodsService();

            smallclassList = smallclassService.GetModelList("");
            int pageNumber = 1;

            if (!Int32.TryParse(Request["page"], out pageNumber))
            {
                pageNumber = 1;
            }
            if (IsPostBack)
            {
                goname  = Request.Form["goname"];
                bysmall = Request.Form["bysmall"];
                iste    = Request.Form["iste"];
                isre    = Request.Form["isre"];
            }
            else
            {
                goname  = Request.QueryString["goname"];
                bysmall = Request.QueryString["bysmall"];
                iste    = Request.QueryString["iste"];
                isre    = Request.QueryString["isre"];
            }
            ArrayList list = goodsService.GetSmallList(pageNumber, goname, bysmall, iste, isre);

            GoodsList = (List <Goods>)list[0];
            pageCode  = list[1].ToString();
            //将小类封装到Goodsmodel中
            foreach (Goods goods in GoodsList)
            {
                goods.smallclass = smallclassService.GetModel(goods.smallid);
            }
        }