コード例 #1
0
    //private void BindYears()
    //{

    //    try
    //    {
    //        int dt = DateTime.Now.Year;
    //        int m = DateTime.Now.Month;
    //        if (m > 6 && m <= 12)
    //            dt = dt + 1;

    //        for (Int32 i = Convert.ToInt32(dt + 2); i >= 2017; i--)
    //        {
    //            string dtt = i + " - " + (i + 1);
    //            DDLYears.Items.Add(dtt.ToString());
    //        }

    //    }
    //    catch (Exception E)
    //    {
    //        Response.Write(E.Message.ToString());
    //    }
    //}
    //private void BindDistrictNo()
    //{
    //    MastersBLL obj = new MastersBLL();
    //    DataTable dt = new DataTable();
    //    dt = obj.GetDistrictNoList();

    //    ddlDistNo.DataTextField = "district_no";
    //    ddlDistNo.DataValueField = "id";

    //    ddlDistNo.DataSource = dt;
    //    ddlDistNo.DataBind();
    //}



    //protected void ddlDistNo_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    int districtNo = int.Parse(ddlDistNo.SelectedItem.Text.ToString());
    //    BindVoteResultByPref1(districtNo);
    //    BindVoteResultByPref2(districtNo);
    //    BindVoteResultByPref3(districtNo);
    //}
    private void BindElectionName()
    {
        MastersBLL obj = new MastersBLL();
        DataTable  dt  = new DataTable();

        dt = obj.GetElectionNameList();

        ddlElectionName.DataTextField  = "election_name";
        ddlElectionName.DataValueField = "id";

        ddlElectionName.DataSource = dt;
        ddlElectionName.DataBind();
        ddlElectionName.Items.Insert(0, "Select");
    }
コード例 #2
0
    //private void BindElectionName(int districtNo)
    //{
    //    MastersBLL obj = new MastersBLL();
    //    DataTable dt = new DataTable();
    //    obj.DistrictNo = districtNo;
    //    dt = obj.GetElectionNameListByDist();
    //    if (dt.Rows.Count > 0)
    //    {
    //        ddlElectionName.DataTextField = "election_name";
    //        ddlElectionName.DataValueField = "id";

    //        ddlElectionName.DataSource = dt;
    //        ddlElectionName.DataBind();
    //        ddlElectionName.Items.Insert(0, "Select");
    //    }
    //    else
    //    {
    //        ddlElectionName.Items.Clear();
    //        ddlElectionName.Items.Insert(0, "Select");
    //        RadGrid4.Visible = false;
    //    }
    //}

    private void BindElectionName()
    {
        MastersBLL obj = new MastersBLL();
        DataTable  dt  = new DataTable();

        dt = obj.GetElectionNameList();
        if (dt.Rows.Count > 0)
        {
            RadGrid4.Visible = true;
            ddlElectionName.DataTextField  = "election_name";
            ddlElectionName.DataValueField = "id";

            ddlElectionName.DataSource = dt;
            ddlElectionName.DataBind();
            ddlElectionName.Items.Insert(0, "Select");
        }
        else
        {
            ddlElectionName.Items.Clear();
            ddlElectionName.Items.Insert(0, "Select");
            RadGrid4.Visible = false;
        }
    }