Text
How do I use Text
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: crBaoCao.cs
Copy
145 public virtual string GetCustomizedCacheKey(RequestContext request) {
146 String key = null;
147 // // The following is the code used to generate the default
148 // // cache key for caching report jobs in the ASP.NET Cache.
149 // // Feel free to modify this code to suit your needs.
150 // // Returning key == null causes the default cache key to
151 // // be generated.
152 //
153 // key = RequestContext.BuildCompleteCacheKey(
154 // request,
155 // null, // sReportFilename
156 // this.GetType(),
157 // this.ShareDBLogonInfo );
158 return key;
159 }
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
31 private void dgvGiangVien_RowEnter(object sender, DataGridViewCellEventArgs e)
32 {
33 dong = e.RowIndex;
34 txtMaGV.Text = dgvGiangVien.Rows[dong].Cells[0].Value.ToString();
35 txtTenGV.Text = dgvGiangVien.Rows[dong].Cells[1].Value.ToString();
36 dtpNamSinh.Text = dgvGiangVien.Rows[dong].Cells[2].Value.ToString();
37 txtDiaChi.Text = dgvGiangVien.Rows[dong].Cells[3].Value.ToString();
38 }
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
30 private void dgvHeDaoTao_RowEnter(object sender, DataGridViewCellEventArgs e)
31 {
32 dong = e.RowIndex;
33 txtMaHeDT.Text = dgvHeDaoTao.Rows[dong].Cells[0].Value.ToString();
34 txtTenHeDT.Text = dgvHeDaoTao.Rows[dong].Cells[1].Value.ToString();
35 }
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: FormHeDaoTao.cs
Copy
66 private void btnSua_Click(object sender, EventArgs e)
67 {
68 string sql = "TenHeDT ='"+txtTenHeDT.Text+"' where MaHeDT='"+txtMaHeDT.Text+"'";
69 business.Update("HeDaoTao",sql);
70 FormHeDaoTao_Load(sender,e);
71 }
Download file with original file name:Text
Text 246 lượt xem
Gõ tìm kiếm nhanh...