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

            favorableActivity = FavorableActivityBLL.ReadFavorableActivity(id);
            if (favorableActivity.UserGrade != string.Empty)
            {
                foreach (string temp in favorableActivity.UserGrade.Split(','))
                {
                    if (userGrade == string.Empty)
                    {
                        userGrade = UserGradeBLL.ReadUserGradeCache(Convert.ToInt32(temp)).Name;
                    }
                    else
                    {
                        userGrade += "," + UserGradeBLL.ReadUserGradeCache(Convert.ToInt32(temp)).Name;
                    }
                }
            }
            if (favorableActivity.GiftID != string.Empty)
            {
                GiftSearchInfo giftSearch = new GiftSearchInfo();
                giftSearch.InGiftID = favorableActivity.GiftID;
                giftList            = GiftBLL.SearchGiftList(giftSearch);
            }

            Title = favorableActivity.Name;
        }
Exemplo n.º 2
0
        protected override void PageLoad()
        {
            base.PageLoad();
            int queryString = RequestHelper.GetQueryString <int>("ID");

            this.favorableActivity = FavorableActivityBLL.ReadFavorableActivity(queryString);
            if (this.favorableActivity.UserGrade != string.Empty)
            {
                foreach (string str in this.favorableActivity.UserGrade.Split(new char[] { ',' }))
                {
                    if (this.userGrade == string.Empty)
                    {
                        this.userGrade = UserGradeBLL.ReadUserGradeCache(Convert.ToInt32(str)).Name;
                    }
                    else
                    {
                        this.userGrade = this.userGrade + "," + UserGradeBLL.ReadUserGradeCache(Convert.ToInt32(str)).Name;
                    }
                }
            }
            if (this.favorableActivity.GiftID != string.Empty)
            {
                GiftSearchInfo gift = new GiftSearchInfo();
                gift.InGiftID = this.favorableActivity.GiftID;
                this.giftList = GiftBLL.SearchGiftList(gift);
            }
            base.Title = this.favorableActivity.Name;
        }
Exemplo n.º 3
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);
             }
         }
     }
 }
Exemplo n.º 4
0
 protected override void PageLoad()
 {
     base.PageLoad();
     this.favorableActivity = FavorableActivityBLL.ReadFavorableActivity(RequestHelper.DateNow, RequestHelper.DateNow, 0);
     if (this.favorableActivity.ID > 0)
     {
         TimeSpan span = (TimeSpan)(this.favorableActivity.EndDate - RequestHelper.DateNow);
         this.leftTime = ((((span.Days * 0x18) * 0xe10) + (span.Hours * 0xe10)) + (span.Minutes * 60)) + span.Seconds;
     }
     else
     {
         int count = -2147483648;
         this.favorableActivityList = FavorableActivityBLL.ReadFavorableActivityList(1, 5, ref count);
     }
     this.activityPluginsList = ActivityPlugins.ReadIsEnabledActivityPluginsList();
     base.Title = "ил╪р╩Н╤╞";
 }
Exemplo n.º 5
0
 protected override void PageLoad()
 {
     base.PageLoad();
     if ((ShopConfig.ReadConfigInfo().AllowAnonymousAddCart == 0) && (base.UserID == 0))
     {
         ResponseHelper.Redirect("/User/Login.aspx?RedirectUrl=/CheckOut.aspx");
         ResponseHelper.End();
     }
     if ((Sessions.ProductBuyCount == 0) || (Sessions.ProductTotalPrice == 0M))
     {
         ResponseHelper.Redirect("/Cart.aspx");
         ResponseHelper.End();
     }
     if (base.UserID > 0)
     {
         this.userAddressList = UserAddressBLL.ReadUserAddressByUser(base.UserID);
         List <UserCouponInfo> list = UserCouponBLL.ReadUserCouponCanUse(base.UserID);
         foreach (UserCouponInfo info in list)
         {
             if (info.Coupon.UseMinAmount <= Sessions.ProductTotalPrice)
             {
                 this.userCouponList.Add(info);
             }
         }
         this.moneyLeft = UserBLL.ReadUserMore(base.UserID).MoneyLeft;
     }
     this.payPluginsList    = PayPlugins.ReadProductBuyPayPluginsList();
     this.favorableActivity = FavorableActivityBLL.ReadFavorableActivity(DateTime.Now, DateTime.Now, 0);
     if (this.favorableActivity.ID > 0)
     {
         if ((("," + this.favorableActivity.UserGrade + ",").IndexOf("," + this.GradeID.ToString() + ",") > -1) && (Sessions.ProductTotalPrice >= this.favorableActivity.OrderProductMoney))
         {
             if (this.favorableActivity.GiftID != string.Empty)
             {
                 GiftSearchInfo gift = new GiftSearchInfo();
                 gift.InGiftID = this.favorableActivity.GiftID;
                 this.giftList = GiftBLL.SearchGiftList(gift);
             }
         }
         else
         {
             this.favorableActivity = new FavorableActivityInfo();
         }
     }
     base.Title = "结算中心";
 }
