Message
How do I use Message
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: FormDangNhap.cs
Copy
30 private void btnDangNhap_Click(object sender, EventArgs e)
31 {
32 int quyen=business.CheckLogin(txtTenDangNhap.Text, txtMatKhau.Text);
33 if (quyen != -1)
34 {
35 Form9.quyen = quyen;
36 Form9 f = (Form9)this.MdiParent;
37 f.PhanQuyenMenu();
38 this.Close();
39 }
40 else
41 {
42 MessageBox.Show("Sai Tên Đăng Nhập Hoặc Mật Khẩu !!");
43 }
44 }
File name: FormGiangVien.cs
Copy
40 private void btnThem_Click(object sender, EventArgs e)
41 {
42 if (txtMaGV.Text!="")
43 {
44 if(business.Proc_Insert("Insert_GiangVien",txtMaGV.Text))
45 {
46 string sql = "'"+txtMaGV.Text+"','"+txtTenGV.Text+"','"+dtpNamSinh.Text+"','"+txtDiaChi.Text+"'";
47 business.Insert("GiangVien",sql);
48 FormGiangVien_Load(sender,e);
49 }
50 else
51 {
52 MessageBox.Show("Mã GV đã tồn tại");
53 }
54 }
55 }
File name: FormGiangVien.cs
Copy
57 private void btnXoa_Click(object sender, EventArgs e)
58 {
59 DialogResult result;
60 result = MessageBox.Show("Bạn có chắc chắn muốn xóa không ?","Hệ Thống", MessageBoxButtons.YesNo);
61 if (result == DialogResult.Yes)
62 {
63 string sql = "MaGV='" + txtMaGV.Text + "'";
64 business.Delete("GiangVien", sql);
65 FormGiangVien_Load(sender, e);
66 }
67 }
File name: FormHeDaoTao.cs
Copy
37 private void btnThem_Click(object sender, EventArgs e)
38 {
39 if(txtMaHeDT.Text!="")
40 {
41 if (business.Proc_Insert("Insert_HeDaoTao", txtMaHeDT.Text))
42 {
43 string sql = "'" + txtMaHeDT.Text + "','" + txtTenHeDT.Text + "'";
44 business.Insert("HeDaoTao", sql);
45 FormHeDaoTao_Load(sender, e);
46 }
47 else
48 {
49 MessageBox.Show("Mã Hệ Đào Tạo đã tồn tại");
50 }
51 }
52 }
File name: FormHeDaoTao.cs
Copy
54 private void btnXoa_Click(object sender, EventArgs e)
55 {
56 DialogResult result;
57 result = MessageBox.Show("Bạn có chắc chắn muốn xóa không ?","Hệ Thống", MessageBoxButtons.YesNo);
58 if (result == DialogResult.Yes)
59 {
60 string sql = "MaHeDT = '" + txtMaHeDT.Text + "'";
61 business.Delete("HeDaoTao", sql);
62 FormHeDaoTao_Load(sender, e);
63 }
64 }
File name: FormHocKy.cs
Copy
40 private void btnXoa_Click(object sender, EventArgs e)
41 {
42 DialogResult result;
43 result = MessageBox.Show("Bạn có chắc chắn muốn xóa không ?","Hệ Thống", MessageBoxButtons.YesNo);
44 if (result == DialogResult.Yes)
45 {
46 string sql = "MaHK='" + txtMaHocKy.Text + "'";
47 business.Delete("HocKy", sql);
48 FormHocKy_Load(sender, e);
49 }
50 }
File name: FormHocKy.cs
Copy
52 private void btnThem_Click(object sender, EventArgs e)
53 {
54 if (txtMaHocKy.Text!="")
55 {
56 if (business.Proc_Insert("Insert_HocKy", txtMaHocKy.Text))
57 {
58 string sql = "'" + txtMaHocKy.Text + "','" + txtTenHocKy.Text + "','" + txtNamHoc.Text + "','" + dtpBatDau.Text + "','" + dtpKetThuc.Text + "'";
59 business.Insert("HocKy", sql);
60 FormHocKy_Load(sender, e);
61 }
62 else
63 {
64 MessageBox.Show("Mã Học Kỳ đã tồn tại");
65 }
66 }
67 }
File name: FormHocPhan.cs
Copy
25 private void btnThem_Click(object sender, EventArgs e)
26 {
27 if (txtMaHP.Text != "")
28 {
29 if (business.Proc_Insert("Insert_HocPhan", txtMaHP.Text))
30 {
31 string sql = "'" + txtMaHP.Text + "','" + txtTenHP.Text + "'," + Convert.ToInt32(txtSoTC.Text) + "," + Convert.ToInt32(txtSoTietTH.Text) + "," + Convert.ToInt32(txtSoTietLT.Text) + "," + Convert.ToInt32(txtPhanTramDQT.Text) + "," + Convert.ToInt32(txtPhanTramDT.Text) + "";
32 business.Insert("HocPhan",sql);
33 FormHocPhan_Load(sender,e);
34 }
35 else
36 {
37 MessageBox.Show("Mã Học Phần đã tồn tại");
38 }
39 }
40 }
File name: FormHocPhan.cs
Copy
41 private void btnXoa_Click(object sender, EventArgs e)
42 {
43 DialogResult result;
44 result = MessageBox.Show("Bạn có chắc chắn muốn xóa không ?","Hệ Thống", MessageBoxButtons.YesNo);
45 if (result == DialogResult.Yes)
46 {
47 string sql = "MaHP='" + txtMaHP.Text + "'";
48 business.Delete("HocPhan", sql);
49 FormHocPhan_Load(sender, e);
50 }
51 }
File name: FormKHGD.cs
Copy
34 private void btnThem_Click(object sender, EventArgs e)
35 {
36 if (txtMaKHGD.Text != "")
37 {
38 if (business.Proc_Insert("Insert_KHGD",txtMaKHGD.Text))
39 {
40 string sql = "'"+txtMaKHGD.Text+"','"+cmbMahocKy.SelectedValue.ToString()+"','"+cmbMaKhoiLop.SelectedValue.ToString()+"'";
41 business.Insert("KeHoachGiangDay",sql);
42 FormKHGD_Load(sender, e);
43 }
44 else
45 {
46 MessageBox.Show("Mã KHGD đã tồn tại rồi");
47 }
48 }
49 }
Download file with original file name:Message
Message 123 lượt xem
Gõ tìm kiếm nhanh...