Пример #1
0
 private void RandomNumberButton_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrWhiteSpace(tbMinimum.Text) || String.IsNullOrWhiteSpace(tbMaximum.Text))
     {
         WarningNotice.Null();
         return;
     }
     if (!(int.TryParse(tbMinimum.Text, out _) && int.TryParse(tbMaximum.Text, out _)))
     {
         if (long.TryParse(tbMinimum.Text, out _) || long.TryParse(tbMaximum.Text, out _))
         {
             WarningNotice.IsLongType();
             return;
         }
         WarningNotice.NotNumber();
         return;
     }
     if (int.Parse(tbMinimum.Text) > int.Parse(tbMaximum.Text))
     {
         WarningNotice.MinAndMaxNumber();
     }
     tbRandomNumberResult.Text = RandomCode.GetRandomNumber(int.Parse(tbMinimum.Text), int.Parse(tbMaximum.Text)).ToString();
 }