Exemplo n.º 1
0
        protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
        {
            int sId = Convert.ToInt32(DropDownList2.SelectedValue);

            userlinqDataContext db = new userlinqDataContext();

            var q = from x in db.cities
                    where x.stateId == sId
                    select x;

            DropDownList3.DataSource     = q;
            DropDownList3.DataTextField  = "cityname";
            DropDownList3.DataValueField = "cityId";
            DropDownList3.DataBind();
            DropDownList3.Items.Insert(0, new ListItem("-select-", "0"));
        }
        protected void wardChosen()
        {
            int        departmentId = DropDownList1.SelectedIndex + 6000000;
            SqlCommand cmd          = new SqlCommand("SELECT RmId from Hos_Room where RmType = 1 and RmDep = "
                                                     + departmentId
                                                     , conn);

            conn.Open();
            SqlDataReader reader = cmd.ExecuteReader();

            DropDownList3.DataSource     = reader;
            DropDownList3.DataTextField  = "RmId";
            DropDownList3.DataValueField = "RmId";
            DropDownList3.DataBind();
            conn.Close();
        }
Exemplo n.º 3
0
        protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList3.Items.Clear();
            int dep       = Convert.ToInt32(DropDownList2.SelectedValue);
            var stateid   = from Tbl_department in db.Tbl_department where Tbl_department.Level_ID.Equals(dep) select new { Tbl_department.Name_En, Tbl_department.Department_ID };
            var statename = stateid.ToList();

            if (statename.Count > 0)
            {
                DropDownList3.DataValueField = "Department_ID";
                DropDownList3.DataTextField  = "Name_En";
                DropDownList3.DataSource     = statename;
                DropDownList3.DataBind();
                DropDownList3.Items.Insert(0, "--- select dep----");
            }
        }
        protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings[1].ToString());

            conn.Open();

            SqlCommand cmd = new SqlCommand("select * from CityTable where StateId='" + DropDownList2.SelectedValue + "'", conn);

            SqlDataReader dr = cmd.ExecuteReader();

            DropDownList3.DataSource     = dr;
            DropDownList3.DataTextField  = "City";
            DropDownList3.DataValueField = "CityId";
            DropDownList3.DataBind();
            conn.Close();
        }
        protected void AdminDiscounts(object sender, EventArgs e)
        {
            myDAL     objmyDAL = new myDAL();
            DataTable GetData  = new DataTable();
            int       AdminID  = (int)Session["ID"];

            objmyDAL.GetDiscountData(ref GetData, AdminID);
            DropDownList3.DataSource     = GetData;
            DropDownList3.DataTextField  = "VoucherID";
            DropDownList3.DataValueField = "VoucherID";
            if (GetData.Rows.Count > 0)
            {
                DropDownList3.DataBind();
                AdminDiscountDetail(sender, e);
            }
        }
Exemplo n.º 6
0
        private void filldrop()
        {
            DropDownList2.DataSource    = getuserdata();
            DropDownList2.DataTextField = "CourseId";
            DropDownList2.DataBind();


            DropDownList3.DataSource    = getsectiondata();
            DropDownList3.DataTextField = "SectionId";
            DropDownList3.DataBind();

            DropDownList1.DataSource    = getTeacherdata();
            DropDownList1.DataTextField = "TeacherId";

            DropDownList1.DataBind();
        }
Exemplo n.º 7
0
    private void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        var bl = new DS_SysProductCategory_Br();

        if (DropDownList2.SelectedValue.Equals("0"))
        {
            DropDownList3.Items.Clear();
        }
        else
        {
            DropDownList3.DataSource = bl.Query("parentid=" + DropDownList2.SelectedValue, "px");
            DropDownList3.DataBind();
        }

        DropDownList3.Items.Insert(0, new ListItem("--三级类--", "0"));
    }
Exemplo n.º 8
0
 protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
 {
     if (RadioButton2.Checked)
     {
         DropDownList3.Enabled = true;
         com.CommandText       = "select distinct dept_name , s.dept_id  from Departments d ,[st-Act] sa, student s where d.Dept_id = s.Dept_id and s.st_id = sa.st_id ";
         com.Connection        = con;
         con.Open();
         SqlDataReader dr3 = com.ExecuteReader();
         DropDownList3.DataSource     = dr3;
         DropDownList3.DataTextField  = ("dept_name");
         DropDownList3.DataValueField = ("dept_id");
         DropDownList3.DataBind();
         con.Close();
     }
 }
Exemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DropDownList3.DataSource     = data.GetDataReader("select * from Suppliers ");
         DropDownList3.DataTextField  = "SName";
         DropDownList3.DataValueField = "id";
         DropDownList3.DataBind();
         DropDownList1.DataSource     = data.GetDataReader("select * from Booktype");
         DropDownList1.DataValueField = "id";
         DropDownList1.DataTextField  = "name";
         DropDownList1.DataBind();
         string sql = "select * from Book where BookID=" + Request.QueryString["id"].ToString();
         getdata(sql);
     }
 }
Exemplo n.º 10
0
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        int dId = Convert.ToInt32(Convert.ToString(DropDownList2.SelectedValue));



        DataTable dtCityShowById = cityBLLObj.BLLGetSelectedCityByDId(cityBLLObj, dId);

        DropDownList3.DataSource     = dtCityShowById;
        DropDownList3.DataTextField  = "cityName";
        DropDownList3.DataValueField = "cityId";
        DropDownList3.DataBind();
        DropDownList3.Items.Add("---Select---");
        DropDownList3.SelectedIndex = DropDownList3.Items.Count - 1;
        DropDownList3.Items[DropDownList3.Items.Count - 1].Value = "";
    }
Exemplo n.º 11
0
        public void Bound_Packages()
        {
            string        con1 = System.Configuration.ConfigurationManager.ConnectionStrings["DBMS"].ConnectionString;
            SqlConnection conn = new SqlConnection(con1);

            SqlCommand cmd = new SqlCommand(@"select p.pack_id,p.p_name from Packages as p", conn);

            conn.Open();
            DropDownList3.DataSource     = cmd.ExecuteReader();
            DropDownList3.DataTextField  = "p_name";
            DropDownList3.DataValueField = "pack_id";
            DropDownList3.DataBind();

            conn.Close();
            conn.Dispose();
        }
Exemplo n.º 12
0
        private void FillDpoints1()
        {
            Businesslogiclayer.Businesslogiclayerclass objbll = new Businesslogiclayer.Businesslogiclayerclass();
            Businessobjects.BusinessObjectsclass       objbo  = new BusinessObjectsclass();
            string s = DropDownList1.SelectedItem.ToString();

            string[] s1 = s.Split('/');
            objbo.Serviceno = s1[0];
            DataSet ds = objbll.ViewDpoints(objbo);

            DropDownList3.DataSource     = ds;
            DropDownList3.DataTextField  = "dname";
            DropDownList3.DataValueField = "did";
            DropDownList3.DataBind();
            ViewState["svno"] = objbo.Serviceno;
        }
Exemplo n.º 13
0
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList3.Enabled = true;
        mysql = "SELECT distinct 省份 FROM Area WHERE 地区 = '"
                + DropDownList2.SelectedValue.ToString().Trim() + "'";
        myds = mydb.ExecuteQuery(mysql, "Area");
        DataRow nrow = myds.Tables["Area"].NewRow();          //插入一个空行

        nrow["省份"] = "";
        myds.Tables["Area"].Rows.InsertAt(nrow, 0);
        DropDownList3.DataSource    = myds.Tables["Area"];
        DropDownList3.DataTextField = "省份";
        DropDownList3.DataBind();
        DropDownList4.Items.Clear();
        DropDownList5.Items.Clear();
    }
    protected void FillProduct1()
    {
        string         cmdstr = " SELECT  distinct  VersionInfoMaster.VersionInfoId, ProductMaster.ProductName + ':' +  VersionInfoMaster.VersionInfoName as productversion  FROM ProductMaster  inner join VersionInfoMaster on ProductMaster.ProductId=VersionInfoMaster.ProductId inner join ProductDetail on ProductDetail.ProductId=ProductMaster.ProductId   where ProductMaster.ClientMasterId='" + Session["ClientId"].ToString() + "' and VersionInfoMaster.Active ='True' and ProductDetail.Active='1'  order  by productversion";
        SqlCommand     cmdcln = new SqlCommand(cmdstr, con);
        DataTable      dtcln  = new DataTable();
        SqlDataAdapter adpcln = new SqlDataAdapter(cmdcln);

        adpcln.Fill(dtcln);
        DropDownList3.DataSource = dtcln;

        DropDownList3.DataValueField = "VersionInfoId";
        DropDownList3.DataTextField  = "productversion";
        DropDownList3.DataBind();
        DropDownList3.Items.Insert(0, "-Select-");
        DropDownList3.Items[0].Value = "0";
    }
