Пример #1
0
 private void xoa()
 {
     if (tb_ma.Text != "")
     {
         using (SqlConnection connection = new SqlConnection(Dataconection.conection))
         {
             connection.Open();
             SqlCommand command = new SqlCommand("select*from dbo.ThiSinh where SBD=@ma", connection);
             command.Parameters.AddWithValue("@ma", tb_ma.Text);
             SqlDataReader reader = command.ExecuteReader();
             if (reader.Read() == true)
             {
                 Dataconection.sua("dbo.XoaThiSinh '" + tb_ma.Text + "'");
                 MessageBox.Show("Xóa thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 Quanlithisinhdnagki f = new Quanlithisinhdnagki();
                 this.Visible = false;
                 f.ShowDialog();
             }
             else
             {
                 MessageBox.Show("Mã không tồn tại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             connection.Close();
         }
     }
     else
     {
         MessageBox.Show("vui lòng nhập thông tin!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #2
0
 public DanhsachHD()
 {
     InitializeComponent();
     lb_thongtin.Text = "Danh sách thành viên hội đồng";
     dataGridView1.DataSource = Dataconection.Danhsach(query_thanhvienHD).Tables[0];
     biding();
 }
Пример #3
0
 private void bt_xacnhan_Click(object sender, EventArgs e)
 {
     if (tb_ma.Text == "")
     {
         MessageBox.Show("bạn chưa điền thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         string query = "select *from dbo.ThiSinh ts join dbo.ChitietDK ct on ts.SBD=ct.SBD and ts.SBD=@ma";
         using (SqlConnection connection = new SqlConnection(Dataconection.conection))
         {
             connection.Open();
             SqlCommand command = new SqlCommand(query, connection);
             command.Parameters.AddWithValue("@ma", tb_ma.Text);
             SqlDataReader adapter = command.ExecuteReader();
             if (adapter.Read() == true)
             {
                 var model = from p in dt.ThiSinhs where (p.SBD == tb_ma.Text) select p.HoTen;
                 foreach (string item in model)
                 {
                     tb_hoten.Text = item;
                 }
                 Dataconection.sua("exec dbo._Xacnhan '" + tb_ma.Text + "'");
                 MessageBox.Show("Đã xác nhận!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 MessageBox.Show("Thí sinh không tồn tai!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             connection.Close();
         }
     }
     dataGridView1.DataSource = Dataconection.Danhsach(query_dsxacnhan).Tables[0];
 }
Пример #4
0
        private void suathongtin()
        {
            string luachon       = showRadio(gioitinh, panelgioitinh);
            string luachon2      = showRadio(thuochv, panelhocvien);
            string luachon3      = showRadio(nhucau, panelnhucau);
            string luachon4      = showCheckbox(trinhdo, paneltrinhdo);
            string query_thaydoi = "exec dbo._thaydoithongtinDK '" + tb_ma.Text + "','" + tb_mail.Text + "',N'" + tb_hoten.Text + "','" + dt_ngaysinh.Value + "',N'" + luachon + "','" + tb_cmt.Text + "','" + tb_sdt.Text + "',N'" + luachon3 + "',N'" + luachon2 + "',N'" + luachon4 + "'";

            Dataconection.sua(query_thaydoi);
        }
Пример #5
0
 private void bt_xoa_Click(object sender, EventArgs e)
 {
     if (tb_ma.Text != "")
     {
         Dataconection.sua("exec XoaGV '" + tb_ma.Text + "'");
         MessageBox.Show("Xóa thành công giáo viên", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         DanhsachHD f = new DanhsachHD();
         this.Visible = false;
         f.ShowDialog();
     }
     else
     {
         MessageBox.Show("Bạn phải điền thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #6
0
 private void sua()
 {
     if (tb_mahd.Text != "")
     {
         if (Dataconection.IsNumber(tb_sdt.Text) == true)
         {
             Dataconection.sua("exec dbo.Update_HD" + "'" + tb_ma.Text + "'," + "'" + tb_sdt.Text + "'," + "'" + tb_mahd.Text + "'," + "N'" + capbac + "'," + "N'" + nhiemvu + "'," + "'" + ngaythi + "'" + ",N'" + tendot + "'");
             MessageBox.Show("Sửa thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("số điện thoại không hợp lệ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("Bạn chưa nhập thông tin!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #7
0
 private void bt_them_Click(object sender, EventArgs e)
 {
     if (tb_ma.Text == "")
     {
         MessageBox.Show("Bạn phải điền đầy đủ thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         if (Dataconection.IsNumber(tb_cmt.Text) == true && Dataconection.IsNumber(tb_sdt.Text) == true)
         {
             add();
             MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("Chứng minh thư hoặc số điện thoại không hợp lệ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
Пример #8
0
 private void bt_capnhat_Click(object sender, EventArgs e)
 {
     if (tb_mabt.Text != "" && tb_mahd.Text != "" && tb_sbd.Text != "")
     {
         if (Dataconection.IsNumber(tb_diemlt.Text) == true && Dataconection.IsNumber(tb_diemword.Text) == true && Dataconection.IsNumber(tb_diemexcel.Text) == true && Dataconection.IsNumber(tb_diemppt.Text) == true)
         {
             add();
             MessageBox.Show("Cập nhật thành công!");
         }
         else
         {
             MessageBox.Show("Điểm thi phải là dạng số!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("bạn chưa điền thông tin");
     }
 }
Пример #9
0
 private void bt_cap_Click(object sender, EventArgs e)
 {
     if (tb_mahd.Text != "" && tb_sbd.Text != "")
     {
         string query = "kiemtra @sbd,@mahd";
         using (SqlConnection connection = new SqlConnection(Dataconection.conection))
         {
             connection.Open();
             SqlCommand command = new SqlCommand(query, connection);
             command.Parameters.AddWithValue("@sbd", tb_sbd.Text);
             command.Parameters.AddWithValue("@mahd", tb_mahd.Text);
             SqlDataReader reader = command.ExecuteReader();
             if (reader.Read() == true)
             {
                 if (Dataconection.IsNumber(tb_sovanbang.Text) == true && Dataconection.IsNumber(tb_sovaoso.Text) == true)
                 {
                     add();
                     MessageBox.Show("Cấp thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     dt_danhsach.DataSource = Dataconection.Danhsach(query_danhsachcap).Tables[0];
                 }
                 else
                 {
                     MessageBox.Show("Số văn bằng hoặc số vào sổ không hợp lệ!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
             else
             {
                 MessageBox.Show("SBD hoặc MaHD không tồn tại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             connection.Close();
         }
     }
     else
     {
         MessageBox.Show("bạn chưa điền thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #10
0
 public Quanlithisinhdnagki()
 {
     InitializeComponent();
     dt_danhsachthisinh.DataSource = Dataconection.Danhsach(query_danhsachdk).Tables[0];
     biding();
 }
Пример #11
0
 public QuanliDiem()
 {
     InitializeComponent();
     dt_danhsachdiem.DataSource = Dataconection.Danhsach(query_dsdiem).Tables[0];
     biding();
 }
Пример #12
0
 public CapVanBang()
 {
     InitializeComponent();
     dt_danhsach.DataSource = Dataconection.Danhsach(query_danhsachcap).Tables[0];
 }
Пример #13
0
 public FormXacNhan()
 {
     InitializeComponent();
     dataGridView1.DataSource = Dataconection.Danhsach(query_dsxacnhan).Tables[0];
 }
Пример #14
0
 private void danhsachthutienToolStripMenuItem_Click(object sender, EventArgs e)
 {
     dataGridView1.DataSource = Dataconection.Danhsach(query_danhsachthutien).Tables[0];
 }
Пример #15
0
 private void danhSáchthubaiToolStripMenuItem_Click(object sender, EventArgs e)
 {
     lb_thongtin.Text         = "Danh sách thu bài";
     dataGridView1.DataSource = Dataconection.Danhsach(query_thubai).Tables[0];
 }
Пример #16
0
 public Home()
 {
     InitializeComponent();
     lb_thongtin.Text         = "Danh sách thí sinh đăng kí";
     dataGridView1.DataSource = Dataconection.Danhsach(query_thisinhdangki).Tables[0];
 }