コード例 #1
0
    protected void BtnLow_Click(object sender, EventArgs e)
    {
        Object ProductLowIndividual = new Object();

        ProductLowIndividual.Product_Name = HiddenProductName.Value;
        DataTable dt = BSLAYER.IndividualProductLow(ProductLowIndividual);
        int       r  = dt.Rows.Count;

        if (r < 1)
        {
            PanelAlert.Visible = true;
        }
        else
        {
            PanelAlert.Visible   = false;
            DataList1.DataSource = dt;
            DataList1.DataBind();
        }
    }
コード例 #2
0
 protected void DdlSort_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (DdlSort.SelectedValue == "Price-Low To High")
     {
         Object ProductLowIndividual = new Object();
         ProductLowIndividual.Product_Name = HiddenProductName.Value;
         DataTable dt = BSLAYER.IndividualProductLow(ProductLowIndividual);
         int       r  = dt.Rows.Count;
         if (r < 1)
         {
             PanelAlert.Visible = true;
         }
         else
         {
             PanelAlert.Visible   = false;
             DataList1.DataSource = dt;
             DataList1.DataBind();
         }
     }
     else if (DdlSort.SelectedValue == "Price-High To Low")
     {
         Object ProductHighIndividual = new Object();
         ProductHighIndividual.Product_Name = HiddenProductName.Value;
         DataTable dt = BSLAYER.IndividualProductHigh(ProductHighIndividual);
         int       r  = dt.Rows.Count;
         if (r < 1)
         {
             PanelAlert.Visible = true;
         }
         else
         {
             PanelAlert.Visible   = false;
             DataList1.DataSource = dt;
             DataList1.DataBind();
         }
     }
 }