Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("StatisticsProduct", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "Id";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text        = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text        = RequestHelper.GetQueryString <string>("BrandID");
                Name.Text           = RequestHelper.GetQueryString <string>("Name");
                StorageAnalyse.Text = RequestHelper.GetQueryString <string>("StorageAnalyse");

                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.IsSale         = (int)BoolType.True;
                productSearch.Name           = RequestHelper.GetQueryString <string>("Name");
                productSearch.ClassId        = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId        = RequestHelper.GetQueryString <int>("BrandID");
                productSearch.StorageAnalyse = RequestHelper.GetQueryString <int>("StorageAnalyse");
                List <ProductInfo> productList = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count);
                BindControl(productList, RecordList, MyPager);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadProduct", PowerCheckType.Single);

                ClassID.DataSource     = ProductClassBLL.ReadNamedList();
                ClassID.DataTextField  = "Name";
                ClassID.DataValueField = "ID";
                ClassID.DataBind();
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text = RequestHelper.GetQueryString <string>("BrandID");
                Key.Text     = RequestHelper.GetQueryString <string>("Key");

                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.IsSale       = (int)BoolType.True;
                productSearch.IsDelete     = 0;//未删除的
                productSearch.StandardType = (int)ProductStandardType.No;
                productSearch.Key          = RequestHelper.GetQueryString <string>("Key");
                productSearch.ClassId      = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId      = RequestHelper.GetQueryString <int>("BrandID");
                BindControl(ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count), RecordList, MyPager);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadProduct", PowerCheckType.Single);
                RegionID.DataSource = RegionBLL.ReadRegionUnlimitClass();
                RegionID.ClassID    = "|1|27|607|";
                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
                Key.Text          = RequestHelper.GetQueryString <string>("Key");
                StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");
                IsSpecial.Text    = RequestHelper.GetQueryString <string>("IsSpecial");
                IsNew.Text        = RequestHelper.GetQueryString <string>("IsNew");
                IsHot.Text        = RequestHelper.GetQueryString <string>("IsHot");
                IsTop.Text        = RequestHelper.GetQueryString <string>("IsTop");

                List <ProductInfo> productList   = new List <ProductInfo>();
                ProductSearchInfo  productSearch = new ProductSearchInfo();
                productSearch.Key          = RequestHelper.GetQueryString <string>("Key");
                productSearch.ClassId      = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId      = RequestHelper.GetQueryString <int>("BrandID");
                productSearch.IsSpecial    = RequestHelper.GetQueryString <int>("IsSpecial");
                productSearch.IsNew        = RequestHelper.GetQueryString <int>("IsNew");
                productSearch.IsHot        = RequestHelper.GetQueryString <int>("IsHot");
                productSearch.IsSale       = (int)BoolType.True;
                productSearch.IsTop        = RequestHelper.GetQueryString <int>("IsTop");
                productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                productSearch.EndAddDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                productSearch.IsDelete     = 0;//没有逻辑删除的商品
                PageSize           = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]);
                AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString();
                productList        = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count);

                BindControl(productList, RecordList, MyPager);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                FatherID.DataSource     = ProductClassBLL.ReadNamedList();
                FatherID.DataTextField  = "Name";
                FatherID.DataValueField = "ID";
                FatherID.DataBind();
                FatherID.Items.Insert(0, new ListItem("作为最大类", "0"));
                //foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                //{
                //    FatherID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                //}
                //FatherID.Items.Insert(0, new ListItem("作为最大类", "0"));

                ProductType.DataSource     = ProductTypeBLL.ReadList();
                ProductType.DataTextField  = "Name";
                ProductType.DataValueField = "ID";
                ProductType.DataBind();
                ProductType.Items.Insert(0, new ListItem("请选择类型", "0"));

                int productClassID = RequestHelper.GetQueryString <int>("ID");
                int fatherID       = RequestHelper.GetQueryString <int>("FatherID");
                if (productClassID != int.MinValue)
                {
                    CheckAdminPower("ReadProductClass", PowerCheckType.Single);
                    ProductClassInfo productClass = ProductClassBLL.Read(productClassID);
                    FatherID.Text     = productClass.ParentId.ToString();
                    OrderID.Text      = productClass.OrderId.ToString();
                    ClassName.Text    = productClass.Name;
                    Keywords.Text     = productClass.Keywords;
                    Description.Value = productClass.Remark;
                    Photo.Text        = productClass.Photo;
                    ProductType.Text  = productClass.ProductTypeId.ToString();

                    EnClassName.Text = productClass.EnClassName;
                    PageTitle.Text   = productClass.PageTitle;
                    PageKeyWord.Text = productClass.PageKeyWord;
                    PageSummary.Text = productClass.PageSummary;
                }
                else
                {
                    FatherID.Text = fatherID.ToString();
                }
            }
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    RelationClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                RelationClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                List <ProductBrandInfo> productBrandList = ProductBrandBLL.ReadList();
                RelationBrandID.DataSource     = productBrandList;
                RelationBrandID.DataTextField  = "Name";
                RelationBrandID.DataValueField = "ID";
                RelationBrandID.DataBind();
                RelationBrandID.Items.Insert(0, new ListItem("选择品牌", string.Empty));
            }
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("StatisticsSale", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "Id";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
                Name.Text         = RequestHelper.GetQueryString <string>("Name");
                StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");
                UserName.Text     = RequestHelper.GetQueryString <string>("UserName");
                OrderNumber.Text  = RequestHelper.GetQueryString <string>("OrderNumber");

                ProductSearchInfo productSearch = new ProductSearchInfo();
                OrderSearchInfo   orderSearch   = new OrderSearchInfo();
                productSearch.IsSale      = (int)BoolType.True;
                productSearch.Name        = RequestHelper.GetQueryString <string>("Name");
                productSearch.ClassId     = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId     = RequestHelper.GetQueryString <int>("BrandID");
                productSearch.InProductId = RequestHelper.GetQueryString <string>("ProductID");
                orderSearch.StartAddDate  = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                orderSearch.EndAddDate    = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                orderSearch.UserName      = RequestHelper.GetQueryString <string>("UserName");
                orderSearch.OrderNumber   = RequestHelper.GetQueryString <string>("OrderNumber");
                BindControl(OrderDetailBLL.StatisticsSaleDetail(CurrentPage, PageSize, orderSearch, productSearch, ref Count), RecordList, MyPager);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadProduct", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
                Key.Text          = RequestHelper.GetQueryString <string>("Key");
                StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");


                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.Key          = RequestHelper.GetQueryString <string>("Key");
                productSearch.ClassId      = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId      = RequestHelper.GetQueryString <int>("BrandID");
                productSearch.IsSale       = 2;//草稿
                productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                productSearch.EndAddDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                productSearch.IsDelete     = 0;//没有逻辑删除的商品
                PageSize = 10;
                List <ProductInfo> productList = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count);
                BindControl(productList, RecordList, MyPager);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 绑定商品分类,品牌,商品类型,规格
        /// </summary>
        protected void BindClassBrandAttributeClassStandardType()
        {
            List <ProductClassInfo> productClassList = ProductClassBLL.ReadNamedList();

            foreach (ProductClassInfo productClass in productClassList)
            {
                RelationClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
            }
            RelationClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

            foreach (ProductClassInfo productClass in productClassList)
            {
                AccessoryClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
            }
            AccessoryClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));


            foreach (ArticleClassInfo articleClass in ArticleClassBLL.ReadNamedList())
            {
                ArticleClassID.Items.Add(new ListItem(articleClass.Name, "|" + articleClass.Id + "|"));
            }
            ArticleClassID.Items.Insert(0, new ListItem("请选择", string.Empty));
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("StatisticsProduct", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.IsSale  = (int)BoolType.True;
                productSearch.Name    = RequestHelper.GetQueryString <string>("Name");
                productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID");
                string productOrderType = RequestHelper.GetQueryString <string>("ProductOrderType");
                productOrderType = (productOrderType == string.Empty) ? "SellCount" : productOrderType;
                productSearch.ProductOrderType = productOrderType;
                ClassID.Text          = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text          = RequestHelper.GetQueryString <string>("BrandID");
                Name.Text             = RequestHelper.GetQueryString <string>("Name");
                StartDate.Text        = RequestHelper.GetQueryString <string>("StartDate");
                EndDate.Text          = RequestHelper.GetQueryString <string>("EndDate");
                ProductOrderType.Text = productOrderType;
                DateTime startDate = RequestHelper.GetQueryString <DateTime>("StartDate");
                DateTime endDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndDate"));
                BindControl(ProductBLL.StatisticsProductSale(CurrentPage, PageSize, productSearch, ref Count, startDate, endDate), RecordList, MyPager);
            }
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadProduct", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
                Key.Text          = RequestHelper.GetQueryString <string>("Key");
                StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");


                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.Key          = RequestHelper.GetQueryString <string>("Key");
                productSearch.ClassId      = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId      = RequestHelper.GetQueryString <int>("BrandID");
                productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                productSearch.EndAddDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                productSearch.IsDelete     = 1;//逻辑删除的商品
                //PageSize = 10;
                PageSize           = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]);
                AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString();
                List <ProductInfo> productList = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count);
                BindControl(productList, RecordList, MyPager);

                var pid = RequestHelper.GetQueryString <int>("ID");

                switch (RequestHelper.GetQueryString <string>("Action"))
                {
                case "Recover":
                    if (pid > 0)
                    {
                        ProductBLL.Recover(pid);
                        AdminLogBLL.Add(ShopLanguage.ReadLanguage("RecoverRecord"), ShopLanguage.ReadLanguage("Product"), pid);
                        ScriptHelper.Alert(ShopLanguage.ReadLanguage("RecoverOK"), Request.UrlReferrer.ToString());
                    }
                    break;

                case "Delete":
                    if (pid > 0)
                    {
                        ProductBLL.Delete(pid);
                        AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecordCompletely"), ShopLanguage.ReadLanguage("Product"), pid);
                        ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteCompletelyOK"), Request.UrlReferrer.ToString());
                    }
                    break;

                default:
                    break;
                }
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ProductBatchEdit", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                string action = RequestHelper.GetQueryString <string>("Action");
                switch (action)
                {
                case "UnionEdit":
                    UnionEdit();
                    break;

                case "search":
                    ProductSearchInfo productSearch = new ProductSearchInfo();
                    productSearch.Name         = RequestHelper.GetQueryString <string>("Name");
                    productSearch.ClassId      = RequestHelper.GetQueryString <string>("ClassID");
                    productSearch.BrandId      = RequestHelper.GetQueryString <int>("BrandID");
                    productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                    productSearch.EndAddDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                    productSearch.IsSale       = (int)BoolType.True;
                    ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
                    BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
                    Name.Text         = RequestHelper.GetQueryString <string>("Name");
                    StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                    EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");
                    BindControl(ProductBLL.SearchList(productSearch), RecordList);
                    break;

                default:
                    break;
                }

                userGradeList = UserGradeBLL.ReadList();
                foreach (UserGradeInfo userGrade in userGradeList)
                {
                    if (userGradeIDList == string.Empty)
                    {
                        userGradeIDList   = userGrade.Id.ToString();
                        userGradeNameList = userGrade.Name;
                    }
                    else
                    {
                        userGradeIDList   += "," + userGrade.Id.ToString();
                        userGradeNameList += "," + userGrade.Name;
                    }
                }
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ProductBatchEdit", PowerCheckType.Single);

                string action = RequestHelper.GetQueryString <string>("Action");
                if (action == "SingleEdit")
                {
                    SingleEdit();
                }

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.Name         = RequestHelper.GetQueryString <string>("Name");
                productSearch.ClassId      = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId      = RequestHelper.GetQueryString <int>("BrandID");;
                productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                productSearch.EndAddDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                productSearch.IsSale       = (int)BoolType.True;
                ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
                Name.Text         = RequestHelper.GetQueryString <string>("Name");
                StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");
                productList       = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count);
                BindControl(MyPager);

                string strProductID = string.Empty;
                foreach (ProductInfo product in productList)
                {
                    if (strProductID == string.Empty)
                    {
                        strProductID = product.Id.ToString();
                    }
                    else
                    {
                        strProductID += "," + product.Id.ToString();
                    }
                }
                userGradeList = UserGradeBLL.ReadList();
                foreach (UserGradeInfo userGrade in userGradeList)
                {
                    if (userGradeIDList == string.Empty)
                    {
                        userGradeIDList   = userGrade.Id.ToString();
                        userGradeNameList = userGrade.Name;
                    }
                    else
                    {
                        userGradeIDList   += "," + userGrade.Id.ToString();
                        userGradeNameList += "," + userGrade.Name;
                    }
                }
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadProduct", PowerCheckType.Single);

                foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                }
                ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

                BrandID.DataSource     = ProductBrandBLL.ReadList();
                BrandID.DataTextField  = "Name";
                BrandID.DataValueField = "ID";
                BrandID.DataBind();
                BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

                ClassID.Text       = RequestHelper.GetQueryString <string>("ClassID");
                BrandID.Text       = RequestHelper.GetQueryString <string>("BrandID");
                Key.Text           = RequestHelper.GetQueryString <string>("Key");
                StartAddDate.Text  = RequestHelper.GetQueryString <string>("StartAddDate");
                EndAddDate.Text    = RequestHelper.GetQueryString <string>("EndAddDate");
                IsSpecial.Text     = RequestHelper.GetQueryString <string>("IsSpecial");
                IsNew.Text         = RequestHelper.GetQueryString <string>("IsNew");
                IsHot.Text         = RequestHelper.GetQueryString <string>("IsHot");
                IsTop.Text         = RequestHelper.GetQueryString <string>("IsTop");
                ProductNumber.Text = RequestHelper.GetQueryString <string>("ProductNumber");

                #region 销量 价格
                decimal _LowerSalePrice  = RequestHelper.GetQueryString <decimal>("LowerSalePrice");
                decimal _UpperSalePrice  = RequestHelper.GetQueryString <decimal>("UpperSalePrice");
                int     _LowerOrderCount = RequestHelper.GetQueryString <int>("LowerOrderCount");
                int     _UpperOrderCount = RequestHelper.GetQueryString <int>("UpperOrderCount");
                if (_LowerSalePrice >= 0 && _UpperSalePrice >= 0)
                {
                    this.LowerSalePrice.Text = _LowerSalePrice < _UpperSalePrice?_LowerSalePrice.ToString() : _UpperSalePrice.ToString();

                    this.UpperSalePrice.Text = _LowerSalePrice < _UpperSalePrice?_UpperSalePrice.ToString() : _LowerSalePrice.ToString();
                }
                if (_LowerOrderCount >= 0 && _UpperOrderCount >= 0)
                {
                    this.LowerOrderCount.Text = _LowerOrderCount < _UpperOrderCount?_LowerOrderCount.ToString() : _UpperOrderCount.ToString();

                    this.UpperOrderCount.Text = _LowerOrderCount < _UpperOrderCount?_UpperOrderCount.ToString() : _LowerOrderCount.ToString();
                }
                #endregion

                List <ProductInfo> productList   = new List <ProductInfo>();
                ProductSearchInfo  productSearch = new ProductSearchInfo();
                //productSearch.Key = RequestHelper.GetQueryString<string>("Key");
                productSearch.Name          = RequestHelper.GetQueryString <string>("Key");
                productSearch.ProductNumber = RequestHelper.GetQueryString <string>("ProductNumber");
                productSearch.ClassId       = RequestHelper.GetQueryString <string>("ClassID");
                productSearch.BrandId       = RequestHelper.GetQueryString <int>("BrandID");
                productSearch.IsSpecial     = RequestHelper.GetQueryString <int>("IsSpecial");
                productSearch.IsNew         = RequestHelper.GetQueryString <int>("IsNew");
                productSearch.IsHot         = RequestHelper.GetQueryString <int>("IsHot");
                productSearch.IsSale        = (int)BoolType.True;
                productSearch.IsTop         = RequestHelper.GetQueryString <int>("IsTop");
                productSearch.StartAddDate  = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                productSearch.EndAddDate    = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                productSearch.IsDelete      = 0;//没有逻辑删除的商品
                if (_LowerSalePrice >= 0 && _UpperSalePrice >= 0)
                {
                    productSearch.LowerSalePrice = _LowerSalePrice < _UpperSalePrice ? _LowerSalePrice : _UpperSalePrice;
                    productSearch.UpperSalePrice = _LowerSalePrice < _UpperSalePrice ? _UpperSalePrice : _LowerSalePrice;
                }
                if (_LowerOrderCount >= 0 && _UpperOrderCount >= 0)
                {
                    productSearch.LowerOrderCount = _LowerOrderCount < _UpperOrderCount ? _LowerOrderCount : _UpperOrderCount;
                    productSearch.UpperOrderCount = _LowerOrderCount < _UpperOrderCount ? _UpperOrderCount : _LowerOrderCount;
                }
                string productOrderType = RequestHelper.GetQueryString <string>("ProductOrderType");
                if (!string.IsNullOrEmpty(productOrderType))
                {
                    productSearch.ProductOrderType = productOrderType;
                }
                string orderType = RequestHelper.GetQueryString <string>("OrderType");
                productSearch.OrderType = orderType == "Asc"? OrderType.Asc:OrderType.Desc;
                PageSize           = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]);
                AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString();
                productList        = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count);

                BindControl(productList, RecordList, MyPager);


                switch (RequestHelper.GetQueryString <string>("ActionProduct"))
                {
                case "OffSaleProduct":
                    int Id = RequestHelper.GetQueryString <int>("ID");
                    if (Id > 0)
                    {
                        CheckAdminPower("OffSaleProduct", PowerCheckType.Single);
                        var product = ProductBLL.Read(Id);
                        if (product.IsSale == (int)BoolType.True)
                        {
                            product.IsSale = (int)BoolType.False;
                            ProductBLL.Update(product);
                            AdminLogBLL.Add(ShopLanguage.ReadLanguage("OffSaleRecord"), ShopLanguage.ReadLanguage("Product"), Id.ToString());
                            ScriptHelper.Alert(ShopLanguage.ReadLanguage("OffSaleOK"), Request.UrlReferrer.ToString());
                        }
                    }
                    break;

                case "DeleteProduct":
                    Id = RequestHelper.GetQueryString <int>("ID");
                    if (Id > 0)
                    {
                        CheckAdminPower("DeleteProduct", PowerCheckType.Single);

                        ProductBLL.DeleteLogically(Id);
                        AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("Product"), Id.ToString());
                        ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), Request.UrlReferrer.ToString());
                    }
                    break;

                case "ModifyPrice":
                    ModifyPrice();
                    break;

                case "ModifyStorage":
                    ModifyStorage();
                    break;

                default:
                    break;
                }
            }
        }