private void setPowerBtn_Click(object sender, EventArgs e)
 {
     if (setPowerTxt.Text != null && sessionID != null)
     {
         connection.setPower(setPowerTxt.Text, sessionID);
     }
 }
Пример #2
0
 private void setPowerBtn_Click(object sender, EventArgs e)
 {
     if (setPowerTxt.Text != null && sessionID != null)
     {
         bool isNumber = int.TryParse(setPowerTxt.Text, out int Power);
         if (isNumber)
         {
             if (Power >= 25 && Power <= 400)
             {
                 connection.setPower(setPowerTxt.Text, sessionID);
             }
             else
             {
                 MessageBox.Show("the input was either too high or too low, please insert a number between 25 and 400");
             }
         }
         else
         {
             MessageBox.Show("the input has not been reconised as a number, please put in a number");
         }
     }
 }