Exemplo n.º 15
0
      public void Populateddl3()
      {
          MySqlConnection cn  = new MySqlConnection(MyConString);
          MySqlCommand    cmd = new MySqlCommand("SELECT id_type, type_name FROM planttype", cn);

          cn.Open();
          DataTable        dt = new DataTable();
          MySqlDataAdapter da = new MySqlDataAdapter(cmd);

          da.Fill(dt);
          DropDownList3.DataSource     = dt;
          DropDownList3.DataTextField  = "type_name";
          DropDownList3.DataValueField = "id_type";
          DropDownList3.DataBind();
          cn.Close();
      }
Exemplo n.º 16
0
 public void CargarCargos()
 {
     using (SqlConnection conexion = new SqlConnection("Data Source=LAPTOP-QJ659VTB\\SQLEXPRESS01;Initial Catalog=Finalprogramacion2;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework"))
     {
         SqlCommand comando = new SqlCommand();
         comando.CommandType = CommandType.StoredProcedure;
         comando.CommandText = "CARGARCARGOS";
         comando.Connection  = conexion;
         conexion.Open();
         DropDownList3.DataSource     = comando.ExecuteReader();
         DropDownList3.DataTextField  = "ID";
         DropDownList3.DataValueField = "ID";
         DropDownList3.DataBind();
         DropDownList3.Items.Insert(0, new ListItem("--Seleccionar--", "0"));
     }
 }
 protected void Button5_Click(object sender, EventArgs e)
 {
     Button1.Enabled = DropDownList1.Enabled = true;
     Button5.Visible = false; Label1.Text = "";
     DeleteReqNo(); Button3.Visible = false;
     lblCategory.Visible            = lblDescription.Visible = lblQty.Visible = false;
     GridView1.Visible            = Button3.Visible = Button4.Visible = DropDownList2.Visible = DropDownList3.Visible = Label1.Visible = TextBox1.Visible = false;
     GridView1.Columns[4].Visible = false;
     DropReqNo();
     DropCateg();
     if (DropDownList3.Equals(null))
     {
         DropDownList3.SelectedIndex = 0;
     }
     TextBox1.Text = "";
 }
Exemplo n.º 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.Form.DefaultButton = Button1.UniqueID;
            DropDownList3.Focus();
            DropDownList3.Attributes.Add("onkeypress", "return controlEnter('" + TextBox3.ClientID + "', event)");
            getinvoiceno();
            show_category();
            showrating();
            BindData();

            active();
            created();
        }
    }
Exemplo n.º 19
0
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        List <article.MainData> ar = new List <article.MainData>();

        ar = article.DbHandle.Get_article_list(DropDownList2.SelectedValue, "", 10, 0);
        DropDownList3.Items.Clear();
        if (ar.Count > 0)
        {
            DropDownList3.DataSource = ar;
            DropDownList3.DataBind();
        }
        else
        {
            DropDownList3.Items.Insert(0, new ListItem("無資料", ""));
        }
    }
Exemplo n.º 20
0
    //string a, b;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            con.Open();

            SqlCommand     com = new SqlCommand("select Id,Car_Manufacturer from tbl_Category1", con);
            SqlDataAdapter da  = new SqlDataAdapter(com);
            DataSet        ds  = new DataSet();
            da.Fill(ds);
            DropDownList3.DataSource     = com.ExecuteReader();
            DropDownList3.DataTextField  = "Car_Manufacturer";
            DropDownList3.DataValueField = "Id";
            DropDownList3.DataBind();
        }
    }
