Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.UserGrade.DataSource     = UserGradeBLL.ReadUserGradeCacheList();
         this.UserGrade.DataTextField  = "Name";
         this.UserGrade.DataValueField = "ID";
         this.UserGrade.DataBind();
         this.RegionID.DataSource = RegionBLL.ReadRegionUnlimitClass();
         int queryString = RequestHelper.GetQueryString <int>("ID");
         if (queryString != -2147483648)
         {
             base.CheckAdminPower("ReadFavorableActivity", PowerCheckType.Single);
             this.favorableActivity = FavorableActivityBLL.ReadFavorableActivity(queryString);
             this.Photo.Text        = this.favorableActivity.Photo;
             this.Name.Text         = this.favorableActivity.Name;
             this.Content.Text      = this.favorableActivity.Content;
             this.StartDate.Text    = this.favorableActivity.StartDate.ToString("yyyy-MM-dd");
             this.EndDate.Text      = this.favorableActivity.EndDate.ToString("yyyy-MM-dd");
             ControlHelper.SetCheckBoxListValue(this.UserGrade, this.favorableActivity.UserGrade);
             this.OrderProductMoney.Text = this.favorableActivity.OrderProductMoney.ToString();
             this.RegionID.ClassIDList   = this.favorableActivity.RegionID;
             this.ReduceMoney.Text       = this.favorableActivity.ReduceMoney.ToString();
             this.ReduceDiscount.Text    = this.favorableActivity.ReduceDiscount.ToString();
             if (this.favorableActivity.GiftID != string.Empty)
             {
                 GiftSearchInfo gift = new GiftSearchInfo();
                 gift.InGiftID = this.favorableActivity.GiftID;
                 this.giftList = GiftBLL.SearchGiftList(gift);
             }
         }
     }
 }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         base.CheckAdminPower("ReadUserGrade", PowerCheckType.Single);
         base.BindControl(UserGradeBLL.ReadUserGradeCacheList(), this.RecordList);
     }
 }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         base.CheckAdminPower("ProductBatchEdit", PowerCheckType.Single);
         foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList())
         {
             this.ClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|"));
         }
         this.ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));
         this.BrandID.DataSource     = ProductBrandBLL.ReadProductBrandCacheList();
         this.BrandID.DataTextField  = "Name";
         this.BrandID.DataValueField = "ID";
         this.BrandID.DataBind();
         this.BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));
         string queryString = RequestHelper.GetQueryString <string>("Action");
         if (queryString != null)
         {
             if (!(queryString == "UnionEdit"))
             {
                 if (queryString == "search")
                 {
                     ProductSearchInfo productSearch = new ProductSearchInfo();
                     productSearch.Name         = RequestHelper.GetQueryString <string>("Name");
                     productSearch.ClassID      = RequestHelper.GetQueryString <string>("ClassID");
                     productSearch.InBrandID    = RequestHelper.GetQueryString <string>("BrandID");
                     productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate");
                     productSearch.EndAddDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
                     this.ClassID.Text          = RequestHelper.GetQueryString <string>("ClassID");
                     this.BrandID.Text          = RequestHelper.GetQueryString <string>("BrandID");
                     this.Name.Text             = RequestHelper.GetQueryString <string>("Name");
                     this.StartAddDate.Text     = RequestHelper.GetQueryString <string>("StartAddDate");
                     this.EndAddDate.Text       = RequestHelper.GetQueryString <string>("EndAddDate");
                     base.BindControl(ProductBLL.SearchProductList(productSearch), this.RecordList);
                 }
             }
             else
             {
                 this.UnionEdit();
             }
         }
         this.userGradeList = UserGradeBLL.ReadUserGradeCacheList();
         foreach (UserGradeInfo info3 in this.userGradeList)
         {
             if (this.userGradeIDList == string.Empty)
             {
                 this.userGradeIDList   = info3.ID.ToString();
                 this.userGradeNameList = info3.Name;
             }
             else
             {
                 this.userGradeIDList   = this.userGradeIDList + "," + info3.ID.ToString();
                 this.userGradeNameList = this.userGradeNameList + "," + info3.Name;
             }
         }
     }
 }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.UserGrade.DataSource     = UserGradeBLL.ReadUserGradeCacheList();
         this.UserGrade.DataValueField = "ID";
         this.UserGrade.DataTextField  = "Name";
         this.UserGrade.DataBind();
         this.Key.DataSource     = EmailContentHelper.ReadCommonEmailContentList();
         this.Key.DataTextField  = "EmailTitle";
         this.Key.DataValueField = "Key";
         this.Key.DataBind();
     }
 }
