コード例 #1
0
ファイル: EditMyGroupBuy.cs プロジェクト: uvbs/eshopSanQiang
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!string.IsNullOrEmpty(base.Request["isCallback"]) && base.Request["isCallback"] == "true")
     {
         int productId;
         if (int.TryParse(base.Request["productId"], out productId))
         {
             string priceByProductId = SubsitePromoteHelper.GetPriceByProductId(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).ToString("F2")));
                 base.Response.Write("}");
                 base.Response.End();
                 return;
             }
         }
     }
     else
     {
         if (!int.TryParse(base.Request.QueryString["groupBuyId"], out this.groupBuyId))
         {
             base.GotoResourceNotFound();
             return;
         }
         this.btnUpdateGroupBuy.Click += new System.EventHandler(this.btnUpdateGroupBuy_Click);
         this.btnFail.Click           += new System.EventHandler(this.btnFail_Click);
         this.btnSuccess.Click        += new System.EventHandler(this.btnSuccess_Click);
         this.btnFinish.Click         += new System.EventHandler(this.btnFinish_Click);
         if (!base.IsPostBack)
         {
             this.dropGroupBuyProduct.DataBind();
             this.dropCategories.DataBind();
             this.HourDropDownList1.DataBind();
             this.drophours.DataBind();
             GroupBuyInfo groupBuy = SubsitePromoteHelper.GetGroupBuy(this.groupBuyId);
             if (SubsitePromoteHelper.GetOrderCount(this.groupBuyId) > 0)
             {
                 this.dropGroupBuyProduct.Enabled = false;
             }
             if (groupBuy == null)
             {
                 base.GotoResourceNotFound();
                 return;
             }
             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);
         }
     }
 }