Пример #1
0
 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);
             }
         }
     }
 }