private void button1_Click(object sender, EventArgs e) { if (usernametxtbox.Text == "admin" && passwordtxtbox.Text == "admin") { PasswordPanel.Hide(); } }
private void TeacherForm_Load(object sender, EventArgs e) { PasswordPanel.Hide(); ControlBox = false; TrueFalseAbsentComboBox.SelectedIndex = 1; AbsentHourComboBox.SelectedIndex = 0; }
private void AddTeacherPasswordButton_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) { PasswordPanel.Hide(); UserSettingsButton.Hide(); } } else if (NewPassTextBox.Text != ConfirmedNewPassTextBox.Text) { MessageBox.Show("Nove lozinke se ne poklapaju !"); } else { MessageBox.Show("Pogrešna lozinka !"); } } }
private void ControlTableButton_Click(object sender, EventArgs e) { StudentPanel.Show(); label2.Show(); UserBox.Show(); TeachersPanel.Hide(); AdministratorPanel.Hide(); DepartmentPanel.Hide(); PasswordPanel.Hide(); }
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(); }
private void UserBox_SelectedIndexChanged(object sender, EventArgs e) { try { string current = selectedUser(); if (current == "Administratora") { AdministratorPanel.Show(); label2.Show(); UserBox.Show(); StudentPanel.Hide(); TeachersPanel.Hide(); PasswordPanel.Hide(); DepartmentPanel.Hide(); } if (current == "Nastavnika") { TeachersPanel.Show(); label2.Show(); UserBox.Show(); StudentPanel.Hide(); AdministratorPanel.Hide(); PasswordPanel.Hide(); DepartmentPanel.Hide(); } if (current == "Ucenika i roditelja") { StudentPanel.Show(); label2.Show(); UserBox.Show(); TeachersPanel.Hide(); AdministratorPanel.Hide(); PasswordPanel.Hide(); DepartmentPanel.Hide(); } if (current == "Odjeljenja i razrednici") { DepartmentPanel.Show(); label2.Show(); UserBox.Show(); StudentPanel.Hide(); TeachersPanel.Hide(); AdministratorPanel.Hide(); PasswordPanel.Hide(); } } catch (Exception exception) { MessageBox.Show(exception.Message); } }
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 !"); } } }
private void TeacherForm_Load(object sender, EventArgs e) { CenterToParent(); PasswordPanel.Hide(); ControlBox = false; TrueFalseAbsentComboBox.SelectedIndex = 1; AbsentHourComboBox.SelectedIndex = 0; MarkComboBox.SelectedIndex = 0; ParentMeetingDateTimePicker.MinDate = DateTime.Now; TimeComboBox.SelectedIndex = 0; bool isStudentsAdded = PopulateStudentsComboBox(); if (isStudentsAdded) { FillStudentInfoLabels(); FillParentInfoLabels(); FillStudentAbsents(); bool isCoursesAdded = PopulateCoursesComboBox(); if (isCoursesAdded) { FillStudentMarks(); } } }
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); } }
private void ControlTableButton_Click(object sender, EventArgs e) { PasswordPanel.Hide(); }