Test









How do I use Test
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: ClassBLL.cs Copy
275         public bool Proc_Insert(string proc,string test)
276         {
277             SqlConnection con = da.GetConnect();
278             con.Open();
279             SqlCommand cmd = new SqlCommand(proc, con);
280             cmd.CommandType = CommandType.StoredProcedure;
281             cmd.Parameters.Add("@test", SqlDbType.NVarChar).Value = test;
282             SqlDataReader dr = cmd.ExecuteReader();
283             if (dr.Read())
284             {
285                 return false;
286             }
287             return true;
288         }
File name: FormXemDiem.cs Copy
32         private void btnXem_Click(object sender, EventArgs e)
33         {
34             string sql1 = "select TenSV from SinhVien where MaSV='" + txtMaSV.Text + "'";
35             if (business.ShowData_where(sql1).Rows.Count!=0)
36             {
37                 lblTenSV.Text= business.ShowData_where(sql1).Rows[0][0].ToString();
38                 lblTenSV.Visible = true;
39             }
40             if (chbXemTatCaHocKy.Checked == true)
41             {
42                 string sql = "select HocPhan.MaHP,NhomHocPhan.MaNhomHP,HocPhan.TenHP,KetQua.DiemQT,KetQua.DiemThi,KetQua.DiemXepLoai " +
43                                " From KetQua,HocPhan,NhomHocPhan,KeHoachGiangDay " +
44                                 " Where KetQua.MaSV='" + txtMaSV.Text + "' " +
45                                    " and KetQua.MaNhomHP=NhomHocPhan.MaNhomHP " +
46                                    " and NhomHocPhan.MaHP=HocPhan.MaHP " +
47                                    " and NhomHocPhan.MaKHGD=KeHoachGiangDay.MaKHGD ";
48                 dgvKetQua.DataSource = business.ShowData_where(sql);
49                 if (dgvKetQua.RowCount > 0)
50                 {
51                     string test = business.TinhDiemTB(txtMaSV.Text);
52                     txtHe10.Text = test.Split(',')[0];
53                     txtHe4.Text = test.Split(',')[1];
54                 }
55                 else
56                 {
57                     txtHe10.Text = "";
58                     txtHe4.Text = "";
59                 }
60             }
61             else
62             {
63                 string sql = "select HocPhan.MaHP,NhomHocPhan.MaNhomHP,HocPhan.TenHP,KetQua.DiemQT,KetQua.DiemThi,KetQua.DiemXepLoai " +
64                                " From KetQua,HocPhan,NhomHocPhan,KeHoachGiangDay " +
65                                 " Where KetQua.MaSV='" + txtMaSV.Text + "' " +
66                                    " and KetQua.MaNhomHP=NhomHocPhan.MaNhomHP " +
67                                    " and NhomHocPhan.MaHP=HocPhan.MaHP " +
68                                    " and NhomHocPhan.MaKHGD=KeHoachGiangDay.MaKHGD " +
69                                    " and KeHoachGiangDay.MaHK='" + cmbMaHK.SelectedValue.ToString() + "'";
70                 dgvKetQua.DataSource = business.ShowData_where(sql);
71                 if (dgvKetQua.RowCount > 0)
72                 {
73                     string test = business.TinhDiemTB(txtMaSV.Text, cmbMaHK.SelectedValue.ToString());
74                     txtHe10.Text = test.Split(',')[0];
75                     txtHe4.Text = test.Split(',')[1];
76                 }
77                 else
78                 {
79                     txtHe10.Text = "";
80                     txtHe4.Text = "";
81                 }
82             }
83         }
File name: frmKetQua.cs Copy
69         private void frmKetQua_Load(object sender, EventArgs e)
70         {
71             string strma,strsocaudung,strdiem;
72             strma = lbmathisinh.Text;
73             strsocaudung =lbsocaudung.Text;
74             strdiem= lbdiem.Text;
75             strngay = DateTime.Now.ToShortDateString();
76             lbngay.Text = DateTime.Now.Day.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString();
77             string strSQL = "insert KETQUA values('" + strma + "','" + strngay + "','" + strsocaudung + "','" + socausai + "','" + strdiem + "')";
78             SqlCommand ObjCmd = new SqlCommand(strSQL, ObjCon);
79             ObjCmd.ExecuteNonQuery();
80         }
File name: frmThi.cs Copy
37         private void test()
38         {
39             strcheck = strdapan[j];
40             if (checkBox1.Text == strcheck && checkBox1.Checked)
41             {
42                 diem = diem + 1;
43             }
44             if (checkBox2.Text == strcheck && checkBox2.Checked)
45             {
46                 diem = diem + 1;
47             }
48             if (checkBox3.Text == strcheck && checkBox3.Checked)
49             {
50                 diem = diem + 1;
51             }
52             if (checkBox4.Text == strcheck && checkBox4.Checked)
53             {
54                 diem = diem + 1;
55             }
56             int diem1 = 0 + diem;
57             label1.Text = diem1.ToString();
58         }
File name: frmThi.cs Copy
197         private void btNext_Click(object sender, EventArgs e)
198         {
199             test();
200             getdapan();
201             iRows += sodonghienlen;
202             getData(iRows);
203             if (i < 1)
204                 return;
205             else
206             {
207                 //strsoluongcauhoi1 = frmluachon.strsoluongcauhoi;
208                 i++;
209                 if (int.Parse(strsoluongcauhoi1)< i)
210                 {
211                     groupBox1.Text = " Nội dung câu hỏi " + i.ToString();
212                     if (MessageBox.Show("Bạn đã làm xong","Thông báo",MessageBoxButtons.OKCancel,MessageBoxIcon.Warning)== DialogResult.OK)
213                     {
214
215                     }
216                 }
217                 else
218                 {
219                     groupBox1.Text = " Nội dung câu hỏi " + i.ToString();
220                 }
221             }
222             j = j + 1;
223         }
File name: frmThi.cs Copy
235         private void frmThi_Load(object sender, EventArgs e)
236         {
237             test();
238             dapan();
239             getData(iRows);
240             load();
241             label1.Hide();
242         }
File name: RPGMovement.cs Copy
30     void Update()
31     {
32         if( m_PhotonView.isMine == true )
33         {
34             ResetSpeedValues();
35
36             UpdateRotateMovement();
37
38             UpdateForwardMovement();
39             UpdateBackwardMovement();
40             UpdateStrafeMovement();
41
42             MoveCharacterController();
43             ApplyGravityToCharacterController();
44
45             ApplySynchronizedValues();
46         }
47
48         UpdateAnimation();
49     }
File name: RPGMovement.cs Copy
122     void UpdateStrafeMovement()
123     {
124         if( Input.GetKey( KeyCode.Q ) == true )
125         {
126             m_CurrentMovement = -transform.right * StrafeSpeed;
127         }
128
129         if( Input.GetKey( KeyCode.E ) == true )
130         {
131             m_CurrentMovement = transform.right * StrafeSpeed;
132         }
133     }
File name: CubeExtra.cs Copy
11     public void Awake()
12     {
13         if (photonView.isMine)
14         {
15             this.enabled = false; // Only enable inter/extrapol for remote players
16         }
17
18         latestCorrectPos = transform.position;
19     }
File name: CubeExtra.cs Copy
21     // this method is called by PUN when this script is being "observed" by a PhotonView (setup in inspector)
22     public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
23     {
24         // Always send transform (depending on reliability of the network view)
25         if (stream.isWriting)
26         {
27             Vector3 pos = transform.localPosition;
28             Quaternion rot = transform.localRotation;
29             stream.Serialize(ref pos);
30             stream.Serialize(ref rot);
31         }
32         // When receiving, buffer the information
33         else
34         {
35             // Receive latest state information
36             Vector3 pos = Vector3.zero;
37             Quaternion rot = Quaternion.identity;
38             stream.Serialize(ref pos);
39             stream.Serialize(ref rot);
40
41             lastMovement = (pos - latestCorrectPos) / (Time.time - lastTime);
42
43             lastTime = Time.time;
44             latestCorrectPos = pos;
45
46             transform.position = latestCorrectPos;
47         }
48     }

Download file with original file name:Test

Test 1.895 lượt xem

Gõ tìm kiếm nhanh...