WARNING









How do I use W A R N I N G
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: frmCapNhat.cs Copy
238         private void button2_Click(object sender, EventArgs e)
239         {
240             if (richTextBox1.Text == "")
241             {
242                 MessageBox.Show("Vui lòng chọn câu hỏi", "Thông báo");
243             }
244             else
245             {
246                 string sCauHoi = richTextBox1.Text;
247                 if (MessageBox.Show("Bạn có muốn xóa câu hỏi" + " " + sCauHoi, "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
248                 {
249                     string sMaCH = textBox5.Text;
250                     sqlcmd = new SqlCommand("delete cauhoi where mach='" + sMaCH + "'", sqlcon);
251                     sqlcmd.ExecuteNonQuery();
252                     sqlcmd = new SqlCommand("delete dapan where mach='" + sMaCH + "'", sqlcon);
253                     sqlcmd.ExecuteNonQuery();
254                     LoadDataToListView();
255                 }
256                 Bandau();
257             }
258         }
File name: frmDienTenTS.cs Copy
30         private void btbatdauthi_Click(object sender, EventArgs e)
31         {
32             try
33             {
34                 if (tbten.Text == "" || tbmathisinh.Text == "")
35                 {
36                     MessageBox.Show("Bạn phải điền đầy đủ thông tin");
37                 }
38                 else
39                 {
40                     string TenThSinh = tbten.Text;
41                     string MaThiSinh = tbmathisinh.Text;
42                     string strSQL = "insert THISINHTHI values('" + MaThiSinh + "','" + TenThSinh + "')";
43                     SqlCommand ObjCmd = new SqlCommand(strSQL, ObjCon);
44                     ObjCmd.ExecuteNonQuery();
45                     if (MessageBox.Show("Bạn có chắc chắn thi không ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
46                     {
47
48                         string dienten = this.tbten.Text;//chuyen thong tin sang form thithat
49                         string dienma = this.tbmathisinh.Text;
50                         frmThiThat thithat = new frmThiThat(dienten, dienma);
51                         thithat.ShowDialog();
52                         this.Close();
53
54
55                     }
56
57                 }
58             }
59             catch
60             {
61                 MessageBox.Show("Mã thí sinh trùng", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
62             }
63
64     }
File name: frmLogin.cs Copy
27         private void btThoat_Click(object sender, EventArgs e)
28         {
29             if (MessageBox.Show("Bạn có muốn thoát hay không ", "Thông Báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.OK)
30             {
31                 this.Close();
32             }
33         }
File name: frmLuaChon.cs Copy
29         private void btThoat_Click(object sender, EventArgs e)
30         {
31             if (MessageBox.Show("Bạn có muốn thoát hay không","Thông Báo",MessageBoxButtons.OKCancel,MessageBoxIcon.Warning) == DialogResult.OK)
32             {
33                 this.Close();
34             }
35         }
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: frmThiThat.cs Copy
261         private void btketthuc_Click(object sender, EventArgs e)
262         {
263             if (MessageBox.Show("Bạn có chắc chắn kết thúc không ?" , "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
264             {
265                 this.Hide();
266                 try
267                 {
268                     timer1.Stop();
269                     btketthuc.Enabled = false;
270
271                     GhiLaiDapAnTS();
272                     SoCauDung = 0;
273                     for (int i = 0; i < SoCauHoi; i++)
274                     {
275                         if (BangDeThi.Rows[i][6].ToString().ToUpper() == BangDeThi.Rows[i][7].ToString().ToUpper())
276                             SoCauDung++;
277
278                     }
279
280                     diem = SoCauDung * 2;
281                     MessageBox.Show("Đúng " + SoCauDung.ToString() + " câu " + " Bạn được " + diem.ToString() + " điểm ");
282                     this.Close();
283                     string ten = lbhoten.Text;
284                     string mats = lbmathisinh.Text;
285                     string diem1 = diem.ToString();
286                     string socaudung = SoCauDung.ToString();
287                     frmKetQua ketqua = new frmKetQua(ten,mats,diem1,socaudung);
288                     ketqua.ShowDialog();
289                     //them form ket qua tai day
290
291                 }
292                 catch (Exception ex)
293                 { MessageBox.Show(ex.Message); }
294             }
295             else
296             { return; }
297         }
File name: Lichsuthi.cs Copy
55         private void timkiemtheongay()
56         {
57             if (tbngaythang.Text == "")
58             {
59                 rdb1.Checked = false;
60                 MessageBox.Show("Bạn điền ngày tháng năm vao trước, theo dạng tháng / ngày / năm", "Có lỗi", MessageBoxButtons.OK, MessageBoxIcon.Warning);
61                 tbngaythang.Enabled = true;
62             }
63             else
64             {
65
66                 Sngay = tbngaythang.Text;
67                 try
68                 {
69
70
71                         sqlcmd = new SqlCommand("select thisinhthi.mats,HOTEN,NGAYTHI,SOCAUDUNG,SOCAUSAI,DIEM FROM THISINHTHI,KETQUA WHERE THISINHTHI.MATS=KETQUA.MATS and ngaythi='" + Sngay + "'", sqlcon);
72                         SqlDataReader sqlreader = sqlcmd.ExecuteReader();
73                         listView1.Items.Clear();
74                         while (sqlreader.Read())
75                         {
76                             ListViewItem lvitem = new ListViewItem();
77                             lvitem.Text = sqlreader["MATS"].ToString();
78                             lvitem.SubItems.Add(sqlreader["HOTEN"].ToString().Trim());
79                             lvitem.SubItems.Add(sqlreader["NGAYTHI"].ToString().Trim());
80                             lvitem.SubItems.Add(sqlreader["SOCAUDUNG"].ToString().Trim());
81                             lvitem.SubItems.Add(sqlreader["SOCAUSAI"].ToString().Trim());
82                             lvitem.SubItems.Add(sqlreader["DIEM"].ToString().Trim());
83                             listView1.Items.Add(lvitem);
84                         }
85                         sqlreader.Close();
86
87                 }
88                 catch
89                 {
90                     MessageBox.Show("Không có ai thi ngày này '" + Sngay + "'");
91                     tbngaythang.Text = "";
92
93
94                 }
95             }
96         }
File name: Lichsuthi.cs Copy
209        private void button4_Click(object sender, EventArgs e)
210        {
211            if (MessageBox.Show("Bạn có muốn xóa thí sinh có mã thí sinh " + " " + tbmats.Text, "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
212            {
213                sqlcmd = new SqlCommand("delete thisinhthi where mats='" + tbmats.Text + "'", sqlcon);
214                sqlcmd.ExecuteNonQuery();
215                loadtatca();
216            }
217        }
File name: ChatGui.cs Copy
348     public void OnStatusUpdate(string user, int status, bool gotMessage, object message)
349     {
350         // this is how you get status updates of friends.
351         // this demo simply adds status updates to the currently shown chat.
352         // you could buffer them or use them any other way, too.
353
354         ChatChannel activeChannel = this.selectedChannel;
355         if (activeChannel != null)
356         {
357             activeChannel.Add("info", string.Format("{0} is {1}. Msg:{2}", user, status, message));
358         }
359
360         Debug.LogWarning("status: " + string.Format("{0} is {1}. Msg:{2}", user, status, message));
361     }
File name: NamePickGui.cs Copy
15     public void Awake()
16     {
17         this.guiCenteredRect = new Rect(Screen.width/2-GuiSize.x/2, Screen.height/2-GuiSize.y/4, GuiSize.x, GuiSize.y);
18         this.chatComponent = this.GetComponent();
19
20         if (this.chatComponent != null && chatComponent.enabled)
21         {
22             Debug.LogWarning("When using the NamePickGui, ChatGui should be disabled initially.");
23
24             if (this.chatComponent.chatClient != null)
25             {
26                 this.chatComponent.chatClient.Disconnect();
27             }
28             this.chatComponent.enabled = false;
29         }
30
31         string prefsName = PlayerPrefs.GetString(NamePickGui.UserNamePlayerPref);
32         if (!string.IsNullOrEmpty(prefsName))
33         {
34             this.InputLine = prefsName;
35         }
36     }

Download file with original file name:WARNING

WARNING 142 lượt xem

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