protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(base.Request["isCallback"]) && (base.Request["isCallback"] == "true")) { int num; if (int.TryParse(base.Request["productId"], out num)) { string priceByProductId = PromoteHelper.GetPriceByProductId(num); if (priceByProductId.Length > 0) { base.Response.Clear(); base.Response.ContentType = "application/json"; base.Response.Write("{ "); base.Response.Write("\"Status\":\"OK\","); base.Response.Write(string.Format("\"Price\":\"{0}\"", decimal.Parse(priceByProductId).ToString("F2"))); base.Response.Write("}"); base.Response.End(); } } } else if (!int.TryParse(base.Request.QueryString["cutDownId"], out this.cutDownId)) { base.GotoResourceNotFound(); } else { this.btnUpdateCutDown.Click += new EventHandler(this.btnUpdateCutDown_Click); if (!base.IsPostBack) { this.dropCutDownProduct.DataBind(); this.dropCategories.DataBind(); this.HourDropDownList1.DataBind(); this.drophours.DataBind(); CutDownInfo cutDown = PromoteHelper.GetCutDown(this.cutDownId); if (PromoteHelper.GetCutDownOrderCount(this.cutDownId) > 0) { this.dropCutDownProduct.Enabled = false; } if (cutDown == null) { base.GotoResourceNotFound(); } else { this.LoadCutDown(cutDown); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(base.Request["isCallback"]) && (base.Request["isCallback"] == "true")) { int num; if (int.TryParse(base.Request["productId"], out num)) { string priceByProductId = PromoteHelper.GetPriceByProductId(num); if (priceByProductId.Length > 0) { base.Response.Clear(); base.Response.ContentType = "application/json"; base.Response.Write("{ "); base.Response.Write("\"Status\":\"OK\","); base.Response.Write(string.Format("\"Price\":\"{0}\"", decimal.Parse(priceByProductId).ToString("F2"))); base.Response.Write("}"); base.Response.End(); } } } else if (!int.TryParse(base.Request.QueryString["groupBuyId"], out this.groupBuyId)) { base.GotoResourceNotFound(); } else { this.btnUpdateGroupBuy.Click += new EventHandler(this.btnUpdateGroupBuy_Click); this.btnFail.Click += new EventHandler(this.btnFail_Click); this.btnSuccess.Click += new EventHandler(this.btnSuccess_Click); this.btnFinish.Click += new EventHandler(this.btnFinish_Click); if (!base.IsPostBack) { this.dropGroupBuyProduct.DataBind(); this.dropCategories.DataBind(); this.HourDropDownList1.DataBind(); this.drophours.DataBind(); GroupBuyInfo groupBuy = PromoteHelper.GetGroupBuy(this.groupBuyId); if (PromoteHelper.GetOrderCount(this.groupBuyId) > 0) { this.dropGroupBuyProduct.Enabled = false; } if (groupBuy == null) { base.GotoResourceNotFound(); } else { if (groupBuy.Status == GroupBuyStatus.EndUntreated) { this.btnFail.Visible = true; this.btnSuccess.Visible = true; } if (groupBuy.Status == GroupBuyStatus.UnderWay) { this.btnFinish.Visible = true; } this.LoadGroupBuy(groupBuy); } } } }
protected void Page_Load(object sender, EventArgs e) { this.productId = this.Page.Request["productId"].ToInt(0); if (!string.IsNullOrEmpty(base.Request["isCallback"]) && base.Request["isCallback"] == "true") { if (int.TryParse(base.Request["productId"], out this.productId)) { string priceByProductId = PromoteHelper.GetPriceByProductId(this.productId); if (priceByProductId.Length > 0) { base.Response.Clear(); base.Response.ContentType = "application/json"; base.Response.Write("{ "); base.Response.Write("\"Status\":\"OK\","); base.Response.Write(string.Format("\"Price\":\"{0}\"", decimal.Parse(priceByProductId).F2ToString("f2"))); base.Response.Write("}"); base.Response.End(); } } } else if (!int.TryParse(base.Request.QueryString["groupBuyId"], out this.groupBuyId)) { base.GotoResourceNotFound(); } else { this.hfGroupId.Value = base.Request.QueryString["groupBuyId"].ToString(); this.btnUpdateGroupBuy.Click += this.btnUpdateGroupBuy_Click; this.btnFail.Click += this.btnFail_Click; this.btnSuccess.Click += this.btnSuccess_Click; this.btnFinish.Click += this.btnFinish_Click; this.BindProduct(); this.SetDateControl(); if (!base.IsPostBack) { GroupBuyInfo groupBuy = PromoteHelper.GetGroupBuy(this.groupBuyId); if (PromoteHelper.GetOrderCount(this.groupBuyId) > 0) { this.selectProductA.Disabled = true; } if (groupBuy == null) { base.GotoResourceNotFound(); } else { if (groupBuy.Status == GroupBuyStatus.EndUntreated) { this.btnFail.Visible = true; this.btnSuccess.Visible = true; this.selectProductA.Disabled = true; this.calendarStartDate.Enabled = false; this.calendarEndDate.Enabled = false; this.txtNeedPrice.Enabled = false; this.txtMaxCount.Enabled = false; this.txtCount.Enabled = false; this.txtPrice.Enabled = false; this.txtContent.Enabled = false; this.btnUpdateGroupBuy.Enabled = false; } if (groupBuy.Status == GroupBuyStatus.UnderWay) { this.selectProductA.Disabled = true; this.btnFinish.Visible = true; } this.LoadGroupBuy(groupBuy); } } } }