public static bool validate_input(AdminWindow adminWindow, TextBox nameTextBox, TextBox trialCountTextBox, TextBox idTextBox, Block block) { if (nameTextBox.Text.Length < 1) { MessageBox.Show("Blok mora imati ime!"); return(false); } int trialCount; if (Int32.TryParse(trialCountTextBox.Text, out trialCount) == false) { MessageBox.Show("Neispravan broj triala!"); return(false); } int id; if (Int32.TryParse(idTextBox.Text, out id) == false) { MessageBox.Show("Neispravan broj unesen kao ID!"); return(false); } if (adminWindow.blockList.Items.Cast <Block>().Any(b => b.id == id && b != block)) { MessageBox.Show("Unesen ID koji već postoji!"); return(false); } return(true); }
public AddGroupWindow(AdminWindow adminWindow) { this.adminWindow = adminWindow; InitializeComponent(); colorPicker.SelectedColor = Settings.DefaultListColor; }
private void open_administration() { idTextBox.Clear(); var adminWindow = new AdminWindow(); adminWindow.Show(); }
public AddTestWindow(AdminWindow adminWindow) { this.adminWindow = adminWindow; InitializeComponent(); populate_textboxes(); }
public AddBlockWindow(AdminWindow adminWindow) { this.adminWindow = adminWindow; InitializeComponent(); }
public EditTestWindow(AdminWindow adminWindow) { InitializeComponent(); this.adminWindow = adminWindow; change_selected(); }
public AddCategoryWindow(AdminWindow adminWindow) { this.adminWindow = adminWindow; InitializeComponent(); }