What is the proper if else statement of this:
and if the textbox is not empty , label should not seen.
Code:
private void btnSave_Click(object sender, EventArgs e)
{
if (txtID.Text.Trim()== "")
{
labelID.Text = "!";
}
if (txtLastName.Text.Trim()=="")
{
labelLN.Text = "!";
}
if (txtFirstName.Text.Trim()=="")
{
labelFN.Text = "!";
}
if (txtMiddleName.Text.Trim()=="")
{
labelMI.Text = "!";
}
else
{
DialogResult dialogresult = MessageBox.Show("Successfully save.", "Books",MessageBoxButtons.OK, MessageBoxIcon.Question);
if (dialogresult == DialogResult.Yes)
{
string myCon = ...;
string Query = ....
try
{