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

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

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

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