Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["countDownId"], out this.countDownId))
     {
         base.GotoResourceNotFound();
     }
     else if (SettingsManager.GetMasterSettings().OpenMultStore)
     {
         CountDownInfo    countDownInfo  = PromoteHelper.GetCountDownInfo(this.countDownId, 0);
         List <StoreBase> activityStores = StoreActivityHelper.GetActivityStores(countDownInfo.CountDownId, 2, countDownInfo.StoreType);
         this.ddlStores.DataSource = activityStores;
         this.ddlStores.DataBind();
         this.ddlStores.Items.Insert(0, new ListItem
         {
             Text  = "请选择",
             Value = "-1"
         });
         this.pnlStoreDetail.Visible = true;
         this.ltStoreNames.Text      = string.Format("已参加活动门店({0}家):{1}", activityStores.Count, (from t in activityStores
                                                                                                 select t.StoreName).Aggregate((string t, string n) => t + "、" + n));
         this.hidOpenMultStore.Value = "1";
     }
     else
     {
         this.hidOpenMultStore.Value = "0";
         this.pnlStoreDetail.Visible = false;
     }
 }
Esempio n. 2
0
        private void BindCountDown()
        {
            CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(this.countDownId, 0);

            if (countDownInfo.StartDate <= DateTime.Now && countDownInfo.EndDate > DateTime.Now)
            {
                this.aChoiceProduct.Visible = false;
                this.CPStartTime.Enabled    = false;
            }
            DataTable countDownSkus = PromoteHelper.GetCountDownSkus(this.countDownId, 0, false);

            if (SettingsManager.GetMasterSettings().OpenMultStore)
            {
                List <StoreBase> activityStores = StoreActivityHelper.GetActivityStores(this.countDownId, 2, countDownInfo.StoreType);
                this.hidStoreIds.Value = (from t in activityStores
                                          select t.StoreId.ToString()).Aggregate((string t, string n) => t + "," + n);
            }
            else
            {
                this.hidStoreIds.Value = "";
            }
            int num = 0;

            if (countDownSkus.Rows.Count == 1)
            {
                DataRow dataRow = countDownSkus.Rows[0];
                this.txtPrice.Text      = dataRow["SalePrice"].ToDecimal(0).F2ToString("f2");
                this.txtTotalCount.Text = dataRow["TotalCount"].ToNullString();
                num = dataRow["BoughtCount"].ToInt(0);
            }
            else
            {
                for (int i = 0; i < countDownSkus.Rows.Count; i++)
                {
                    num += countDownSkus.Rows[i]["BoughtCount"].ToInt(0);
                }
            }
            this.txtContent.Text          = Globals.HtmlDecode(countDownInfo.Content);
            this.txtMaxCount.Text         = Convert.ToString(countDownInfo.MaxCount);
            this.ltBoughtCount.Text       = num.ToString();
            this.CPEndDate.SelectedDate   = countDownInfo.EndDate;
            this.CPStartTime.SelectedDate = countDownInfo.StartDate;
            this.txtShareDetails.Text     = countDownInfo.ShareDetails;
            this.txtShareTitle.Text       = countDownInfo.ShareTitle;
            this.hidUploadLogo.Value      = countDownInfo.ShareIcon;
        }
Esempio n. 3
0
        public static List <StoreBaseEntity> GetRecomStoreByCountdownProductId(StoreEntityQuery query)
        {
            List <StoreBaseEntity> result = new List <StoreBaseEntity>();

            if (query.Position.Latitude == 0.0 || query.Position.Longitude == 0.0)
            {
                return(result);
            }
            List <StoreBase>     activityStores = StoreActivityHelper.GetActivityStores(query.ActivityId, 2, query.TagId);
            IEnumerable <string> source         = from t in activityStores
                                                  select t.StoreId.ToString();

            Func <string, string, string> func = (string t, string n) => t + "," + n;
            string          text2           = query.Key = source.Aggregate(func);
            StoreProductDao storeProductDao = new StoreProductDao();

            return(storeProductDao.GetRecomStoreByCountdownProductId(query));
        }
Esempio n. 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["activityId"], out this.activityId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.btnSave.Click += this.btnSave_Click;
         if (!this.Page.IsPostBack)
         {
             PromotionInfo promotion = PromoteHelper.GetPromotion(this.activityId);
             this.promotionView.Promotion = promotion;
             if (SettingsManager.GetMasterSettings().OpenMultStore)
             {
                 List <StoreBase> activityStores = StoreActivityHelper.GetActivityStores(this.activityId, 1, promotion.StoreType);
                 if (activityStores.Count > 0)
                 {
                     this.hidStoreIds.Value = (from t in activityStores
                                               select t.StoreId.ToString()).Aggregate((string t, string n) => t + "," + n);
                 }
             }
             else
             {
                 this.hidStoreIds.Value = "";
             }
             this.txtPromoteType.Text = ((int)promotion.PromoteType).ToString();
             if (promotion.PromoteType == PromoteType.FullQuantityDiscount || promotion.PromoteType == PromoteType.FullQuantityReduced)
             {
                 this.radPromoteType.IsWholesale = true;
                 this.txtCondition.Text          = promotion.Condition.ToString("F0");
             }
             else
             {
                 this.txtCondition.Text = promotion.Condition.F2ToString("f2");
             }
             this.txtDiscountValue.Text = promotion.DiscountValue.F2ToString("f2");
             if (!string.IsNullOrEmpty(promotion.GiftIds))
             {
                 this.BindPromotionGifts(promotion);
             }
         }
     }
 }