Load
How do I use Load
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: Form9.cs
Copy
81 private void btnDangXuat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
82 {
83 quyen = -1;
84 CloseForm("Form9");
85 Form9_Load(sender,e);
86 }
File name: Form9.cs
Copy
94 private void Form9_Load(object sender, EventArgs e)
95 {
96 PhanQuyenMenu();
97 }
File name: FormBaoCao.cs
Copy
23 private void FormBaoCao_Load(object sender, EventArgs e)
24 {
25 loadCmb();
26 }
File name: FormBaoCao.cs
Copy
27 public void loadCmb()
28 {
29 SqlConnection con = dal.GetConnect();
30 con.Open();
31 SqlCommand cm = new SqlCommand("Select *from Lop", con);
32 SqlDataAdapter da = new SqlDataAdapter(cm);
33 DataTable dt = new DataTable();
34 da.Fill(dt);
35 this.cmbMaLop.DisplayMember = "MaLop";
36 this.cmbMaLop.ValueMember = "MaLop";
37 this.cmbMaLop.DataSource = dt;
38 }
File name: FormGiangVien.cs
Copy
20 private void FormGiangVien_Load(object sender, EventArgs e)
21 {
22 dgvGiangVien.DataSource = business.ShowData("GiangVien");
23 }
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: FormGiangVien.cs
Copy
69 private void btnSua_Click(object sender, EventArgs e)
70 {
71 string sql = "TenGV='"+txtTenGV.Text+"',NgaySinh='"+dtpNamSinh.Text+"',DiaChi='"+txtDiaChi.Text+"' where MaGV='"+txtMaGV.Text+"'";
72 business.Update("GiangVien",sql);
73 FormGiangVien_Load(sender,e);
74 }
File name: FormHeDaoTao.cs
Copy
20 private void FormHeDaoTao_Load(object sender, EventArgs e)
21 {
22 dgvHeDaoTao.DataSource = business.ShowData("HeDaoTao");
23 }
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 }
Download file with original file name:Load
Load 161 lượt xem
Gõ tìm kiếm nhanh...