private void AddAutomationButton_Click(object sender, EventArgs e) { if (AddAutomationNameInputfield.Text.Length > 0 && AutoMessageInputfield.Text.Length <= 470 && AutoMessageInputfield.Text.Length > 4 && autoMinutes.SelectedItem != null && Int32.Parse(autoMinutes.SelectedItem.ToString()) >= 5) { if (autoManager.AddAutomation(AddAutomationNameInputfield.Text, Int32.Parse(autoMinutes.SelectedItem.ToString()), AutoMessageInputfield.Text, autoActive.Checked)) { AddAutomationNameInputfield.Text = ""; autoMinutes.SelectedIndex = -1; autoMinutes.Focus(); autoActive.Checked = false; AutoMessageInputfield.Text = ""; } } }