Exemplo n.º 21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         for (int i = 2016; i <= 2050; i++)
         {
             DropDownList2.Items.Add(i.ToString());
         }
         DropDownList2.Items.Insert(00, new ListItem("---Select Year---", "NA"));
         cl.usepro("req_name", "");
         DropDownList3.DataSource     = cl.ds;
         DropDownList3.DataTextField  = "Emp_Reg_ID";
         DropDownList3.DataValueField = "Emp_Reg_ID";
         DropDownList3.DataBind();
     }
 }
 void ClearForm()
 {
     TextBox1.Text = "";
     TextBox2.Text = "";
     ListBox1.ClearSelection();
     DropDownList3.ClearSelection();
     DropDownList2.ClearSelection();
     TextBox3.Text = "";
     DropDownList1.ClearSelection();
     TextBox4.Text  = "";
     TextBox5.Text  = "";
     TextBox7.Text  = "";
     TextBox8.Text  = "";
     TextBox6.Text  = "";
     TextBox10.Text = "";
 }
Exemplo n.º 23
0
 protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (DropDownList2.SelectedValue.ToString() != "0")
     {
         oraConnection.Open();
         string            s1      = "Select Title from DIR_PROJECTS WHERE id_Laboratory = ( Select id_Laboratories from DIR_LABORATORIES where LABORATORY = '" + DropDownList2.SelectedValue.ToString() + "')";
         OracleDataAdapter oraAdap = new OracleDataAdapter(s1, oraConnection);
         oraAdap.Fill(ds);
         DropDownList3.DataSource    = ds;
         DropDownList3.DataTextField = "Title";
         DropDownList3.DataBind();
         DropDownList3.Items.Insert(0, new ListItem("-Выберите проект-"));
         DropDownList3.SelectedIndex = 0;
         oraConnection.Close();
     }
 }
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            DropDownList3.Items.Clear();

            ds = c.sel_id("relation_sel_id", DropDownList2.SelectedValue);
            DropDownList3.DataSource     = ds;
            DropDownList3.DataTextField  = "rel_desc";
            DropDownList3.DataValueField = "rel_id";
            DropDownList3.DataBind();
        }
        catch (Exception ex)
        {
        }
    }
 void AffiliatedBoard()
 {
     using (SqlConnection con = GetConnection())
     {
         using (SqlCommand com = new SqlCommand("Select * from AffiliatedBoard", con))
         {
             con.Open();
             SqlDataReader read = com.ExecuteReader();
             DropDownList3.DataSource     = read;
             DropDownList3.DataTextField  = "BoardName";
             DropDownList3.DataValueField = "AffiliatedId";
             DropDownList3.DataBind();
             con.Close();
         }
     }
 }
Exemplo n.º 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable subjects = new DataTable();

            SqlConnection con = new SqlConnection(
                WebConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString);

            con.Open();

            if (!IsPostBack)
            {
                try
                {
                    SqlDataAdapter adapter = new SqlDataAdapter("Select distinct Symptoms from Symptoms", con);
                    adapter.Fill(subjects);

                    DropDownList1.DataSource     = subjects;
                    DropDownList1.DataTextField  = "Symptoms";
                    DropDownList1.DataValueField = "Symptoms";
                    DropDownList1.DataBind();

                    DropDownList2.DataSource     = subjects;
                    DropDownList2.DataTextField  = "Symptoms";
                    DropDownList2.DataValueField = "Symptoms";
                    DropDownList2.DataBind();

                    DropDownList3.DataSource     = subjects;
                    DropDownList3.DataTextField  = "Symptoms";
                    DropDownList3.DataValueField = "Symptoms";
                    DropDownList3.DataBind();

                    DropDownList4.DataSource     = subjects;
                    DropDownList4.DataTextField  = "Symptoms";
                    DropDownList4.DataValueField = "Symptoms";
                    DropDownList4.DataBind();

                    DropDownList5.DataSource     = subjects;
                    DropDownList5.DataTextField  = "Symptoms";
                    DropDownList5.DataValueField = "Symptoms";
                    DropDownList5.DataBind();
                }
                catch (Exception ex)
                {
                }
                con.Close();
            }
        }
