Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         base.CheckAdminPower("ReadGiftPack", PowerCheckType.Single);
         base.BindControl(GiftPackBLL.ReadGiftPackList(base.CurrentPage, base.PageSize, ref this.Count), this.RecordList, this.MyPager);
     }
 }
Ejemplo n.º 4
0
        protected void DeleteButton_Click(object sender, EventArgs e)
        {
            base.CheckAdminPower("DeleteGiftPack", PowerCheckType.Single);
            string intsForm = RequestHelper.GetIntsForm("SelectID");

            if (intsForm != string.Empty)
            {
                GiftPackBLL.DeleteGiftPack(intsForm);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("GiftPack"), intsForm);
                ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), RequestHelper.RawUrl);
            }
        }
Ejemplo n.º 5
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);
                 }
             }
         }
     }
 }
Ejemplo n.º 6
0
        protected override void PageLoad()
        {
            base.PageLoad();
            int queryString = RequestHelper.GetQueryString <int>("Page");

            if (queryString < 1)
            {
                queryString = 1;
            }
            int pageSize = 6;
            int count    = 0;

            this.giftPackList = GiftPackBLL.ReadGiftPackList(queryString, pageSize, ref count);
            this.ajaxPagerClass.CurrentPage = queryString;
            this.ajaxPagerClass.PageSize    = pageSize;
            this.ajaxPagerClass.Count       = count;
            this.ajaxPagerClass.DisCount    = false;
            this.ajaxPagerClass.ListType    = false;
        }
Ejemplo n.º 7
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            GiftPackInfo giftPack = new GiftPackInfo();

            giftPack.ID        = RequestHelper.GetQueryString <int>("ID");
            giftPack.Name      = this.Name.Text;
            giftPack.Photo     = this.Photo.Text;
            giftPack.StartDate = Convert.ToDateTime(this.StartDate.Text);
            giftPack.EndDate   = Convert.ToDateTime(this.EndDate.Text).AddDays(1.0).AddSeconds(-1.0);
            giftPack.Price     = Convert.ToDecimal(this.Price.Text);
            int    form = RequestHelper.GetForm <int>("GiftGroupCount");
            string str  = string.Empty;

            for (int i = 0; i < form; i++)
            {
                if (RequestHelper.GetForm <string>("GiftGroupValue" + i) != string.Empty)
                {
                    str = str + RequestHelper.GetForm <string>("GiftGroupValue" + i) + "#";
                }
            }
            if (str.EndsWith("#"))
            {
                str = str.Substring(0, str.Length - 1);
            }
            giftPack.GiftGroup = str;
            string alertMessage = ShopLanguage.ReadLanguage("AddOK");

            if (giftPack.ID == -2147483648)
            {
                base.CheckAdminPower("AddGiftPack", PowerCheckType.Single);
                int id = GiftPackBLL.AddGiftPack(giftPack);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("GiftPack"), id);
            }
            else
            {
                base.CheckAdminPower("UpdateGiftPack", PowerCheckType.Single);
                GiftPackBLL.UpdateGiftPack(giftPack);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("GiftPack"), giftPack.ID);
                alertMessage = ShopLanguage.ReadLanguage("UpdateOK");
            }
            AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            int currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int pageSize = 6;
            int count    = 0;

            giftPackList = GiftPackBLL.ReadGiftPackList(currentPage, pageSize, ref count);

            ajaxPagerClass.CurrentPage = currentPage;
            ajaxPagerClass.PageSize    = pageSize;
            ajaxPagerClass.Count       = count;
            ajaxPagerClass.DisCount    = false;
            ajaxPagerClass.ListType    = false;
        }
Ejemplo n.º 9
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;
        }