Bool
How do I use Bool
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: crBaoCao.cs
Copy
33 public override bool NewGenerator {
34 get {
35 return true;
36 }
37 set {
38 // Do nothing
39 }
40 }
File name: crBaoCao.cs
Copy
108 public virtual bool IsCacheable {
109 get {
110 return true;
111 }
112 set {
113 //
114 }
115 }
File name: crBaoCao.cs
Copy
119 public virtual bool ShareDBLogonInfo {
120 get {
121 return false;
122 }
123 set {
124 //
125 }
126 }
File name: frmCapNhat.cs
Copy
54 private void listView1_SelectedIndexChanged(object sender, EventArgs e)
55 {
56 bool bdapan = false;
57 for (int i = 0; i < listView1.Items.Count; i++)
58 {
59 if (listView1.Items[i].Selected)
60 {
61 textBox5.Text = listView1.Items[i].SubItems[0].Text;
62 textBox1.Text = listView1.Items[i].SubItems[2].Text;
63 textBox2.Text = listView1.Items[i].SubItems[3].Text;
64 textBox3.Text = listView1.Items[i].SubItems[4].Text;
65 textBox4.Text = listView1.Items[i].SubItems[5].Text;
66 richTextBox1.Text = listView1.Items[i].SubItems[1].Text;
67 string t = listView1.Items[i].SubItems[6].Text.ToString().Trim();
68 if (t.Length >= 2)
69 {
70 for (int ii = 0; ii < t.Length; ii++)
71 {
72 t2 = t[0].ToString();
73 if (t[1].ToString() == "")
74 {
75 t1 = "NULL";
76 }
77 else
78 {
79 t1 = t[1].ToString();
80 }
81 }
82 }
83 else
84 {
85 t2 = t;
86 t1 = "NULL";
87 }
88 Macdinh();
89 if (t1 == "A")
90 {
91 checkBox1.Checked = true;
92 }
93 if (t1 == "B")
94 {
95 checkBox2.Checked = true;
96 }
97 if (t1 == "C")
98 {
99 checkBox3.Checked = true;
100 }
101 if (t1 == "D")
102 {
103 checkBox4.Checked = true;
104 }
105
106 if (t2 == "A")
107 {
108 checkBox1.Checked = true;
109 }
110 if (t2 == "B")
111 {
112 checkBox2.Checked = true;
113 }
114 if (t2 == "C")
115 {
116 checkBox3.Checked = true;
117 }
118 if (t2 == "D")
119 {
120 checkBox4.Checked = true;
121 }
122 bdapan = true;
123 }
124 if (bdapan == false)
125 {
126 Bandau();
127 }
128 }
129
130 }
File name: rptThisinh.cs
Copy
33 public override bool NewGenerator {
34 get {
35 return true;
36 }
37 set {
38 // Do nothing
39 }
40 }
File name: rptThisinh.cs
Copy
100 public virtual bool IsCacheable {
101 get {
102 return true;
103 }
104 set {
105 //
106 }
107 }
File name: rptThisinh.cs
Copy
111 public virtual bool ShareDBLogonInfo {
112 get {
113 return false;
114 }
115 set {
116 //
117 }
118 }
File name: JumpAndRunMovement.cs
Copy
89 void UpdateIsRunning()
90 {
91 m_Animator.SetBool( "IsRunning", Mathf.Abs( m_Body.velocity.x ) > 0.1f );
92 }
File name: JumpAndRunMovement.cs
Copy
94 void UpdateIsGrounded()
95 {
96 Vector2 position = new Vector2( transform.position.x, transform.position.y );
97
98 RaycastHit2D hit = Physics2D.Raycast( position, -Vector2.up, 0.1f, 1 << LayerMask.NameToLayer( "Ground" ) );
99
100 m_IsGrounded = hit.collider != null;
101 m_Animator.SetBool( "IsGrounded", m_IsGrounded );
102 }
Download file with original file name:Bool
Bool 117 lượt xem
Gõ tìm kiếm nhanh...