Exemplo n.º 27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    //WH
                    FriendsEntities ent = new FriendsEntities();

                    var WH = (from itm in ent.Warehouses
                              select new { itm.WH_Id, itm.WH_Name });
                    DropDownList1.DataSource     = WH;
                    DropDownList1.DataTextField  = "WH_Name";
                    DropDownList1.DataValueField = "WH_Id";
                    DropDownList1.DataBind();

                    DropDownList3.DataSource     = WH;
                    DropDownList3.DataTextField  = "WH_Name";
                    DropDownList3.DataValueField = "WH_Id";
                    DropDownList3.DataBind();

                    DropDownList5.DataSource     = WH;
                    DropDownList5.DataTextField  = "WH_Name";
                    DropDownList5.DataValueField = "WH_Id";
                    DropDownList5.DataBind();
                    //Items
                    FriendsEntities ent2 = new FriendsEntities();

                    var itms = (from itm in ent2.Items
                                select new { itm.Item_Id, itm.Item_Name });
                    DropDownList2.DataSource     = itms;
                    DropDownList2.DataTextField  = "Item_Name";
                    DropDownList2.DataValueField = "Item_Id";
                    DropDownList2.DataBind();

                    DropDownList4.DataSource     = itms;
                    DropDownList4.DataTextField  = "Item_Name";
                    DropDownList4.DataValueField = "Item_Id";
                    DropDownList4.DataBind();
                }
            }
            catch
            {
                mpePopUp.Show();
                Label2.Text = "try again";
            }
        }
Exemplo n.º 28
0
        public void Bound()
        {
            string        con1 = System.Configuration.ConfigurationManager.ConnectionStrings["DBMS"].ConnectionString;
            SqlConnection conn = new SqlConnection(con1);

            SqlCommand cmd = new SqlCommand("select train_id,train_detail from Train", conn);

            conn.Open();
            DropDownList1.DataSource     = cmd.ExecuteReader();
            DropDownList1.DataTextField  = "train_detail";
            DropDownList1.DataValueField = "train_id";
            DropDownList1.DataBind();
            conn.Close();



            SqlCommand cmd1 = new SqlCommand(@"select u.User_Name,s.st_Id
from Users as u
left join Steward as s
on s.st_id=u.User_Id", conn);

            conn.Open();
            DropDownList2.DataSource     = cmd1.ExecuteReader();
            DropDownList2.DataTextField  = "User_Name";
            DropDownList2.DataValueField = "st_Id";
            DropDownList2.DataBind();
            conn.Close();
            //select s.St_Name,s.Station_Id from Stations as s
            SqlCommand cmd2 = new SqlCommand(@"select s.St_Name,s.Station_Id from Stations as s", conn);

            conn.Open();
            DropDownList3.DataSource     = cmd2.ExecuteReader();
            DropDownList3.DataTextField  = "St_Name";
            DropDownList3.DataValueField = "Station_Id";
            DropDownList3.DataBind();
            conn.Close();


            SqlCommand cmd3 = new SqlCommand(@"select s.St_Name,s.Station_Id from Stations as s", conn);

            conn.Open();
            DropDownList4.DataSource     = cmd3.ExecuteReader();
            DropDownList4.DataTextField  = "St_Name";
            DropDownList4.DataValueField = "Station_Id";
            DropDownList4.DataBind();
            conn.Close();
        }
Exemplo n.º 29
0
    protected void DropDownList5_SelectedIndexChanged(object sender, EventArgs e)
    {
        int           courseID = Convert.ToInt32(DropDownList1.SelectedValue);
        string        year     = DropDownList2.SelectedItem.Text;
        string        sem      = DropDownList5.SelectedItem.Text;
        SqlConnection con      = new SqlConnection(str);

        con.Open();
        SqlCommand cmd = new SqlCommand("select * from Subject where CID='" + courseID + "' and Year='" + year + "' and Sem='" + sem + "'", con);

        DropDownList3.DataSource     = cmd.ExecuteReader();
        DropDownList3.DataTextField  = "SubjectName";
        DropDownList3.DataValueField = "SID";
        DropDownList3.DataBind();
        DropDownList3.Items.Insert(0, "Select Subject");
        con.Close();
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DropDownList1.DataSource     = MostrarEmpresas();
                DropDownList1.DataTextField  = "Nombre";
                DropDownList1.DataValueField = "IdEmpresa";
                DropDownList1.DataBind();

                DropDownList3.DataSource     = MostrarEmpleados();
                DropDownList3.DataTextField  = "Nombre";
                DropDownList3.DataValueField = "NEmpleado";
                DropDownList3.DataBind();
            }

            GridView1.DataBind();
        }