Пример #1
0
    private void bindWilayah()
    {
        DataSet Ds = new DataSet();

        try
        {
            string         com  = "select distinct wilayah_code,wilayah_name from Ref_Cawangan where kavasan_name='" + DD_kaw.SelectedItem.Text + "' order by wilayah_name asc ";
            SqlDataAdapter adpt = new SqlDataAdapter(com, con);
            DataTable      dt   = new DataTable();
            adpt.Fill(dt);
            if (dt != null)
            {
                DD_wilayah.DataSource     = dt;
                DD_wilayah.DataTextField  = "wilayah_name";
                DD_wilayah.DataValueField = "wilayah_code";
                DD_wilayah.DataBind();
                DD_wilayah.Items.Insert(0, new ListItem("--- PILIH ---", ""));
            }
            else
            {
                DD_wilayah.Items.Insert(0, new ListItem("--- PILIH ---", ""));
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        string script1 = "$(function () {$('.select2').select2()  });";

        ScriptManager.RegisterStartupScript(this, this.GetType(), "", script1, true);
    }
Пример #2
0
    private void bindWilayah()
    {
        DataSet Ds = new DataSet();

        try
        {
            string         com  = "select distinct wilayah_code,wilayah_name from Ref_Cawangan where kavasan_name='" + DD_kaw.SelectedItem.Text + "' order by wilayah_name asc ";
            SqlDataAdapter adpt = new SqlDataAdapter(com, con);
            DataTable      dt   = new DataTable();
            adpt.Fill(dt);
            if (dt != null)
            {
                DD_wilayah.DataSource     = dt;
                DD_wilayah.DataTextField  = "wilayah_name";
                DD_wilayah.DataValueField = "wilayah_code";
                DD_wilayah.DataBind();
                DD_wilayah.Items.Insert(0, new ListItem("--- PILIH ---", ""));
            }
            else
            {
                DD_wilayah.Items.Insert(0, new ListItem("--- PILIH ---", ""));
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #3
0
    protected void ddkaw_SelectedIndexChanged(object sender, EventArgs e)
    {
        //-Pusat---------------------------------------------------------------------------------
        string cmd6 = "select distinct wilayah_code,wilayah_name from  Ref_Cawangan where cawangan_code='" + DD_cawangan.SelectedItem.Value + "'";

        con.Open();
        SqlDataAdapter adapterP = new SqlDataAdapter(cmd6, con);

        adapterP.Fill(wilayah);

        DD_wilayah.DataSource     = wilayah;
        DD_wilayah.DataTextField  = "wilayah_name";
        DD_wilayah.DataValueField = "wilayah_code";
        DD_wilayah.DataBind();
        //ddPusat.Items.RemoveAt(0); //remove 'Semua Wilayah'
        con.Close();

        DD_wilayah.Items.Insert(0, new ListItem("--- PILIH ---", ""));
    }
Пример #4
0
    protected void DD_kaw_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataSet Ds = new DataSet();

        try
        {
            string         com  = "select distinct wilayah_code,wilayah_name from Ref_Cawangan where kavasan_name='" + DD_kaw.SelectedItem.Text + "' order by wilayah_name asc ";
            SqlDataAdapter adpt = new SqlDataAdapter(com, con);
            DataTable      dt   = new DataTable();
            adpt.Fill(dt);
            DD_wilayah.DataSource     = dt;
            DD_wilayah.DataTextField  = "wilayah_name";
            DD_wilayah.DataValueField = "wilayah_code";
            DD_wilayah.DataBind();
            DD_wilayah.Items.Insert(0, new ListItem("--- PILIH ---", ""));
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #5
0
    void wBind()
    {
        DataSet Ds = new DataSet();

        try
        {
            SqlConnection  con  = new SqlConnection(conString);
            string         com  = "select Wilayah_Code,Wilayah_Name from ref_wilayah order by Wilayah_Name ASC";
            SqlDataAdapter adpt = new SqlDataAdapter(com, con);
            DataTable      dt   = new DataTable();
            adpt.Fill(dt);
            DD_wilayah.DataSource = dt;
            DD_wilayah.DataBind();
            DD_wilayah.DataTextField  = "Wilayah_Name";
            DD_wilayah.DataValueField = "Wilayah_Code";
            DD_wilayah.DataBind();
            DD_wilayah.Items.Insert(0, new ListItem("--- PILIH ---", ""));
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #6
0
    protected void DD_kaw_SelectedIndexChanged(object sender, EventArgs e)
    {
        string script1 = "$(function () { $('#GridView1').prepend($('<thead></thead>').append($(this).find('tr:first'))).DataTable({ 'responsive': true, 'sPaginationType': 'full_numbers'   }); $('.select2').select2() });";

        ScriptManager.RegisterStartupScript(this, this.GetType(), "", script1, true);
        DataSet Ds = new DataSet();

        try
        {
            string         com  = "select distinct wilayah_code,wilayah_name from Ref_Cawangan where kavasan_name='" + DD_kaw.SelectedItem.Text + "' order by wilayah_name asc ";
            SqlDataAdapter adpt = new SqlDataAdapter(com, con);
            DataTable      dt   = new DataTable();
            adpt.Fill(dt);
            DD_wilayah.DataSource     = dt;
            DD_wilayah.DataTextField  = "wilayah_name";
            DD_wilayah.DataValueField = "wilayah_code";
            DD_wilayah.DataBind();
            DD_wilayah.Items.Insert(0, new ListItem("--- PILIH ---", ""));
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }