Checking condition in 2 different way
One Way is
if (item.Text.ToString() == "Professional")
query1 = "P";
else
query1 = "C";
--------
query1 = item.Text.ToString() == "Professional" ? "P" : "C";
================Separate
if (item.Selected == true)
query1 = item.Text.ToString() == "Professional" ? "P" : "C";
---------
if (item.Selected != true) continue;
query1 = item.Text.ToString() == "Professional" ? "P" : "C";
No comments:
Post a Comment