private void btn_them_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txt_magv.Text)) { if (DataConnection.kiemtra("select dbo.kiemtraMGV('" + txt_magv.Text + "')") == false) { add(); MessageBox.Show("Thêm thành công giáo viên " + txt_hoten.Text, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); dtgr_DanhsachGV.DataSource = DataConnection.Danhsach("exec dbo.DanhSachGV").Tables[0]; } else { MessageBox.Show("Ma " + txt_magv.Text + " đã tồn tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Bạn phải điền đấy đủ thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btn_them_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txt_madt.Text)) { if (DataConnection.kiemtra("select dbo.kiemtramadt('" + txt_madt.Text + "')") == false) { add(); MessageBox.Show("Thêm thành công đề tài " + txt_tendt.Text, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); dtgr_danhsachdetai.DataSource = DataConnection.Danhsach(query_dsdetai).Tables[0]; } else { MessageBox.Show("Mã " + txt_madt.Text + " đã tồn tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Bạn vui lòng nhập đầy đủ thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btn_them_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txt_ma.Text)) { if (DataConnection.kiemtra("select dbo.kiemtraMSV(N'" + txt_ma.Text + "')") == false) { add(); MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); dtgr_danhsachSV.DataSource = DataConnection.Danhsach(query_dssv).Tables[0]; } else { MessageBox.Show("Mã " + txt_ma.Text + " đã tồn tại", "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); } }