Beispiel #1
0
        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);
        }
Beispiel #2
0
        public AddGroupWindow(AdminWindow adminWindow)
        {
            this.adminWindow = adminWindow;
            InitializeComponent();

            colorPicker.SelectedColor = Settings.DefaultListColor;
        }
Beispiel #3
0
        private void open_administration()
        {
            idTextBox.Clear();
            var adminWindow = new AdminWindow();

            adminWindow.Show();
        }
Beispiel #4
0
        public AddTestWindow(AdminWindow adminWindow)
        {
            this.adminWindow = adminWindow;
            InitializeComponent();

            populate_textboxes();
        }
Beispiel #5
0
 public AddBlockWindow(AdminWindow adminWindow)
 {
     this.adminWindow = adminWindow;
     InitializeComponent();
 }
Beispiel #6
0
 public EditTestWindow(AdminWindow adminWindow)
 {
     InitializeComponent();
     this.adminWindow = adminWindow;
     change_selected();
 }
Beispiel #7
0
 public AddCategoryWindow(AdminWindow adminWindow)
 {
     this.adminWindow = adminWindow;
     InitializeComponent();
 }