protected void btSearchOrderNum_Click(object sender, EventArgs e)
    {
        int orderNumber;

        // Take customNumber from screen
        try
        {
            orderNumber = Int32.Parse(tbSearchOrderNum.Text);
        }
        catch
        {
            orderNumber = 0;
        }
        // Load the productbacklog according to productbacklogid
        lbPurchaseErr.Text = "";                          // Empty error text
        //System.Data.DataSet dataset = null;         // Null dataSet is default

        BuyerService.serBuyer orderdetails = new BuyerService.serBuyer();
        DataSet dataset = orderdetails.Buyer_GetPurchase(orderNumber);

        // Create a DataSet from Database

        if (dataset != null)
        {
            // A user can select a person from the grid
            GridViewPurchases.AutoGenerateSelectButton = true;
            // Set the DataSet to cotrols DataSource
            GridViewPurchases.DataSource = dataset;
            // Bind values to controls rows and columns
            GridViewPurchases.DataBind();
            // Set control visible

            GridViewPurchases.Visible = true;
        }
        else
        {
            //lbErrorViewPBI.Text = "Sql sentence was not successful.";
        }
    }
    protected void ListBoxMerchant_SelectedIndexChanged(object sender, EventArgs e)
    {
        string bizname;

        // Take customNumber from screen
        try
        {
            bizname = ListBoxMerchant.Text;
        }
        catch
        {
            bizname = "";
        }
        // Load the productbacklog according to productbacklogid
        lbPurchaseErr.Text = "";                          // Empty error text
        //System.Data.DataSet dataset = null;         // Null dataSet is default

        BuyerService.serBuyer merchant = new BuyerService.serBuyer();
        DataSet dataset = merchant.Buyer_GetPurchaseByMerchantbname(bizname);

        // Create a DataSet from Database

        if (dataset != null)
        {
            // A user can select a person from the grid
            GridViewPurchases.AutoGenerateSelectButton = true;
            // Set the DataSet to cotrols DataSource
            GridViewPurchases.DataSource = dataset;
            // Bind values to controls rows and columns
            GridViewPurchases.DataBind();
            // Set control visible

            GridViewPurchases.Visible = true;
        }
        else
        {
            //lbErrorViewPBI.Text = "Sql sentence was not successful.";
        }
    }