Пример #5
0
        protected void HanderMemberPrice(int productID)
        {
            if (productID > 0)
            {
                MemberPriceBLL.DeleteMemberPriceByProductID(productID.ToString());
            }
            List <UserGradeInfo> list = UserGradeBLL.ReadUserGradeCacheList();
            decimal form = -1M;

            foreach (UserGradeInfo info in list)
            {
                form = RequestHelper.GetForm <decimal>("MemberPrice" + info.ID);
                if (form != -1M)
                {
                    MemberPriceInfo memberPrice = new MemberPriceInfo();
                    memberPrice.ProductID = productID;
                    memberPrice.GradeID   = info.ID;
                    memberPrice.Price     = form;
                    MemberPriceBLL.AddMemberPrice(memberPrice);
                }
            }
        }
Пример #6
0
        protected void SingleEdit()
        {
            int         queryString = RequestHelper.GetQueryString <int>("ProductID");
            ProductInfo product     = ProductBLL.ReadProduct(queryString);

            product.ProductNumber     = RequestHelper.GetQueryString <string>("ProductNumber");
            product.Weight            = RequestHelper.GetQueryString <int>("Weight");
            product.MarketPrice       = RequestHelper.GetQueryString <decimal>("MarketPrice");
            product.SendPoint         = RequestHelper.GetQueryString <int>("SendPoint");
            product.TotalStorageCount = RequestHelper.GetQueryString <int>("TotalStorageCount");
            product.LowerCount        = RequestHelper.GetQueryString <int>("LowerCount");
            product.UpperCount        = RequestHelper.GetQueryString <int>("UpperCount");
            ProductBLL.UpdateProduct(product);
            string str = RequestHelper.GetQueryString <string>("MemberPrice");

            if (str != string.Empty)
            {
                string[] strArray = str.Split(new char[] { ',' });
                MemberPriceBLL.DeleteMemberPriceByProductID(queryString.ToString());
                List <UserGradeInfo> list = UserGradeBLL.ReadUserGradeCacheList();
                decimal num2  = -1M;
                int     index = 0;
                foreach (UserGradeInfo info2 in list)
                {
                    num2 = Convert.ToDecimal(strArray[index]);
                    if (num2 != -1M)
                    {
                        MemberPriceInfo memberPrice = new MemberPriceInfo();
                        memberPrice.ProductID = queryString;
                        memberPrice.GradeID   = info2.ID;
                        memberPrice.Price     = num2;
                        MemberPriceBLL.AddMemberPrice(memberPrice);
                    }
                    index++;
                }
            }
            ResponseHelper.Write(ShopLanguage.ReadLanguage("UpdateOK"));
            ResponseHelper.End();
        }
