Exemplo 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);
            }
        }
Exemplo 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);
            }
        }
Exemplo 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);
            }
        }
Exemplo n.º 4
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);
            }
        }
Exemplo n.º 5
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);
            }
        }
Exemplo n.º 6
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);
            }
        }
Exemplo n.º 7
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;
                }
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindClassBrandAttributeClassStandardType();
                BrandID.Items.Insert(0, new ListItem("请选择", "0"));
                RelationBrandID.Items.Insert(0, new ListItem("请选择", "0"));
                AccessoryBrandID.Items.Insert(0, new ListItem("请选择", "0"));

                string classId = RequestHelper.GetQueryString <string>("classId");
                productID = RequestHelper.GetQueryString <int>("ID");
                _brandId  = RequestHelper.GetQueryString <int>("BrandId");
                //ProductClass.DataSource = ProductClassBLL.ReadUnlimitClassList();
                if (productID <= 0)             //添加商品
                {
                    DraftButton.Visible = true; //添加商品可保存草稿
                    if (string.IsNullOrEmpty(classId))
                    {
                        Response.Redirect("/admin/productaddinit.aspx");
                    }
                    else
                    {
                        LastClassID = ProductClassBLL.GetLastClassID(classId);
                        proTypeID   = ProductClassBLL.GetProductClassType(LastClassID);
                        ProductTypeInfo aci = ProductTypeBLL.Read(proTypeID);
                        if (aci.Id > 0)
                        {
                            string[] strArray = aci.BrandIds.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                            int[]    intArray;

                            intArray         = Array.ConvertAll <string, int>(strArray, s => int.Parse(s));
                            productBrandList = ProductBrandBLL.ReadList(intArray);
                        }

                        if (productBrandList.Count > 0)
                        {
                            BrandID.DataSource     = productBrandList;
                            BrandID.DataTextField  = "Name";
                            BrandID.DataValueField = "ID";
                            BrandID.DataBind();
                            BrandID.Items.Insert(0, new ListItem("请选择", "0"));
                            if (_brandId > 0)
                            {
                                BrandID.Text = _brandId.ToString();
                            }

                            RelationBrandID.DataSource     = productBrandList;
                            RelationBrandID.DataTextField  = "Name";
                            RelationBrandID.DataValueField = "ID";
                            RelationBrandID.DataBind();
                            RelationBrandID.Items.Insert(0, new ListItem("请选择", "0"));

                            AccessoryBrandID.DataSource     = productBrandList;
                            AccessoryBrandID.DataTextField  = "Name";
                            AccessoryBrandID.DataValueField = "ID";
                            AccessoryBrandID.DataBind();
                            AccessoryBrandID.Items.Insert(0, new ListItem("请选择", "0"));
                        }
                        //商品分类对应的属性列表
                        attributeList = ProductTypeAttributeBLL.ReadList(proTypeID);
                        //商品类型对应的规格列表
                        standardList = ProductTypeStandardBLL.ReadList(proTypeID);
                        //添加商品时自动查找所属分类的售后服务
                        Remark.Value = GetProductClassRemark(classId);
                    }
                }
                else//修改商品
                {
                    CheckAdminPower("ReadProduct", PowerCheckType.Single);
                    DraftButton.Visible = false;//修改商品不可保存草稿
                    ProductInfo product = ProductBLL.Read(productID);
                    pageProduct = product;
                    //如果修改了分类则标识isupdate
                    if (!string.IsNullOrEmpty(classId) && product.ClassId != classId)
                    {
                        isUpdate = 1;
                    }

                    YejiRatio.Text = product.YejiRatio;

                    Name.Text      = product.Name;
                    SellPoint.Text = product.SellPoint;
                    Name.Attributes.Add("style", "color:" + product.Color);
                    color              = product.Color;
                    FontStyle.Text     = product.FontStyle;
                    ProductNumber.Text = product.ProductNumber;
                    //ProductClass.ClassID = product.ClassId;
                    Keywords.Text          = product.Keywords;
                    MarketPrice.Text       = product.MarketPrice.ToString();
                    SendPoint.Text         = product.SendPoint.ToString();
                    Photo.Text             = product.Photo;
                    Summary.Text           = product.Summary;
                    Introduction.Value     = product.Introduction1;
                    Weight.Text            = product.Weight.ToString();
                    GroupPrice.Text        = product.GroupPrice.ToString();
                    GroupQuantity.Text     = product.GroupQuantity.ToString();
                    GroupPhoto.Text        = product.GroupPhoto;
                    VirtualOrderCount.Text = product.VirtualOrderCount.ToString();

                    if (Convert.ToBoolean(product.IsSpecial))
                    {
                        IsSpecial.Checked = true;
                    }
                    if (Convert.ToBoolean(product.IsNew))
                    {
                        IsNew.Checked = true;
                    }
                    if (Convert.ToBoolean(product.IsHot))
                    {
                        IsHot.Checked = true;
                    }
                    if (Convert.ToBoolean(product.IsSale))
                    {
                        IsSale.Checked = true;
                    }
                    else
                    {
                        IsSale.Checked = false;
                    }
                    if (Convert.ToBoolean(product.IsTop))
                    {
                        IsTop.Checked = true;
                    }
                    if (Convert.ToBoolean(product.AllowComment))
                    {
                        AllowComment.Checked = true;
                    }
                    else
                    {
                        AllowComment.Checked = false;
                    }
                    TotalStorageCount.Text = product.TotalStorageCount.ToString();

                    LastClassID    = ProductClassBLL.GetLastClassID(product.ClassId);
                    this.proTypeID = ProductClassBLL.GetProductClassType(LastClassID);
                    //商品分类对应的属性列表
                    //attributeList = ProductTypeAttributeBLL.JoinAttribute(ProductClassBLL.Read(ProductClassBLL.GetLastClassID(product.ClassId)).ProductTypeId, productID);
                    attributeList        = ProductTypeAttributeBLL.JoinAttribute(this.proTypeID, productID);
                    Repeater1.DataSource = attributeList;
                    Repeater1.DataBind();
                    //商品类型对应的规格列表
                    standardList       = ProductTypeStandardBLL.ReadList(this.proTypeID);
                    standardRecordList = ProductTypeStandardRecordBLL.ReadListByProduct(product.Id, product.StandardType);
                    if (product.StandardType == 1)
                    {
                        if (standardRecordList.Count > 0)
                        {
                            TotalStorageCount.ReadOnly = true;
                        }
                    }
                    if (string.IsNullOrEmpty(classId))
                    {
                        LastClassID = ProductClassBLL.GetLastClassID(product.ClassId);
                    }
                    else
                    {
                        LastClassID = ProductClassBLL.GetLastClassID(classId);
                    }
                    int             proTypeID = ProductClassBLL.GetProductClassType(LastClassID);
                    ProductTypeInfo aci       = ProductTypeBLL.Read(proTypeID);
                    if (aci.Id > 0)
                    {
                        string[] strArray = aci.BrandIds.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                        int[]    intArray;

                        intArray         = Array.ConvertAll <string, int>(strArray, s => int.Parse(s));
                        productBrandList = ProductBrandBLL.ReadList(intArray);
                    }

                    if (productBrandList.Count > 0)
                    {
                        BrandID.DataSource     = productBrandList;
                        BrandID.DataTextField  = "Name";
                        BrandID.DataValueField = "ID";
                        BrandID.DataBind();
                        BrandID.Items.Insert(0, new ListItem("请选择", "0"));

                        RelationBrandID.DataSource     = productBrandList;
                        RelationBrandID.DataTextField  = "Name";
                        RelationBrandID.DataValueField = "ID";
                        RelationBrandID.DataBind();
                        RelationBrandID.Items.Insert(0, new ListItem("请选择", "0"));

                        AccessoryBrandID.DataSource     = productBrandList;
                        AccessoryBrandID.DataTextField  = "Name";
                        AccessoryBrandID.DataValueField = "ID";
                        AccessoryBrandID.DataBind();
                        AccessoryBrandID.Items.Insert(0, new ListItem("请选择", "0"));
                    }
                    if (_brandId > 0)
                    {
                        BrandID.Text = _brandId.ToString();
                    }
                    else
                    {
                        BrandID.Text = product.BrandId.ToString();
                    }

                    sendCount    = product.SendCount;
                    OrderID.Text = product.OrderId.ToString();

                    SalePrice.Text            = product.SalePrice.ToString();
                    Units.Text                = product.Unit;
                    Introduction_Mobile.Value = product.Introduction1_Mobile;
                    Sub_Title.Text            = product.SubTitle;
                    LowerCount.Text           = product.LowerCount.ToString();

                    Remark.Value = product.Remark;

                    BindRelation(product);
                    productPhotoList = ProductPhotoBLL.ReadList(productID, 0);
                }
                //userGradeList = UserGradeBLL.JoinUserGrade(productID);
            }
        }
Exemplo n.º 9
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;
                    }
                }
            }
        }
Exemplo n.º 10
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;
                    }
                }
            }
        }
Exemplo 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("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;
                }
            }
        }