示例#1
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            int id = RequestHelper.GetQueryString <int>("ID");

            giftPack = GiftPackBLL.ReadGiftPack(id);
            if (giftPack.GiftGroup != string.Empty)
            {
                string idList = string.Empty;
                int    count  = giftPack.GiftGroup.Split('#').Length;
                nameArray    = new string[count];
                countArray   = new string[count];
                productArray = new string[count];
                for (int i = 0; i < count; i++)
                {
                    string[] giftGroupArray = giftPack.GiftGroup.Split('#')[i].Split('|');
                    nameArray[i]    = giftGroupArray[0];
                    countArray[i]   = giftGroupArray[1];
                    productArray[i] = giftGroupArray[2];
                    if (giftGroupArray[2] != string.Empty)
                    {
                        idList += giftGroupArray[2] + ",";
                    }
                }
                if (idList != string.Empty)
                {
                    idList = idList.Substring(0, idList.Length - 1);
                    ProductSearchInfo productSearch = new ProductSearchInfo();
                    productSearch.InProductID = idList;
                    productList = ProductBLL.SearchProductList(productSearch);
                }
            }
            Title = giftPack.Name;
        }
示例#2
0
        protected override void PageLoad()
        {
            base.PageLoad();
            int queryString = RequestHelper.GetQueryString <int>("ID");

            this.giftPack = GiftPackBLL.ReadGiftPack(queryString);
            if (this.giftPack.GiftGroup != string.Empty)
            {
                string str    = string.Empty;
                int    length = this.giftPack.GiftGroup.Split(new char[] { '#' }).Length;
                this.nameArray    = new string[length];
                this.countArray   = new string[length];
                this.productArray = new string[length];
                for (int i = 0; i < length; i++)
                {
                    string[] strArray = this.giftPack.GiftGroup.Split(new char[] { '#' })[i].Split(new char[] { '|' });
                    this.nameArray[i]    = strArray[0];
                    this.countArray[i]   = strArray[1];
                    this.productArray[i] = strArray[2];
                    if (strArray[2] != string.Empty)
                    {
                        str = str + strArray[2] + ",";
                    }
                }
                if (str != string.Empty)
                {
                    str = str.Substring(0, str.Length - 1);
                    ProductSearchInfo productSearch = new ProductSearchInfo();
                    productSearch.InProductID = str;
                    this.productList          = ProductBLL.SearchProductList(productSearch);
                }
            }
            base.Title = this.giftPack.Name;
        }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         int queryString = RequestHelper.GetQueryString <int>("ID");
         if (queryString != -2147483648)
         {
             base.CheckAdminPower("ReadGiftPack", PowerCheckType.Single);
             this.strGiftPackID = queryString.ToString();
             GiftPackInfo info = GiftPackBLL.ReadGiftPack(queryString);
             this.Name.Text      = info.Name;
             this.Photo.Text     = info.Photo;
             this.StartDate.Text = info.StartDate.ToString("yyyy-MM-dd");
             this.EndDate.Text   = info.EndDate.ToString("yyyy-MM-dd");
             this.Price.Text     = info.Price.ToString();
             if (info.GiftGroup != string.Empty)
             {
                 string str    = string.Empty;
                 int    length = info.GiftGroup.Split(new char[] { '#' }).Length;
                 this.nameArray    = new string[length];
                 this.countArray   = new string[length];
                 this.productArray = new string[length];
                 for (int i = 0; i < length; i++)
                 {
                     string[] strArray = info.GiftGroup.Split(new char[] { '#' })[i].Split(new char[] { '|' });
                     this.nameArray[i]    = strArray[0];
                     this.countArray[i]   = strArray[1];
                     this.productArray[i] = strArray[2];
                     if (strArray[2] != string.Empty)
                     {
                         str = str + strArray[2] + ",";
                     }
                 }
                 if (str != string.Empty)
                 {
                     str = str.Substring(0, str.Length - 1);
                     ProductSearchInfo productSearch = new ProductSearchInfo();
                     productSearch.InProductID = str;
                     this.productList          = ProductBLL.SearchProductList(productSearch);
                 }
             }
         }
     }
 }
示例#4
0
        protected void AddOrderProduct(int orderID)
        {
            List <CartInfo> list         = CartBLL.ReadCartList(base.UserID);
            string          strProductID = string.Empty;

            foreach (CartInfo info in list)
            {
                if (strProductID == string.Empty)
                {
                    strProductID = info.ProductID.ToString();
                }
                else
                {
                    strProductID = strProductID + "," + info.ProductID.ToString();
                }
            }
            List <ProductInfo> productList = new List <ProductInfo>();

            if (strProductID != string.Empty)
            {
                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.InProductID = strProductID;
                productList = ProductBLL.SearchProductList(productSearch);
            }
            List <MemberPriceInfo>    memberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID);
            Dictionary <string, bool> dictionary      = new Dictionary <string, bool>();
            Dictionary <int, int>     dictionary2     = new Dictionary <int, int>();

            foreach (CartInfo info in list)
            {
                ProductInfo     product     = ProductBLL.ReadProductByProductList(productList, info.ProductID);
                OrderDetailInfo orderDetail = new OrderDetailInfo();
                orderDetail.OrderID       = orderID;
                orderDetail.ProductID     = info.ProductID;
                orderDetail.ProductName   = info.ProductName;
                orderDetail.ProductWeight = product.Weight;
                orderDetail.SendPoint     = product.SendPoint;
                if (info.GiftPackID == 0)
                {
                    orderDetail.ProductPrice = MemberPriceBLL.ReadCurrentMemberPrice(memberPriceList, base.GradeID, product);
                }
                else if (dictionary.ContainsKey(info.RandNumber + "|" + info.GiftPackID.ToString()))
                {
                    orderDetail.ProductPrice = 0M;
                }
                else
                {
                    orderDetail.ProductPrice = GiftPackBLL.ReadGiftPack(info.GiftPackID).Price;
                    dictionary.Add(info.RandNumber + "|" + info.GiftPackID.ToString(), true);
                }
                orderDetail.BuyCount = info.BuyCount;
                if (info.FatherID > 0)
                {
                    orderDetail.FatherID = dictionary2[info.FatherID];
                }
                orderDetail.RandNumber = info.RandNumber;
                orderDetail.GiftPackID = info.GiftPackID;
                int num = OrderDetailBLL.AddOrderDetail(orderDetail);
                dictionary2.Add(info.ID, num);
            }
            CartBLL.ClearCart(base.UserID);
            Sessions.ProductTotalPrice  = 0M;
            Sessions.ProductBuyCount    = 0;
            Sessions.ProductTotalWeight = 0M;
        }