Пример #7
0
        protected override void PageLoad()
        {
            base.PageLoad();
            int queryString = RequestHelper.GetQueryString <int>("ID");

            this.product = ProductBLL.ReadProduct(queryString);
            if (this.product.IsSale == 0)
            {
                ScriptHelper.Alert("该产品未上市,不能查看");
            }
            ProductBLL.ChangeProductViewCount(queryString, 1);
            this.userGradeList      = UserGradeBLL.ReadUserGradeCacheList();
            this.memberPriceList    = MemberPriceBLL.ReadMemberPriceByProduct(queryString);
            this.currentMemberPrice = (this.product.MarketPrice * UserGradeBLL.ReadUserGradeCache(base.GradeID).Discount) / 100M;
            foreach (MemberPriceInfo info in this.memberPriceList)
            {
                if (info.GradeID == base.GradeID)
                {
                    this.currentMemberPrice = info.Price;
                    break;
                }
            }
            this.currentMemberPrice = Math.Round(this.currentMemberPrice, 2);
            ProductPhotoInfo item = new ProductPhotoInfo();

            item.Name  = this.product.Name;
            item.Photo = this.product.Photo;
            this.productPhotoList.Add(item);
            this.productPhotoList.AddRange(ProductPhotoBLL.ReadProductPhotoByProduct(queryString));
            this.strHistoryProduct = base.Server.UrlDecode(CookiesHelper.ReadCookieValue("HistoryProduct"));
            string strProductID = (this.product.RelationProduct + "," + this.product.Accessory + "," + this.strHistoryProduct).Replace(",,", ",");

            if (strProductID.StartsWith(","))
            {
                strProductID = strProductID.Substring(1);
            }
            if (strProductID.EndsWith(","))
            {
                strProductID = strProductID.Substring(0, strProductID.Length - 1);
            }
            ProductSearchInfo productSearch = new ProductSearchInfo();

            productSearch.InProductID = strProductID;
            this.tempProductList      = ProductBLL.SearchProductList(productSearch);
            if (strProductID != string.Empty)
            {
                this.tempMemberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID);
            }
            this.attributeRecordList = AttributeRecordBLL.ReadAttributeRecordByProduct(queryString);
            TagsSearchInfo tags = new TagsSearchInfo();

            tags.ProductID       = queryString;
            this.productTagsList = TagsBLL.SearchTagsList(tags);
            if (this.product.RelationArticle != string.Empty)
            {
                ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                articleSearch.InArticleID = this.product.RelationArticle;
                this.productArticleList   = ArticleBLL.SearchArticleList(articleSearch);
            }
            this.standardRecordList = StandardRecordBLL.ReadStandardRecordByProduct(this.product.ID, this.product.StandardType);
            if ((this.standardRecordList.Count > 0) && (this.product.StandardType == 1))
            {
                string[] strArray = this.standardRecordList[0].StandardIDList.Split(new char[] { ',' });
                for (int i = 0; i < strArray.Length; i++)
                {
                    StandardInfo info6     = StandardBLL.ReadStandardCache(Convert.ToInt32(strArray[i]));
                    string[]     strArray2 = info6.ValueList.Split(new char[] { ',' });
                    string[]     strArray3 = info6.PhotoList.Split(new char[] { ',' });
                    string       str2      = string.Empty;
                    string       str3      = string.Empty;
                    for (int j = 0; j < strArray2.Length; j++)
                    {
                        foreach (StandardRecordInfo info7 in this.standardRecordList)
                        {
                            string[] strArray4 = info7.ValueList.Split(new char[] { ',' });
                            if (strArray2[j] == strArray4[i])
                            {
                                str2 = str2 + strArray2[j] + ",";
                                str3 = str3 + strArray3[j] + ",";
                                goto Label_043B;
                            }
                        }
                        Label_043B :;
                    }
                    if (str2 != string.Empty)
                    {
                        str2 = str2.Substring(0, str2.Length - 1);
                        str3 = str3.Substring(0, str3.Length - 1);
                    }
                    info6.ValueList = str2;
                    info6.PhotoList = str3;
                    this.standardList.Add(info6);
                }
                foreach (StandardRecordInfo info7 in this.standardRecordList)
                {
                    object standardRecordValueList = this.standardRecordValueList;
                    this.standardRecordValueList = string.Concat(new object[] { standardRecordValueList, info7.ProductID, ",", info7.ValueList, "|" });
                }
            }
            if (ShopConfig.ReadConfigInfo().ProductStorageType == 1)
            {
                this.leftStorageCount = this.product.TotalStorageCount - this.product.OrderCount;
            }
            else
            {
                this.leftStorageCount = this.product.ImportVirtualStorageCount;
            }
            base.Title       = this.product.Name;
            base.Keywords    = (this.product.Keywords == string.Empty) ? this.product.Name : this.product.Keywords;
            base.Description = (this.product.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(this.product.Introduction), 200) : this.product.Summary;
        }
