what is the proper if else statement of this.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rexchie
    New Member
    • Nov 2014
    • 2

    what is the proper if else statement of this.

    What is the proper if else statement of this:

    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
          {
    and if the textbox is not empty , label should not seen.
    Last edited by Frinavale; Nov 21 '14, 02:42 PM.
Working...