Example #1
0
 protected void gvDividendPendingH_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     //to perform paging
     gvDividendPendingH.PageIndex = e.NewPageIndex;
     if (tbxName.Text == "")
     {
         //to get all the data from dividendDB by calling the method
         List <Dividend> dvPendingList = DividendDB.getAllHotelPendingDividends();
         gvDividendPendingH.DataSource = dvPendingList;
         gvDividendPendingH.DataBind();
     }
     else
     {
         //to get all the data from dividendDB by calling the method and search name
         List <Dividend> dvPendingList = DividendDB.getAllHotelPendingDividendsByName(tbxName.Text);
         gvDividendPendingH.DataSource = dvPendingList;
         gvDividendPendingH.DataBind();
     }
 }
Example #2
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        gvDividendPendingH.Visible = false;
        gvDividendPendingA.Visible = false;
        gvDividendPaidH.Visible    = false;
        gvDividendPaidA.Visible    = false;
        pnlEdit.Visible            = false;
        if (ddlSP.SelectedItem.Text == "Hotel Owner")
        {
            //show the related grid view
            gvDividendPendingH.Visible = true;
            gvDividendPaidH.Visible    = true;

            //to get all the data from dividendDB by calling the method
            List <Dividend> dvPendingList = DividendDB.getAllHotelPendingDividends();
            gvDividendPendingH.DataSource = dvPendingList;
            gvDividendPendingH.DataBind();

            //to get all the data from dividendDB by calling the method
            List <Dividend> dvPaidList = DividendDB.getAllHotelPaidDividends();
            gvDividendPaidH.DataSource = dvPaidList;
            gvDividendPaidH.DataBind();
        }
        else if (ddlSP.SelectedItem.Text == "Attraction Owner")
        {
            //show the related grid view
            gvDividendPendingA.Visible = true;
            gvDividendPaidA.Visible    = true;

            //to get all the data from dividendDB by calling the method
            List <Dividend> dvPendingList = DividendDB.getAllAttractionPendingDividends();
            gvDividendPendingA.DataSource = dvPendingList;
            gvDividendPendingA.DataBind();

            //to get all the data from dividendDB by calling the method
            List <Dividend> dvPaidList = DividendDB.getAllAttractionPaidDividends();
            gvDividendPaidA.DataSource = dvPaidList;
            gvDividendPaidA.DataBind();
        }
    }