Пример #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         base.CheckAdminPower("ProductBatchEdit", PowerCheckType.Single);
         if (RequestHelper.GetQueryString <string>("Action") == "SingleEdit")
         {
             this.SingleEdit();
         }
         foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList())
         {
             this.ClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|"));
         }
         this.ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));
         this.BrandID.DataSource     = ProductBrandBLL.ReadProductBrandCacheList();
         this.BrandID.DataTextField  = "Name";
         this.BrandID.DataValueField = "ID";
         this.BrandID.DataBind();
         this.BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));
         ProductSearchInfo product = new ProductSearchInfo();
         product.Name           = RequestHelper.GetQueryString <string>("Name");
         product.ClassID        = RequestHelper.GetQueryString <string>("ClassID");
         product.InBrandID      = RequestHelper.GetQueryString <string>("BrandID");
         product.StartAddDate   = RequestHelper.GetQueryString <DateTime>("StartAddDate");
         product.EndAddDate     = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate"));
         this.ClassID.Text      = RequestHelper.GetQueryString <string>("ClassID");
         this.BrandID.Text      = RequestHelper.GetQueryString <string>("BrandID");
         this.Name.Text         = RequestHelper.GetQueryString <string>("Name");
         this.StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate");
         this.EndAddDate.Text   = RequestHelper.GetQueryString <string>("EndAddDate");
         this.productList       = ProductBLL.SearchProductList(base.CurrentPage, base.PageSize, product, ref this.Count);
         base.BindControl(this.MyPager);
         string strProductID = string.Empty;
         foreach (ProductInfo info3 in this.productList)
         {
             if (strProductID == string.Empty)
             {
                 strProductID = info3.ID.ToString();
             }
             else
             {
                 strProductID = strProductID + "," + info3.ID.ToString();
             }
         }
         this.userGradeList   = UserGradeBLL.ReadUserGradeCacheList();
         this.memberPriceList = MemberPriceBLL.ReadMemberPriceByProduct(strProductID);
         foreach (UserGradeInfo info4 in this.userGradeList)
         {
             if (this.userGradeIDList == string.Empty)
             {
                 this.userGradeIDList   = info4.ID.ToString();
                 this.userGradeNameList = info4.Name;
             }
             else
             {
                 this.userGradeIDList   = this.userGradeIDList + "," + info4.ID.ToString();
                 this.userGradeNameList = this.userGradeNameList + "," + info4.Name;
             }
         }
     }
 }
Пример #9
0
        protected void UnionEdit()
        {
            string      queryString = RequestHelper.GetQueryString <string>("ProductIDList");
            ProductInfo product     = new ProductInfo();

            if (RequestHelper.GetQueryString <string>("Weight") != string.Empty)
            {
                product.Weight = RequestHelper.GetQueryString <int>("Weight");
            }
            else
            {
                product.Weight = -2;
            }
            if (RequestHelper.GetQueryString <string>("MarketPrice") != string.Empty)
            {
                product.MarketPrice = RequestHelper.GetQueryString <decimal>("MarketPrice");
            }
            else
            {
                product.MarketPrice = -2M;
            }
            if (RequestHelper.GetQueryString <string>("SendPoint") != string.Empty)
            {
                product.SendPoint = RequestHelper.GetQueryString <int>("SendPoint");
            }
            else
            {
                product.SendPoint = -2;
            }
            if (RequestHelper.GetQueryString <string>("TotalStorageCount") != string.Empty)
            {
                product.TotalStorageCount = RequestHelper.GetQueryString <int>("TotalStorageCount");
            }
            else
            {
                product.TotalStorageCount = -2;
            }
            if (RequestHelper.GetQueryString <string>("LowerCount") != string.Empty)
            {
                product.LowerCount = RequestHelper.GetQueryString <int>("LowerCount");
            }
            else
            {
                product.LowerCount = -2;
            }
            if (RequestHelper.GetQueryString <string>("UpperCount") != string.Empty)
            {
                product.UpperCount = RequestHelper.GetQueryString <int>("UpperCount");
            }
            else
            {
                product.UpperCount = -2;
            }
            ProductBLL.UnionUpdateProduct(queryString, product);
            string str2 = RequestHelper.GetQueryString <string>("MemberPrice");

            if (str2 != string.Empty)
            {
                string[]             strArray = str2.Split(new char[] { ',' });
                List <UserGradeInfo> list     = UserGradeBLL.ReadUserGradeCacheList();
                decimal num   = -1M;
                int     index = 0;
                int     num3  = 0;
                foreach (UserGradeInfo info2 in list)
                {
                    if (strArray[index] != string.Empty)
                    {
                        foreach (string str3 in queryString.Split(new char[] { ',' }))
                        {
                            num3 = Convert.ToInt32(str3);
                            MemberPriceBLL.DeleteMemberPriceByProductID(str3);
                            num = Convert.ToDecimal(strArray[index]);
                            if (num != -1M)
                            {
                                MemberPriceInfo memberPrice = new MemberPriceInfo();
                                memberPrice.ProductID = num3;
                                memberPrice.GradeID   = info2.ID;
                                memberPrice.Price     = num;
                                MemberPriceBLL.AddMemberPrice(memberPrice);
                            }
                        }
                    }
                    index++;
                }
            }
            ResponseHelper.Write(ShopLanguage.ReadLanguage("UpdateOK"));
            ResponseHelper.End();
        }