Beispiel #1
0
        public void LoadData()
        {
            string TextSearch  = "";
            string CreatedDate = "";
            int    CategoryID  = 0;
            int    StockStatus = 0;
            string strColor    = String.Empty;
            string strSize     = String.Empty;
            int    Page        = 1;
            // Filter: floor
            var floor = 0;
            // Filter: row
            var row = 0;
            // Filter: shelf
            var shelf = 0;
            // Filter: floorShelf
            var floorShelf = 0;

            if (Request.QueryString["textsearch"] != null)
            {
                TextSearch = Request.QueryString["textsearch"].Trim();
            }
            if (Request.QueryString["stockstatus"] != null)
            {
                StockStatus = Request.QueryString["stockstatus"].ToInt();
            }
            if (Request.QueryString["categoryid"] != null)
            {
                CategoryID = Request.QueryString["categoryid"].ToInt();
            }
            if (Request.QueryString["createddate"] != null)
            {
                CreatedDate = Request.QueryString["createddate"];
            }
            if (Request.QueryString["color"] != null)
            {
                strColor = Request.QueryString["color"].Trim();
            }
            if (Request.QueryString["size"] != null)
            {
                strSize = Request.QueryString["size"].Trim();
            }
            if (Request.QueryString["Page"] != null)
            {
                Page = Request.QueryString["Page"].ToInt();
            }
            // Filter: floor
            if (Request.QueryString["floor"] != null)
            {
                floor = Request.QueryString["floor"].ToInt();
            }
            // Filter: row
            if (Request.QueryString["row"] != null)
            {
                row = Request.QueryString["row"].ToInt();
            }
            // Filter: shelf
            if (Request.QueryString["shelf"] != null)
            {
                shelf = Request.QueryString["shelf"].ToInt();
            }
            // Filter: floorShelf
            if (Request.QueryString["floorShelf"] != null)
            {
                floorShelf = Request.QueryString["floorShelf"].ToInt();
            }

            txtSearchProduct.Text        = TextSearch;
            ddlColor.SelectedValue       = strColor;
            ddlSize.SelectedValue        = strSize;
            ddlCategory.SelectedValue    = CategoryID.ToString();
            ddlCreatedDate.SelectedValue = CreatedDate.ToString();
            ddlStockStatus.SelectedValue = StockStatus.ToString();
            // Drop down list floor
            loadFloor(floor);
            // Drop down list row
            loadRow(floor, row);
            // Drop down list shelf
            loadShelf(floor, shelf);
            // Drop down list floorShelf
            loadFloorShelf(floor, floorShelf);

            // Create order fileter
            var filter = new ProductFilterModel()
            {
                category    = CategoryID,
                search      = UnSign.convert(TextSearch),
                color       = strColor,
                size        = strSize,
                stockStatus = StockStatus,
                productDate = CreatedDate,
                floor       = floor,
                row         = row,
                shelf       = shelf,
                floorShelf  = floorShelf
            };
            // Create pagination
            var page = new PaginationMetadataModel()
            {
                currentPage = Page,
                pageSize    = 20
            };
            List <ProductShelf> a = new List <ProductShelf>();

            a = ProductController.GetProductShelf(filter, ref page);

            pagingall(a, page);
        }
Beispiel #2
0
        public void LoadData()
        {
            string TextSearch  = "";
            string CreatedDate = "";
            int    CategoryID  = 0;
            int    StockStatus = 0;
            string strColor    = String.Empty;
            string strSize     = String.Empty;
            int    Page        = 1;

            if (Request.QueryString["textsearch"] != null)
            {
                TextSearch = Request.QueryString["textsearch"].Trim();
            }
            if (Request.QueryString["stockstatus"] != null)
            {
                StockStatus = Request.QueryString["stockstatus"].ToInt();
            }
            if (Request.QueryString["categoryid"] != null)
            {
                CategoryID = Request.QueryString["categoryid"].ToInt();
            }
            if (Request.QueryString["createddate"] != null)
            {
                CreatedDate = Request.QueryString["createddate"];
            }
            if (Request.QueryString["color"] != null)
            {
                strColor = Request.QueryString["color"].Trim();
            }
            if (Request.QueryString["size"] != null)
            {
                strSize = Request.QueryString["size"].Trim();
            }
            if (Request.QueryString["Page"] != null)
            {
                Page = Request.QueryString["Page"].ToInt();
            }

            txtSearchProduct.Text        = TextSearch;
            ddlColor.SelectedValue       = strColor;
            ddlSize.SelectedValue        = strSize;
            ddlCategory.SelectedValue    = CategoryID.ToString();
            ddlCreatedDate.SelectedValue = CreatedDate.ToString();
            ddlStockStatus.SelectedValue = StockStatus.ToString();

            // Create order fileter
            var filter = new ProductFilterModel()
            {
                category    = CategoryID,
                search      = UnSign.convert(TextSearch),
                color       = strColor,
                size        = strSize,
                stockStatus = StockStatus,
                productDate = CreatedDate
            };
            // Create pagination
            var page = new PaginationMetadataModel()
            {
                currentPage = Page,
                pageSize    = 24
            };
            List <Product> a = new List <Product>();

            a = ProductController.GetAllProduct(filter, ref page);

            pagingall(a, page);
        }