Ejemplo n.º 1
0
 private void UserSettingsButton_Click(object sender, EventArgs e)
 {
     PasswordPanel.Show();
     AdminPanel.Hide();
     label2.Hide();
     ChoseComboBox.Hide();
     TeacherPanel.Hide();
     StudentAndParentPanel.Hide();
     DepartmentsPanel.Hide();
 }
Ejemplo n.º 2
0
 private void ControlTableButton_Click(object sender, EventArgs e)
 {
     ChoseComboBox.SelectedIndex = 0;
     AdminPanel.Show();
     label2.Show();
     ChoseComboBox.Show();
     TeacherPanel.Hide();
     StudentAndParentPanel.Hide();
     DepartmentsPanel.Hide();
     PasswordPanel.Hide();
 }
Ejemplo n.º 3
0
 private void AddDirectorPasswordButton_Click(object sender, EventArgs e)
 {
     if (OldPassTextBox.Text.Length == 0 ||
         NewPassTextBox.Text.Length == 0 ||
         ConfirmedNewPassTextBox.Text.Length == 0)
     {
         warning();
     }
     else
     {
         if (OldPassTextBox.Text == NewPassTextBox.Text)
         {
             MessageBox.Show("Unesite novu lozinku koja se razlikuje od stare !");
         }
         else if (Encrypt.hashPassword(OldPassTextBox.Text) == CurrentUser.Password && NewPassTextBox.Text == ConfirmedNewPassTextBox.Text)
         {
             bool isChanged = UsersRepository.ChangePassword(CurrentUser.Id, OldPassTextBox.Text, NewPassTextBox.Text, ConfirmedNewPassTextBox.Text);
             if (isChanged == true)
             {
                 ChoseComboBox.SelectedIndex = 0;
                 AdminPanel.Show();
                 label2.Show();
                 ChoseComboBox.Show();
                 TeacherPanel.Hide();
                 StudentAndParentPanel.Hide();
                 DepartmentsPanel.Hide();
                 PasswordPanel.Hide();
                 UserSettingsButton.Hide();
             }
         }
         else if (NewPassTextBox.Text != ConfirmedNewPassTextBox.Text)
         {
             MessageBox.Show("Nove lozinke se ne poklapaju !");
         }
         else
         {
             MessageBox.Show("Pogrešna lozinka !");
         }
     }
 }
Ejemplo n.º 4
0
        private void ChoseComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                string current = selectedUser();
                if (current == "Administracija")
                {
                    AdminPanel.Show();
                    label2.Show();
                    ChoseComboBox.Show();
                    TeacherPanel.Hide();
                    StudentAndParentPanel.Hide();
                    DepartmentsPanel.Hide();
                    PasswordPanel.Hide();
                }
                if (current == "Nastavnici")
                {
                    TeacherPanel.Show();
                    label2.Show();
                    ChoseComboBox.Show();
                    StudentAndParentPanel.Hide();
                    AdminPanel.Hide();
                    DepartmentsPanel.Hide();
                    PasswordPanel.Hide();
                }
                if (current == "Učenici i roditelji")
                {
                    StudentAndParentPanel.Show();
                    label2.Show();
                    ChoseComboBox.Show();
                    AdminPanel.Hide();
                    TeacherPanel.Hide();
                    DepartmentsPanel.Hide();
                    PasswordPanel.Hide();
                }

                if (current == "Odjeljenja")
                {
                    DepartmentsPanel.Show();
                    label2.Show();
                    ChoseComboBox.Show();
                    AdminPanel.Hide();
                    TeacherPanel.Hide();
                    StudentAndParentPanel.Hide();
                    PasswordPanel.Hide();
                }
                if (current == "Izvještaji")
                {
                    AdminPanel.Hide();
                    label2.Show();
                    ChoseComboBox.Show();
                    TeacherPanel.Hide();
                    StudentAndParentPanel.Hide();
                    DepartmentsPanel.Hide();
                    PasswordPanel.Hide();
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }