Пример #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;
     }
 }
Пример #2
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["activityId"], out this.activityId))
     {
         base.GotoResourceNotFound();
         return;
     }
     this.hdactivy.Value      = this.activityId.ToString();
     this.btnDeleteAll.Click += new System.EventHandler(this.btnDeleteAll_Click);
     this.grdPromotionProducts.RowDeleting += new System.Web.UI.WebControls.GridViewDeleteEventHandler(this.grdPromotionProducts_RowDeleting);
     if (!this.Page.IsPostBack)
     {
         this.btnFinesh.PostBackUrl = "ProductPromotions.aspx";
         bool.TryParse(base.Request.QueryString["isWholesale"], out this.isWholesale);
         if (this.isWholesale)
         {
             this.btnFinesh.PostBackUrl = "ProductPromotions.aspx?isWholesale=true";
         }
         PromotionInfo promotion = PromoteHelper.GetPromotion(this.activityId);
         if (promotion == null)
         {
             base.GotoResourceNotFound();
             return;
         }
         this.litPromotionName.Text = promotion.Name;
         this.BindPromotionProducts();
     }
 }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.formData = this.Page.Request["formData"].ToNullString();
     this.btnAddCountDown.Click += this.btnAddCountDown_Click;
     this.productId              = this.Page.Request["productId"].ToInt(0);
     this.SetDateControl();
     if (!this.Page.IsPostBack)
     {
         if (!this.site.OpenMultStore)
         {
             this.pnlReMark.Visible      = false;
             this.hidOpenMultStore.Value = "0";
         }
         else
         {
             this.hidOpenMultStore.Value = "1";
         }
         this.BindProduct();
         this.ShowSKUOrDefault();
         this.BindFormData();
     }
     this.filterProductIds = (this.site.OpenMultStore ? "" : PromoteHelper.GetCountDownActiveProducts());
     if (this.productId > 0 && this.filterProductIds.Length > 0)
     {
         this.filterProductIds = this.filterProductIds + "," + this.productId;
     }
     else if (this.filterProductIds.Length == 0 && this.productId > 0)
     {
         this.filterProductIds = this.productId.ToString();
     }
 }
Пример #4
0
 private void grdPromotionProducts_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
 {
     if (PromoteHelper.DeletePromotionProducts(this.activityId, new int?((int)this.grdPromotionProducts.DataKeys[e.RowIndex].Value)))
     {
         base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true);
     }
 }
Пример #5
0
 protected override void AttachChildControls()
 {
     PageTitle.AddSiteNameTitle("摇一摇优惠券");
     this.lblAmount        = (Label)this.FindControl("lblAmount");
     this.lblDiscountValue = (Label)this.FindControl("lblDiscountValue");
     this.startTime        = (Literal)this.FindControl("startTime");
     this.closingTime      = (Literal)this.FindControl("closingTime");
     this.lbtToGet         = (Button)this.FindControl("lbtToGet");
     this.lbtToGet.Click  += this.lbtToGet_Click;
     if (!this.Page.IsPostBack)
     {
         CouponInfo shakeCoupon = PromoteHelper.GetShakeCoupon();
         Label      label       = this.lblAmount;
         decimal    num         = shakeCoupon.OrderUseLimit.Value;
         label.Text = num.ToString("F0");
         Label label2 = this.lblDiscountValue;
         num         = shakeCoupon.Price;
         label2.Text = num.ToString("F0");
         Literal  literal  = this.startTime;
         DateTime dateTime = shakeCoupon.StartTime;
         literal.Text = dateTime.ToString("yyyy-MM-dd");
         Literal literal2 = this.closingTime;
         dateTime      = shakeCoupon.ClosingTime;
         literal2.Text = dateTime.ToString("yyyy-MM-dd");
     }
 }
Пример #6
0
        private DataGridViewModel <Dictionary <string, object> > GetDataList(CountDownQuery query)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();

            if (query != null)
            {
                DbQueryResult countDownList = PromoteHelper.GetCountDownList(query);
                dataGridViewModel.rows  = DataHelper.DataTableToDictionary(countDownList.Data);
                dataGridViewModel.total = countDownList.TotalRecords;
                foreach (Dictionary <string, object> row in dataGridViewModel.rows)
                {
                    CountDownInfo countDownInfo = row.ToObject <CountDownInfo>();
                    int           num           = 0;
                    if (countDownInfo.StartDate > DateTime.Now)
                    {
                        num = 1;
                    }
                    else if (countDownInfo.EndDate < DateTime.Now)
                    {
                        num = 2;
                    }
                    row.Add("State", num);
                }
            }
            return(dataGridViewModel);
        }
Пример #7
0
        public override void OnLoad(HttpContext context)
        {
            base.OnLoad(context);
            if (string.IsNullOrWhiteSpace(base.action))
            {
                throw new HidistroAshxException("错误的参数");
            }
            base.action     = base.action.ToLower();
            this.activityId = base.GetIntParam(context, "activityId", false).Value;
            this.promotion  = PromoteHelper.GetPromotion(this.activityId);
            if (this.activityId < 1 || this.promotion == null)
            {
                throw new HidistroAshxException("错误的参数:活动编码");
            }
            switch (base.action)
            {
            case "getlist":
                this.GetList(context);
                break;

            case "delete":
                this.Delete(context);
                break;

            case "clear":
                this.Clear(context);
                break;

            default:
                throw new HidistroAshxException("错误的参数");
            }
        }
Пример #8
0
        private void grdGroupBuyList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int rowIndex               = ((GridViewRow)((Control)e.CommandSource).NamingContainer).RowIndex;
            int countDownId            = (int)grdCountDownsList.DataKeys[rowIndex].Value;
            int displaySequence        = int.Parse((grdCountDownsList.Rows[rowIndex].FindControl("lblDisplaySequence") as Literal).Text, NumberStyles.None);
            int replaceCountDownId     = 0;
            int replaceDisplaySequence = 0;

            if (e.CommandName == "Fall")
            {
                if (rowIndex < (grdCountDownsList.Rows.Count - 1))
                {
                    replaceCountDownId     = (int)grdCountDownsList.DataKeys[rowIndex + 1].Value;
                    replaceDisplaySequence = int.Parse((grdCountDownsList.Rows[rowIndex + 1].FindControl("lblDisplaySequence") as Literal).Text, NumberStyles.None);
                }
            }
            else if ((e.CommandName == "Rise") && (rowIndex > 0))
            {
                replaceCountDownId     = (int)grdCountDownsList.DataKeys[rowIndex - 1].Value;
                replaceDisplaySequence = int.Parse((grdCountDownsList.Rows[rowIndex - 1].FindControl("lblDisplaySequence") as Literal).Text, NumberStyles.None);
            }
            if (replaceCountDownId > 0)
            {
                PromoteHelper.SwapCountDownSequence(countDownId, replaceCountDownId, displaySequence, replaceDisplaySequence);
                BindCountDown();
            }
        }
Пример #9
0
        private void lkbtnDeleteCheck_Click(object sender, System.EventArgs e)
        {
            int?num = null;

            foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdGroupBuyList.Rows)
            {
                System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol");
                if (checkBox.Checked)
                {
                    num = new int?(num.GetValueOrDefault());
                    int          groupBuyId = System.Convert.ToInt32(this.grdGroupBuyList.DataKeys[gridViewRow.RowIndex].Value, System.Globalization.CultureInfo.InvariantCulture);
                    GroupBuyInfo groupBuy   = PromoteHelper.GetGroupBuy(groupBuyId);
                    if (groupBuy.Status != GroupBuyStatus.UnderWay && groupBuy.Status != GroupBuyStatus.EndUntreated)
                    {
                        num = new int?(num.GetValueOrDefault() + 1);
                        PromoteHelper.DeleteGroupBuy(groupBuyId);
                    }
                }
            }
            if (num.HasValue)
            {
                this.BindGroupBuy();
                this.ShowMsg(string.Format("成功删除{0}条团购活动", num), true);
                return;
            }
            this.ShowMsg("请先选择需要删除的团购活动", false);
        }
Пример #10
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            masterSettings.IsOpenRechargeGift = this.ooOpen.SelectedValue;
            if (this.ooOpen.SelectedValue)
            {
                masterSettings.EnableBulkPaymentAdvance = false;
                string value = this.hidJson.Value;
                if (string.IsNullOrEmpty(value))
                {
                    this.ShowMsg("充值赠送项不能为空!", false);
                    return;
                }
                List <RechargeGiftInfo> list = JsonHelper.ParseFormJson <List <RechargeGiftInfo> >(value);
                if (list.Any())
                {
                    PromoteHelper.DeleteRechargeGift();
                    foreach (RechargeGiftInfo item in list)
                    {
                        PromoteHelper.AddRechargeGift(item);
                    }
                }
            }
            else
            {
                PromoteHelper.DeleteRechargeGift();
            }
            SettingsManager.Save(masterSettings);
            this.hidIsLoading.Value = "false";
            this.ShowMsg("保存成功", true);
            this.BindRechargeList();
        }
Пример #11
0
        private void btnUpdateGroupBuy_Click(object sender, System.EventArgs e)
        {
            CountDownCategoriesInfo countDownInfo = new CountDownCategoriesInfo();
            string text = string.Empty;

            countDownInfo.StartTime = Convert.ToDateTime("2015-1-1 " + this.drophours.SelectedValue.Value + ":00:00.0000000");
            countDownInfo.EndTime   = Convert.ToDateTime("2015-1-1 " + this.HourDropDownList1.SelectedValue.Value + ":00:00.0000000");


            if (System.DateTime.Compare(countDownInfo.StartTime, countDownInfo.EndTime) >= 0 && this.HourDropDownList1.SelectedValue.Value != 0)
            {
                this.ShowMsg("开始日期必须要早于结束日期", false);
                return;
            }
            countDownInfo.Title          = this.txtTitle.Text.Trim();
            countDownInfo.AdImageUrl     = CatalogHelper.UploadActiveCategorieImage(this.fileUpload.PostedFile);
            countDownInfo.AdImageUrl     = string.IsNullOrEmpty(countDownInfo.AdImageUrl) ? this.hidd_ImgSrc.Value.Trim() : countDownInfo.AdImageUrl;
            countDownInfo.AdImageLinkUrl = this.txtActiveImgUrl.Text.Trim();

            countDownInfo.CountDownCategoryId = CountDownCategoryId;

            if (PromoteHelper.UpdateCountDownDownCategories(countDownInfo))
            {
                this.ShowMsg("修改限时抢购活动成功", true);
                return;
            }
            this.ShowMsg("编辑限时抢购活动失败", true);
        }
        private void BindOrderPromotions()
        {
            DataTable productDetailOrderPromotions = PromoteHelper.GetProductDetailOrderPromotions();

            if (productDetailOrderPromotions.Rows.Count > 0)
            {
                this.divOrderPromotions.Visible = true;
                string text = string.Empty;
                foreach (DataRow row in productDetailOrderPromotions.Rows)
                {
                    text = text + row["Name"].ToNullString() + ",";
                }
                text = text.TrimEnd(',');
                this.ltlOrderPromotion.Text = text;
            }
            string phonePriceByProductId = PromoteHelper.GetPhonePriceByProductId(this.productId);

            if (!string.IsNullOrEmpty(phonePriceByProductId) && (this.sitesettings.OpenAliho == 1 || this.sitesettings.OpenMobbile == 1 || this.sitesettings.OpenVstore == 1 || this.sitesettings.OpenWap == 1))
            {
                this.divPhonePrice.Visible = true;
                string   s     = phonePriceByProductId.Split(',')[0];
                string[] array = this.lblBuyPrice.Text.Split('-');
                decimal  num   = decimal.Parse(array[0].Trim()) - decimal.Parse(s);
                this.litPhonePrice.Text        = ((num > decimal.Zero) ? num : decimal.Zero).F2ToString("f2");
                this.litPhonePriceEndDate.Text = phonePriceByProductId.Split(',')[1];
            }
        }
Пример #13
0
        private void SetOver(HttpContext context)
        {
            int?intParam = base.GetIntParam(context, "CountDownId", true);

            if (!intParam.HasValue)
            {
                throw new HidistroAshxException("错误的活动编号");
            }
            CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(intParam.Value, 0);

            if (countDownInfo == null)
            {
                throw new HidistroAshxException("错误的活动编号");
            }
            if (countDownInfo.StartDate > DateTime.Now)
            {
                throw new HidistroAshxException("该活动尚未开始");
            }
            if (countDownInfo.EndDate < DateTime.Now)
            {
                throw new HidistroAshxException("该活动已经结束");
            }
            PromoteHelper.SetOverCountDown(intParam.Value);
            base.ReturnSuccessResult(context, "活动提前结束成功", 0, true);
        }
Пример #14
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!int.TryParse(this.Page.Request.QueryString["activityId"], out this.activityId))
            {
                base.GotoResourceNotFound();
                return;
            }
            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
            if (!this.Page.IsPostBack)
            {
                PromotionInfo promotion = PromoteHelper.GetPromotion(this.activityId);
                this.promotionView.Promotion = promotion;
                this.txtPromoteType.Text     = ((int)promotion.PromoteType).ToString();
                if (promotion.PromoteType != PromoteType.FullQuantityDiscount)
                {
                    if (promotion.PromoteType != PromoteType.FullQuantityReduced)
                    {
                        this.txtCondition.Text = promotion.Condition.ToString("F2");
                        goto IL_E7;
                    }
                }
                this.radPromoteType.IsWholesale = true;
                this.txtCondition.Text          = promotion.Condition.ToString("F0");
IL_E7:
                this.txtDiscountValue.Text = promotion.DiscountValue.ToString("F2");
            }
        }
Пример #15
0
 private void btnDeleteAll_Click(object sender, System.EventArgs e)
 {
     if (PromoteHelper.DeletePromotionProducts(this.activityId, null))
     {
         base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true);
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(base.Request.QueryString["CountDownId"], out this.countDownId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.btnUpdateCountDown.Click += new EventHandler(this.btnUpdateGroupBuy_Click);
         if (!base.IsPostBack)
         {
             this.dropGroupBuyProduct.DataBind();
             this.dropCategories.DataBind();
             this.HourDropDownList1.DataBind();
             this.drophours.DataBind();
             CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(this.countDownId);
             if (countDownInfo == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 this.LoadCountDown(countDownInfo);
             }
         }
     }
 }
        protected override void AttachChildControls()
        {
            this.countDownId = this.Page.Request.QueryString["countDownId"].ToInt(0);
            this.storeId     = this.Page.Request.QueryString["StoreId"].ToInt(0);
            CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(this.countDownId, this.storeId);

            if (countDownInfo == null)
            {
                this.ShowWapMessage("抢购信息不存在", "default.aspx");
            }
            MemberInfo user = HiContext.Current.User;

            if (user.UserId != 0 && user.IsReferral() && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"]))
            {
                string text = HttpContext.Current.Request.Url.ToString();
                text = ((text.IndexOf("?") <= -1) ? (text + "?ReferralUserId=" + HiContext.Current.UserId) : (text + "&ReferralUserId=" + HiContext.Current.UserId));
                this.Page.Response.Redirect(text);
            }
            else
            {
                this.FindControls();
                this.SetControlsValue(countDownInfo);
                PageTitle.AddSiteNameTitle("限时抢购商品详情");
            }
        }
Пример #18
0
        private void lkbtnDeleteCheck_Click(object sender, EventArgs e)
        {
            int?nullable = null;

            foreach (GridViewRow row in this.grdCutDownList.Rows)
            {
                CheckBox box = (CheckBox)row.FindControl("checkboxCol");
                if (box.Checked)
                {
                    nullable = new int?(nullable.GetValueOrDefault());
                    int         cutDownId = Convert.ToInt32(this.grdCutDownList.DataKeys[row.RowIndex].Value, CultureInfo.InvariantCulture);
                    CutDownInfo cutDown   = PromoteHelper.GetCutDown(cutDownId);
                    nullable = new int?(nullable.GetValueOrDefault() + 1);
                    PromoteHelper.DeleteCutDown(cutDownId);
                }
            }
            if (nullable.HasValue)
            {
                this.BindCutDown();
                this.ShowMsg(string.Format("成功删除{0}条砍价活动", nullable), true);
            }
            else
            {
                this.ShowMsg("请先选择需要删除的砍价活动", false);
            }
        }
Пример #19
0
        private void lkbtnDeleteCheck_Click(object sender, EventArgs e)
        {
            int?nullable = null;

            foreach (GridViewRow row in this.grdGroupBuyList.Rows)
            {
                CheckBox box = (CheckBox)row.FindControl("checkboxCol");
                if (box.Checked)
                {
                    nullable = new int?(nullable.GetValueOrDefault());
                    int          groupBuyId = Convert.ToInt32(this.grdGroupBuyList.DataKeys[row.RowIndex].Value, CultureInfo.InvariantCulture);
                    GroupBuyInfo groupBuy   = PromoteHelper.GetGroupBuy(groupBuyId);
                    if ((groupBuy.Status != GroupBuyStatus.UnderWay) && (groupBuy.Status != GroupBuyStatus.EndUntreated))
                    {
                        nullable = new int?(nullable.GetValueOrDefault() + 1);
                        PromoteHelper.DeleteGroupBuy(groupBuyId);
                    }
                }
            }
            if (nullable.HasValue)
            {
                this.BindGroupBuy();
                this.ShowMsg(string.Format("成功删除{0}条团购活动", nullable), true);
            }
            else
            {
                this.ShowMsg("请先选择需要删除的团购活动", false);
            }
        }
Пример #20
0
 private void CountDownBusiness()
 {
     if (this.CountDownId > 0)
     {
         CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(this.CountDownId, 0);
         if (countDownInfo != null)
         {
             HtmlInputHidden htmlInputHidden = this.hidden_SKUSubmitOrderCountDownId;
             int             num             = this.CountDownId;
             htmlInputHidden.Value = num.ToString();
             List <CountDownSkuInfo> countDownSkuInfo = countDownInfo.CountDownSkuInfo;
             if (countDownSkuInfo.Count > 0)
             {
                 this.hidden_SKUSubmitOrderCountDownMinPrice.Value = (from t in countDownSkuInfo
                                                                      orderby t.SalePrice
                                                                      select t).FirstOrDefault().SalePrice.F2ToString("f2");
                 CountDownSkuInfo countDownSkuInfo2 = (from t in countDownSkuInfo
                                                       orderby t.TotalCount - t.BoughtCount descending
                                                       select t).FirstOrDefault();
                 int num2 = 0;
                 int num3 = countDownSkuInfo2.ActivityTotal - countDownSkuInfo2.BoughtCount;
                 num2 = ((countDownSkuInfo2.TotalCount <= num3) ? countDownSkuInfo2.TotalCount : num3);
                 this.hidden_SKUSubmitOrderCountDownStock.Value = ((num2 > 0) ? num2.ToString() : "0");
                 Label label = this.lblSKUSubmitOrderStockNow;
                 num        = countDownSkuInfo.Min((CountDownSkuInfo t) => t.TotalCount);
                 label.Text = num.ToString();
             }
             Literal literal = this.litMaxCount;
             num          = countDownInfo.MaxCount;
             literal.Text = num.ToString();
         }
     }
 }
Пример #21
0
        private void lkbtnDeleteCheck_Click(object sender, System.EventArgs e)
        {
            int num = 0;

            foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdCountDownsList.Rows)
            {
                System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol");
                if (checkBox.Checked)
                {
                    num++;
                    int countDownId = System.Convert.ToInt32(this.grdCountDownsList.DataKeys[gridViewRow.RowIndex].Value, System.Globalization.CultureInfo.InvariantCulture);
                    PromoteHelper.DeleteCountDown(countDownId);
                }
            }
            if (num != 0)
            {
                this.BindCountDown();
                this.ShowMsg(string.Format(System.Globalization.CultureInfo.InvariantCulture, "成功删除\"{0}\"条限时抢购活动", new object[]
                {
                    num
                }), true);
                return;
            }
            this.ShowMsg("请先选择需要删除的限时抢购活动", false);
        }
        private void BindPromotionInfo()
        {
            StoreActivityEntityList storeActivityEntity = PromoteHelper.GetStoreActivityEntity(0, 0);

            if (storeActivityEntity.FullAmountReduceList.Count > 0)
            {
                HtmlGenericControl htmlGenericControl  = this.liOrderPromotions;
                HtmlGenericControl htmlGenericControl2 = this.liOrderPromotions2;
                bool visible = htmlGenericControl2.Visible = true;
                htmlGenericControl.Visible = visible;
                string empty = string.Empty;
                empty = (from t in storeActivityEntity.FullAmountReduceList
                         select t.ActivityName).Aggregate((string t, string n) => t + "," + n);
                Literal literal  = this.ltlOrderPromotion2;
                Literal literal2 = this.ltlOrderPromotion;
                string  text3    = literal.Text = (literal2.Text = empty);
            }
            if (storeActivityEntity.FullAmountSentFreightList.Count > 0)
            {
                HtmlGenericControl htmlGenericControl3 = this.liOrderPromotions_free2;
                HtmlGenericControl htmlGenericControl4 = this.liOrderPromotions_free;
                bool visible = htmlGenericControl4.Visible = true;
                htmlGenericControl3.Visible = visible;
                string empty2 = string.Empty;
                empty2 += (from t in storeActivityEntity.FullAmountSentFreightList
                           select t.ActivityName).Aggregate((string t, string n) => t + "," + n);
                Literal literal3 = this.ltlOrderPromotion_free2;
                Literal literal4 = this.ltlOrderPromotion_free;
                string  text3    = literal3.Text = (literal4.Text = empty2);
            }
            string text6 = this.BindProductSendGifts();

            if (storeActivityEntity.FullAmountSentGiftList.Count > 0 || !string.IsNullOrEmpty(text6))
            {
                if (storeActivityEntity.FullAmountSentGiftList.Count > 0)
                {
                    string text7 = (from t in storeActivityEntity.FullAmountSentGiftList
                                    select t.ActivityName).Aggregate((string t, string n) => t + ", " + n);
                    HtmlGenericControl htmlGenericControl5 = this.liProductSendGifts;
                    HtmlGenericControl htmlGenericControl6 = this.liProductSendGifts2;
                    bool visible = htmlGenericControl6.Visible = true;
                    htmlGenericControl5.Visible = visible;
                    Literal literal5 = this.ltlProductSendGifts;
                    Literal literal6 = this.ltlProductSendGifts2;
                    string  text3    = literal5.Text = (literal6.Text = text7);
                }
                if (!string.IsNullOrEmpty(text6))
                {
                    HtmlGenericControl htmlGenericControl7 = this.liProductSendGifts;
                    HtmlGenericControl htmlGenericControl8 = this.liProductSendGifts2;
                    bool visible = htmlGenericControl8.Visible = true;
                    htmlGenericControl7.Visible = visible;
                    Literal literal7 = this.ltlProductSendGifts;
                    literal7.Text = literal7.Text + "</em>" + text6;
                    Literal literal8 = this.ltlProductSendGifts2;
                    literal8.Text = literal8.Text + "</em>" + text6;
                }
            }
        }
Пример #23
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            CouponItemInfo         item           = new CouponItemInfo();
            IList <CouponItemInfo> listCouponItem = new List <CouponItemInfo>();
            IList <Member>         memdersByNames = new List <Member>();

            if (rdoName.Checked)
            {
                if (!string.IsNullOrEmpty(txtMemberNames.Text.Trim()))
                {
                    IList <string> names    = new List <string>();
                    string[]       strArray = txtMemberNames.Text.Trim().Replace("\r\n", "\n").Replace("\n", "*").Split(new char[] { '*' });
                    for (int i = 0; i < strArray.Length; i++)
                    {
                        if (IsMembers(strArray[i]))
                        {
                            names.Add(strArray[i]);
                        }
                    }
                    memdersByNames = PromoteHelper.GetMemdersByNames(names);
                }
                string claimCode = string.Empty;
                foreach (Member member in memdersByNames)
                {
                    claimCode = Guid.NewGuid().ToString().Replace("-", "").Substring(0, 15);
                    item      = new CouponItemInfo(couponId, claimCode, new int?(member.UserId), member.Email, DateTime.Now);
                    listCouponItem.Add(item);
                }
                if (listCouponItem.Count <= 0)
                {
                    ShowMsg("你输入的会员名中没有一个正确的,请输入正确的会员名", false);
                    return;
                }
                CouponHelper.SendClaimCodes(couponId, listCouponItem);
                txtMemberNames.Text = string.Empty;
                ShowMsg(string.Format("此次发送操作已成功,优惠券发送数量:{0}", listCouponItem.Count), true);
            }
            if (rdoRank.Checked)
            {
                memdersByNames = PromoteHelper.GetMembersByRank(rankList.SelectedValue);
                string str2 = string.Empty;
                foreach (Member member2 in memdersByNames)
                {
                    str2 = Guid.NewGuid().ToString().Replace("-", "").Substring(0, 15);
                    item = new CouponItemInfo(couponId, str2, new int?(member2.UserId), member2.Email, DateTime.Now);
                    listCouponItem.Add(item);
                }
                if (listCouponItem.Count <= 0)
                {
                    ShowMsg("您选择的会员等级下面没有会员", false);
                }
                else
                {
                    CouponHelper.SendClaimCodes(couponId, listCouponItem);
                    txtMemberNames.Text = string.Empty;
                    ShowMsg(string.Format("此次发送操作已成功,优惠券发送数量:{0}", listCouponItem.Count), true);
                }
            }
        }
Пример #24
0
        private void btnSend_Click(object sender, System.EventArgs e)
        {
            CouponItemInfo item = new CouponItemInfo();

            System.Collections.Generic.IList <CouponItemInfo> list = new System.Collections.Generic.List <CouponItemInfo>();
            System.Collections.Generic.IList <Hidistro.Membership.Context.Member> list2 = new System.Collections.Generic.List <Hidistro.Membership.Context.Member>();
            if (this.rdoName.Checked)
            {
                if (!string.IsNullOrEmpty(this.txtMemberNames.Text.Trim()))
                {
                    System.Collections.Generic.IList <string> list3 = new System.Collections.Generic.List <string>();
                    string   text  = this.txtMemberNames.Text.Trim().Replace("\r\n", "\n");
                    string[] array = text.Replace("\n", "*").Split(new char[]
                    {
                        '*'
                    });
                    for (int i = 0; i < array.Length; i++)
                    {
                        list3.Add(array[i]);
                    }
                    list2 = PromoteHelper.GetMemdersByNames(list3);
                }
                string claimCode = string.Empty;
                foreach (Hidistro.Membership.Context.Member current in list2)
                {
                    claimCode = System.Guid.NewGuid().ToString().Replace("-", "").Substring(0, 15);
                    item      = new CouponItemInfo(this.couponId, claimCode, new int?(current.UserId), current.Username, current.Email, System.DateTime.Now);
                    list.Add(item);
                }
                if (list.Count <= 0)
                {
                    this.ShowMsg("你输入的会员名中没有一个正确的,请输入正确的会员名", false);
                    return;
                }
                CouponHelper.SendClaimCodes(this.couponId, list);
                this.txtMemberNames.Text = string.Empty;
                this.ShowMsg(string.Format("此次发送操作已成功,优惠券发送数量:{0}", list.Count), true);
            }
            if (this.rdoRank.Checked)
            {
                list2 = PromoteHelper.GetMembersByRank(this.rankList.SelectedValue);
                string claimCode2 = string.Empty;
                foreach (Hidistro.Membership.Context.Member current2 in list2)
                {
                    claimCode2 = System.Guid.NewGuid().ToString().Replace("-", "").Substring(0, 15);
                    item       = new CouponItemInfo(this.couponId, claimCode2, new int?(current2.UserId), current2.Username, current2.Email, System.DateTime.Now);
                    list.Add(item);
                }
                if (list.Count <= 0)
                {
                    this.ShowMsg("您选择的会员等级下面没有会员", false);
                    return;
                }
                CouponHelper.SendClaimCodes(this.couponId, list);
                this.txtMemberNames.Text = string.Empty;
                this.ShowMsg(string.Format("此次发送操作已成功,优惠券发送数量:{0}", list.Count), true);
            }
        }
Пример #25
0
 private void ProductBusiness()
 {
     if (this.ProductInfo != null)
     {
         HtmlInputHidden htmlInputHidden = this.hidden_SKUSubmitOrderProductId;
         int             num             = this.ProductInfo.ProductId;
         htmlInputHidden.Value = num.ToString();
         this.SKUSubmitOrderSelector.ProductId = this.ProductInfo.ProductId;
         Dictionary <string, SKUItem> dictionary;
         if (this.PreSaleId == 0)
         {
             dictionary = ProductBrowser.GetProductSkuSaleInfo(this.ProductInfo.ProductId, 0);
         }
         else
         {
             if (this.productPreSaleInfo != null)
             {
                 this.lblSKUSubmitOrderPrePrice.Text = ((this.productPreSaleInfo.Deposit > decimal.Zero) ? this.productPreSaleInfo.Deposit.F2ToString("f2") : ((decimal)this.productPreSaleInfo.DepositPercent * this.ProductInfo.MinSalePrice / 100m).F2ToString("f2"));
             }
             else
             {
                 this.lblSKUSubmitOrderPrePrice.Text = "0";
             }
             HtmlInputHidden htmlInputHidden2 = this.hidden_SKUSubmitOrderDepositPercent;
             num = this.productPreSaleInfo.DepositPercent;
             htmlInputHidden2.Value = num.ToString();
             HtmlInputHidden htmlInputHidden3 = this.hidden_SKUSubmitOrderPreSaleId;
             num = this.PreSaleId;
             htmlInputHidden3.Value = num.ToString();
             dictionary             = ProductBrowser.GetPreSaleProductSkuSaleInfo(this.ProductInfo.ProductId);
         }
         if (dictionary != null)
         {
             this.imgSKUSubmitOrderProduct.ImageUrl = Globals.GetImageServerUrl("http://", string.IsNullOrEmpty(this.ProductInfo.ThumbnailUrl160) ? base.site.DefaultProductThumbnail4 : this.ProductInfo.ThumbnailUrl160);
             this.lblSKUSubmitOrderPrice.Text       = this.ProductInfo.MinSalePrice.F2ToString("f2");
             Label label = this.lblSKUSubmitOrderStockNow;
             num        = this.ProductInfo.Stock;
             label.Text = num.ToString();
             this.hidden_SKUSubmitOrderSelectedSkuId.Value   = this.ProductInfo.DefaultSku.SkuId;
             this.hidden_SKUSubmitOrderProductMinPrice.Value = MemberProcessor.GetMemberPrice(this.ProductInfo).F2ToString("f2");
             HtmlInputHidden htmlInputHidden4 = this.hidden_SKUSubmitOrderProductStock;
             num = this.ProductInfo.Stock;
             htmlInputHidden4.Value = num.ToString();
             if (this.PreSaleId == 0)
             {
                 string phonePriceByProductId = PromoteHelper.GetPhonePriceByProductId(this.ProductInfo.ProductId);
                 if (!string.IsNullOrEmpty(phonePriceByProductId))
                 {
                     string          s                = phonePriceByProductId.Split(',')[0];
                     decimal         num2             = (this.ProductInfo.MinSalePrice - decimal.Parse(s) > decimal.Zero) ? (this.ProductInfo.MinSalePrice - decimal.Parse(s)) : decimal.Zero;
                     HtmlInputHidden htmlInputHidden5 = this.hidden_SKUSubmitOrderProductMinPrice;
                     Label           label2           = this.lblSKUSubmitOrderPrice;
                     string          text3            = htmlInputHidden5.Value = (label2.Text = num2.F2ToString("f2"));
                 }
             }
         }
     }
 }
Пример #26
0
 protected override void AttachChildControls()
 {
     this.litUserName                   = (Literal)this.FindControl("litUserName");
     this.rbtnPaymentMode               = (RadioButtonList)this.FindControl("rbtnPaymentMode");
     this.txtReChargeBalance            = (TextBox)this.FindControl("txtReChargeBalance");
     this.btnReCharge                   = ButtonManager.Create(this.FindControl("btnReCharge"));
     this.litUseableBalance             = (FormatedMoneyLabel)this.FindControl("litUseableBalance");
     this.litAccountAmount              = (FormatedMoneyLabel)this.FindControl("litAccountAmount");
     this.litRequestBalance             = (FormatedMoneyLabel)this.FindControl("litRequestBalance");
     this.litUseableBalance1            = (FormatedMoneyLabel)this.FindControl("litUseableBalance1");
     this.spaccountamount               = (HtmlGenericControl)this.FindControl("spaccountamount");
     this.sprequestbalace               = (HtmlGenericControl)this.FindControl("sprequestbalace");
     this.link_balancedraw              = (HtmlAnchor)this.FindControl("link_balancedraw");
     this.spadvancetip                  = (HtmlGenericControl)this.FindControl("spadvancetip");
     this.divReCharge                   = (HtmlGenericControl)this.FindControl("divReCharge");
     this.divReChargeGift               = (HtmlGenericControl)this.FindControl("divReChargeGift");
     this.rptReChargeGift               = (ThemedTemplatedRepeater)this.FindControl("rptReChargeGift");
     this.hidRechargeMoney              = (HtmlInputHidden)this.FindControl("hidRechargeMoney");
     this.rbtnPaymentMode.RepeatLayout  = RepeatLayout.Table;
     this.rbtnPaymentMode.RepeatColumns = 6;
     PageTitle.AddSiteNameTitle("预付款充值");
     this.btnReCharge.Click += this.btnReCharge_Click;
     if (!this.Page.IsPostBack)
     {
         MemberInfo user = HiContext.Current.User;
         if (!user.IsOpenBalance || string.IsNullOrWhiteSpace(user.TradePassword))
         {
             this.Page.Response.Redirect($"/user/OpenBalance.aspx?ReturnUrl={HttpContext.Current.Request.Url}");
         }
         this.BindPaymentMode();
         this.litUserName.Text         = HiContext.Current.User.UserName;
         this.litUseableBalance.Money  = user.Balance - user.RequestBalance;
         this.litAccountAmount.Money   = user.Balance;
         this.litRequestBalance.Money  = user.RequestBalance;
         this.litUseableBalance1.Money = user.Balance - user.RequestBalance;
         HtmlGenericControl htmlGenericControl  = this.spaccountamount;
         HtmlGenericControl htmlGenericControl2 = this.sprequestbalace;
         HtmlAnchor         htmlAnchor          = this.link_balancedraw;
         bool flag    = htmlAnchor.Visible = HiContext.Current.SiteSettings.EnableBulkPaymentAdvance;
         bool visible = htmlGenericControl2.Visible = flag;
         htmlGenericControl.Visible = visible;
         if (HiContext.Current.SiteSettings.IsOpenRechargeGift)
         {
             List <RechargeGiftInfo> rechargeGiftItemList = PromoteHelper.GetRechargeGiftItemList();
             this.rptReChargeGift.DataSource = rechargeGiftItemList;
             this.rptReChargeGift.DataBind();
             this.divReCharge.Visible     = false;
             this.divReChargeGift.Visible = true;
             this.spadvancetip.Visible    = true;
         }
         else
         {
             this.divReCharge.Visible     = true;
             this.divReChargeGift.Visible = false;
             this.spadvancetip.Visible    = !HiContext.Current.SiteSettings.EnableBulkPaymentAdvance;
         }
     }
 }
        protected override void AttachChildControls()
        {
            int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId);
            this.keyWord     = this.Page.Request.QueryString["keyWord"];
            this.imgUrl      = (HiImage)this.FindControl("imgUrl");
            this.litContent  = (Literal)this.FindControl("litContent");
            this.rptProducts = (AppshopTemplatedRepeater)this.FindControl("rptCountDownProducts");
            this.txtTotal    = (HtmlInputHidden)this.FindControl("txtTotal");
            string text     = this.Page.Request["lat"].ToNullString();
            string text2    = this.Page.Request["lng"].ToNullString();
            string cityName = this.Page.Request["city"].ToNullString();
            string address  = this.Page.Request["address"].ToNullString();

            if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2))
            {
                RegionInfo regionByCityAddress = RegionHelper.GetRegionByCityAddress(cityName, address);
                if (regionByCityAddress != null)
                {
                    int num = regionByCityAddress.RegionId;
                    if (regionByCityAddress.FullRegionPath.Split(',').Length >= 2)
                    {
                        num = regionByCityAddress.FullRegionPath.Split(',')[1].ToInt(0);
                    }
                    WebHelper.SetCookie("UserCoordinateCookie", "CityRegionId", num.ToNullString(), null);
                    WebHelper.SetCookie("UserCoordinateCookie", "RegionId", regionByCityAddress.RegionId.ToNullString(), null);
                    WebHelper.SetCookie("UserCoordinateCookie", "FullRegionPath", regionByCityAddress.FullRegionPath, null);
                }
                WebHelper.SetCookie("UserCoordinateCookie", "NewCoordinate", $"{text},{text2}", null);
            }
            this.rptCategories = (AppshopTemplatedRepeater)this.FindControl("rptCategories");
            if (this.rptCategories != null)
            {
                IEnumerable <CategoryInfo> subCategories = CatalogHelper.GetSubCategories(this.categoryId);
                this.rptCategories.DataSource = subCategories;
                this.rptCategories.DataBind();
            }
            int page = default(int);

            if (!int.TryParse(this.Page.Request.QueryString["page"], out page))
            {
                page = 1;
            }
            int size = default(int);

            if (!int.TryParse(this.Page.Request.QueryString["size"], out size))
            {
                size = 10;
            }
            int       storeId = this.Page.Request.QueryString["StoreId"].ToInt(0);
            int       num2    = default(int);
            DataTable countDownProductList = PromoteHelper.GetCountDownProductList(this.categoryId, this.keyWord, page, size, storeId, out num2, false);

            this.rptProducts.ItemDataBound += this.rptProduct_ItemDataBound;
            this.rptProducts.DataSource     = countDownProductList;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(num2.ToString());
            PageTitle.AddSiteNameTitle("限时抢购");
        }
Пример #28
0
        private void btnUpdateGroupBuy_Click(object sender, EventArgs e)
        {
            CountDownInfo info2 = new CountDownInfo();

            info2.CountDownId = this.countDownId;
            CountDownInfo countDownInfo = info2;
            string        str           = string.Empty;

            if (this.dropGroupBuyProduct.SelectedValue > 0)
            {
                if ((PromoteHelper.GetCountDownInfo(this.countDownId).ProductId != this.dropGroupBuyProduct.SelectedValue.Value) && PromoteHelper.ProductCountDownExist(this.dropGroupBuyProduct.SelectedValue.Value))
                {
                    this.ShowMsg("已经存在此商品的限时抢购活动", false);
                    return;
                }
                countDownInfo.ProductId = this.dropGroupBuyProduct.SelectedValue.Value;
            }
            else
            {
                str = str + Formatter.FormatErrorMessage("请选择限时抢购商品");
            }
            if (!this.calendarEndDate.SelectedDate.HasValue)
            {
                str = str + Formatter.FormatErrorMessage("请选择结束日期");
            }
            else
            {
                countDownInfo.EndDate = this.calendarEndDate.SelectedDate.Value;
            }
            if (!string.IsNullOrEmpty(this.txtPrice.Text))
            {
                decimal num;
                if (decimal.TryParse(this.txtPrice.Text.Trim(), out num))
                {
                    countDownInfo.CountDownPrice = num;
                }
                else
                {
                    str = str + Formatter.FormatErrorMessage("价格填写格式不正确");
                }
            }
            if (!string.IsNullOrEmpty(str))
            {
                this.ShowMsg(str, false);
            }
            else
            {
                countDownInfo.Content = Globals.HtmlEncode(this.txtContent.Text);
                if (PromoteHelper.UpdateCountDown(countDownInfo))
                {
                    this.ShowMsg("编辑限时抢购活动成功", true);
                }
                else
                {
                    this.ShowMsg("编辑限时抢购活动失败", true);
                }
            }
        }
Пример #29
0
 public void Clear(HttpContext context)
 {
     if (PromoteHelper.DeletePromotionProducts(this.activityId, null))
     {
         base.ReturnSuccessResult(context, "成功清空了促销活动的所有商品", 0, true);
         return;
     }
     throw new HidistroAshxException("清空失败");
 }
Пример #30
0
 private void grdCutDownList_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         CutDownInfo        cutDown = PromoteHelper.GetCutDown((int)this.grdCutDownList.DataKeys[e.Row.RowIndex].Value);
         FormatedMoneyLabel label   = (FormatedMoneyLabel)e.Row.FindControl("lblCurrentPrice");
         label.Money = cutDown.CurrentPrice;
     }
 }