Ejemplo n.º 1
0
        /// <summary>
        /// Set Grid Data source
        /// </summary>
        /// <param name="addRow"></param>
        /// <param name="deleteRow"></param>e
        protected void BindGrid(bool showRecentRecords)
        {
            string district  = String.Empty;
            string county    = String.Empty;
            string subCounty = String.Empty;
            string parish    = String.Empty;
            string village   = String.Empty;

            if (ddlDistrict.SelectedIndex > 0)
            {
                district = ddlDistrict.SelectedItem.Text;
            }
            if (ddlCounty.SelectedIndex > 0)
            {
                county = ddlCounty.SelectedItem.Text;
            }
            if (ddlSubCounty.SelectedIndex > 0)
            {
                subCounty = ddlSubCounty.SelectedItem.Text;
            }
            if (ddlParish.SelectedIndex > 0)
            {
                parish = ddlParish.SelectedItem.Text;
            }
            if (ddlVillage.SelectedIndex > 0)
            {
                village = ddlVillage.SelectedItem.Text;
            }

            PaymentBLL objPAPLogic = new PaymentBLL();

            grdPAPs.DataSource = objPAPLogic.getCompensationPaymentExport(
                Convert.ToInt32(Session["PROJECT_ID"]),
                txtPAPName.Text.Trim(),
                txtPlotReference.Text.Trim(),
                district,
                county,
                subCounty,
                parish,
                village);
            grdPAPs.DataBind();

            if (grdPAPs.Rows.Count > 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "showExport", "ShowExport(1);", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "showExport", "ShowExport(0);", true);
            }
        }