Exemplo n.º 6
0
 /// <summary>
 /// 页面加载
 /// </summary>
 protected override void PageLoad()
 {
     base.PageLoad();
     favorableActivity = FavorableActivityBLL.ReadFavorableActivity(RequestHelper.DateNow, RequestHelper.DateNow, 0);
     if (favorableActivity.ID > 0)
     {
         TimeSpan timeSpan = favorableActivity.EndDate - RequestHelper.DateNow;
         leftTime = timeSpan.Days * 24 * 3600 + timeSpan.Hours * 3600 + timeSpan.Minutes * 60 + timeSpan.Seconds;
     }
     else
     {
         int count = int.MinValue;
         favorableActivityList = FavorableActivityBLL.ReadFavorableActivityList(1, 5, ref count);
     }
     activityPluginsList = SocoShop.Common.ActivityPlugins.ReadIsEnabledActivityPluginsList();
     Title = "商家活动";
 }
Exemplo n.º 7
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            FavorableActivityInfo favorableActivity = new FavorableActivityInfo();

            favorableActivity.ID                = RequestHelper.GetQueryString <int>("ID");
            favorableActivity.Name              = this.Name.Text;
            favorableActivity.Photo             = this.Photo.Text;
            favorableActivity.Content           = this.Content.Text;
            favorableActivity.StartDate         = Convert.ToDateTime(this.StartDate.Text);
            favorableActivity.EndDate           = Convert.ToDateTime(this.EndDate.Text).AddDays(1.0).AddSeconds(-1.0);
            favorableActivity.UserGrade         = ControlHelper.GetCheckBoxListValue(this.UserGrade);
            favorableActivity.OrderProductMoney = Convert.ToDecimal(this.OrderProductMoney.Text);
            int    form        = RequestHelper.GetForm <int>("ShippingWay");
            string classIDList = string.Empty;

            if (form == 1)
            {
                classIDList = this.RegionID.ClassIDList;
            }
            favorableActivity.RegionID    = classIDList;
            favorableActivity.ShippingWay = form;
            int     num2 = RequestHelper.GetForm <int>("ReduceWay");
            decimal num3 = 0M;
            decimal num4 = 0M;

            if (num2 == 1)
            {
                num3 = Convert.ToDecimal(this.ReduceMoney.Text);
            }
            else if (num2 == 2)
            {
                num4 = Convert.ToDecimal(this.ReduceDiscount.Text);
            }
            favorableActivity.ReduceWay      = num2;
            favorableActivity.ReduceMoney    = num3;
            favorableActivity.ReduceDiscount = num4;
            favorableActivity.GiftID         = RequestHelper.GetIntsForm("GiftList");
            string alertMessage = string.Empty;

            if (FavorableActivityBLL.ReadFavorableActivity(favorableActivity.StartDate, favorableActivity.EndDate, favorableActivity.ID).ID > 0)
            {
                alertMessage = ShopLanguage.ReadLanguage("OneTimeManyFavorableActivity");
            }
            else
            {
                alertMessage = ShopLanguage.ReadLanguage("AddOK");
                if (favorableActivity.ID == -2147483648)
                {
                    base.CheckAdminPower("AddFavorableActivity", PowerCheckType.Single);
                    int id = FavorableActivityBLL.AddFavorableActivity(favorableActivity);
                    AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("FavorableActivity"), id);
                }
                else
                {
                    base.CheckAdminPower("UpdateFavorableActivity", PowerCheckType.Single);
                    FavorableActivityBLL.UpdateFavorableActivity(favorableActivity);
                    AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("FavorableActivity"), favorableActivity.ID);
                    alertMessage = ShopLanguage.ReadLanguage("UpdateOK");
                }
            }
            AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl);
        }