Пример #1
0
    private void BindDistrictOfficers(string position)
    {
        DataTable    dt  = new DataTable();
        DBconnection obj = new DBconnection();

        if (position == "All")
        {
            obj.SetCommandQry = "SELECT * FROM [View_DistPositionHeldMembers] where district_no='3141' and years='2016 - 2017' order by Name";
        }
        else
        {
            obj.SetCommandQry = "SELECT * FROM [View_DistPositionHeldMembers] where district_no='3141' and years='2016 - 2017' and avenue='" + position + "' order by Name";
        }
        dt = obj.ExecuteTable();
        if (dt.Rows.Count > 0)
        {
            PresidentGrid.Visible      = true;
            PresidentGrid.DataSourceID = string.Empty;
            PresidentGrid.DataSource   = dt;
            PresidentGrid.Rebind();
        }
        else
        {
            PresidentGrid.Visible = false;
        }
    }
Пример #2
0
    private void BindPresident()
    {
        DataTable    dt  = new DataTable();
        DBconnection obj = new DBconnection();

        obj.SetCommandQry = "select * from View_BodMembers where district_no='3141' and designation='President' and year='2016 - 2017' and MemType='Active' order by Name";

        dt = obj.ExecuteTable();
        if (dt.Rows.Count > 0)
        {
            PresidentGrid.Visible      = true;
            PresidentGrid.DataSourceID = string.Empty;
            PresidentGrid.DataSource   = dt;
            PresidentGrid.Rebind();
        }
        else
        {
            PresidentGrid.Visible = false;
        }
    }