示例#1
0
        private DataTable ketnoicsdlSua(string id)
        {
            // Lấy dữ liệu trường theo mã trường
            string sql = "select Truong.TenTruong, TuyenSinh.* from Truong,TuyenSinh where TuyenSinh.MaTruong='" + id + "' AND Truong.MaTruong='" + id + "' AND TuyenSinh.Nam = '" + nam + "'";

            return(ExcuteSql.connectDB(sql));
        }
示例#2
0
        private DataTable ketnoicsdl(string id)
        {
            // Lấy dữ liệu trường theo mã trường
            string sql = "select Truong.* from Truong where Truong.MaTruong='" + id + "'";

            return(ExcuteSql.connectDB(sql));
        }
示例#3
0
        private void FormTuyenSinh_Load(object sender, EventArgs e)
        {
            string    sql = "SELECT DISTINCT TuyenSinh.Nam FROM TuyenSinh ORDER BY TuyenSinh.Nam ASC; ";
            DataTable dt  = ExcuteSql.connectDB(sql);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBoxNam.Items.Add(dt.Rows[i][0].ToString());
            }
            comboBoxNam.SelectedIndex = 0;
            ketnoicsdl(id);
        }
示例#4
0
 private void buttonTimKiem_Click(object sender, EventArgs e)
 {
     if (comboBoxTimKiem.SelectedIndex == 0)
     {
         // Tìm kiếm với mã trường
         sql1 = "select * from Truong where MaTruong like '%" + textBoxTimKiem.Text + "%'";
     }
     else
     {
         // Tìm kiếm với tên trường
         sql1 = "select * from Truong where TenTruong like N'%" + textBoxTimKiem.Text + "%'";
     }
     dataGridViewTruong.DataSource = ExcuteSql.connectDB(sql1);;  //đổ dữ liệu vào datagridview
 }
示例#5
0
        private void comboBoxNam_SelectedIndexChanged(object sender, EventArgs e)
        {
            string nam = comboBoxNam.GetItemText(comboBoxNam.SelectedItem);

            if (nam != "Tất cả")
            {
                string sql = "select Truong.TenTruong, TuyenSinh.* from Truong,TuyenSinh where TuyenSinh.Nam='" + nam + "' AND Truong.MaTruong='" + id + "' AND TuyenSinh.MaTruong='" + id + "'";
                dataGridViewTS.DataSource = ExcuteSql.connectDB(sql); //đổ dữ liệu vào datagridview
            }
            else
            {
                ketnoicsdl(id);
            }
        }
示例#6
0
        public void resetForm()
        {
            comboBoxNam.Items.Clear();
            comboBoxNam.Items.Add("Tất cả");
            string    sql = "SELECT DISTINCT TuyenSinh.Nam FROM TuyenSinh ORDER BY TuyenSinh.Nam ASC; ";
            DataTable dt  = ExcuteSql.connectDB(sql);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBoxNam.Items.Add(dt.Rows[i][0].ToString());
            }
            this.comboBoxNam.SelectedIndex = 0;
            this.ketnoicsdl(id);
        }
示例#7
0
        private DataTable ketnoicsdlMa(string id)
        {
            string    sql   = "select TuyenSinh.* from TuyenSinh where TuyenSinh.MaTruong='" + id + "'";
            DataTable check = ExcuteSql.connectDB(sql);

            if (check.Rows.Count == 0)
            {
                return(null);
            }
            else
            {
                return(check);
            }
        }
示例#8
0
        private string ketnoicsdl(string id, string nam)
        {
            // Lấy dữ liệu trường theo mã trường
            string    sql       = "select Truong.TenTruong, TuyenSinh.* from Truong,TuyenSinh where TuyenSinh.MaTruong='" + id + "' AND Truong.MaTruong='" + id + "' AND TuyenSinh.Nam = '" + nam + "'";
            DataTable thamchieu = ExcuteSql.connectDB(sql);

            if (thamchieu.Rows.Count == 0)
            {
                return(null);
            }
            else
            {
                return(thamchieu.Rows[0][4].ToString());
            }
        }
示例#9
0
        private DataTable ketnoicsdlThem(string id)
        {
            string sql = "select Truong.TenTruong, TuyenSinh.* from Truong,TuyenSinh where TuyenSinh.MaTruong='" + id + "' AND Truong.MaTruong='" + id + "'";

            return(ExcuteSql.connectDB(sql));
        }
示例#10
0
        private void ketnoicsdl()
        {
            string sql = "select * from Truong";                       // Lấy dữ liệu bảng trường

            dataGridViewTruong.DataSource = ExcuteSql.connectDB(sql);; //đổ dữ liệu vào datagridview
        }
示例#11
0
        private void ketnoicsdl(string id)
        {
            string sql = "select Truong.TenTruong, TuyenSinh.* from Truong,TuyenSinh where TuyenSinh.MaTruong='" + id + "' AND Truong.MaTruong='" + id + "'";

            dataGridViewTS.DataSource = ExcuteSql.connectDB(sql); //đổ dữ liệu vào datagridview
        }
示例#12
0
        private DataTable ketnoicsdlTen(string id)
        {
            string sql = "select MaTruong from Truong where TenTruong = N'" + id + "'";

            return(ExcuteSql.connectDB(sql));
        }