private void AddExhibitSpase_Click(object sender, EventArgs e) { Floore_Scheme.Image = OriginalScheme; isChange = true; Floor_Name.Text = "Выберите позицию новой точки на схеме"; AdministratorPanel.Hide(); ManagerPanel.Hide(); Cansel.Show(); }
private void ControlTableButton_Click(object sender, EventArgs e) { StudentPanel.Show(); label2.Show(); UserBox.Show(); TeachersPanel.Hide(); AdministratorPanel.Hide(); DepartmentPanel.Hide(); PasswordPanel.Hide(); }
private void UserSettingsButton_Click(object sender, EventArgs e) { UserBox.SelectedIndex = 2; PasswordPanel.Show(); StudentPanel.Hide(); TeachersPanel.Hide(); AdministratorPanel.Hide(); DepartmentPanel.Hide(); label2.Hide(); UserBox.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); } }
public Client() { root = 0; bridge = new Bridge(); isManager = false; isAdmin = false; InitializeComponent(); Cansel.Hide(); LB.Hide(); ManagerPanel.Hide(); AdministratorPanel.Hide(); RefreshAllUseableFloor(); Scheme = new Bitmap(Floore_Scheme.Width, Floore_Scheme.Height); RefreshFloor(); }
private void UseRoot(int root) { switch (root) { case 0: { Autorization.Show(); AdministratorPanel.Hide(); ManagerPanel.Hide(); isManager = false; isAdmin = false; break; } case 1: { Autorization.Hide(); AdministratorPanel.Hide(); ManagerPanel.Show(); isManager = true; isAdmin = false; break; } case 2: { Autorization.Hide(); AdministratorPanel.Show(); ManagerPanel.Show(); isManager = true; isAdmin = true; break; } default: { Autorization.Show(); AdministratorPanel.Hide(); ManagerPanel.Hide(); isManager = false; isAdmin = false; break; } } RefreshAllFloorList(); RefreshFloor(); }
private void ChangePassAdminButton_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 && OldPassTextBox.Text == CurrentUser.Password) { 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) { StudentPanel.Show(); label2.Show(); UserBox.Show(); TeachersPanel.Hide(); AdministratorPanel.Hide(); DepartmentPanel.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 buttonPrevious_Click(object sender, EventArgs e) { administratorPanel = new AdministratorPanel(); administratorPanel.Show(); this.Hide(); }
private void AcceptButton_Click(object sender, EventArgs e) { // Pin Code PinVAL pinCode = null; // Validate Pin Code try { pinCode = new PinVAL(PinCodeTextBox.Text); } catch (PinVAL_Exception p_e) { ErrorLabel.Text = p_e.What(); ErrorLabel.Show(); } if (pinCode != null) { // Login basic user if (pinCode._Value.Length == 4) { try { // Connect with basic users database MockBasicUsersRepository mockBasicUsersRepository = new MockBasicUsersRepository(SystemSettings._PlatformType); // Get information about basic user with respectively pin code // from database BasicUserPanelVM basicUserPanelVM = new BasicUserPanelVM { basicUser = mockBasicUsersRepository.GetAll().FirstOrDefault( (singleBasicUser) => singleBasicUser._Pin._Value == pinCode._Value) }; // Check basic user's find result if (basicUserPanelVM.basicUser != null) { // Redirect to Basic User Panel basicUserPanelVM.loginPanel = this; BasicUserPanel basicUserPanel = new BasicUserPanel(basicUserPanelVM); this.PinCodeTextBox.Clear(); this.ErrorLabel.Hide(); basicUserPanel.Show(); this.Hide(); } else { ErrorLabel.Text = "!!! Użytkownik O Podanym Pinie Nie Istnieje !!!"; ErrorLabel.Show(); } } catch (MockBasicUsersRepository_Exception mbur_e) { ErrorLabel.Text = mbur_e.What(); ErrorLabel.Show(); } } // Login administrator else if (pinCode._Value.Length == 6) { try { // Connect with administrators database MockAdministratorsRepository mockAdministratorsRepository = new MockAdministratorsRepository(SystemSettings._PlatformType); // Get information about administrator with respectively pin code // from database AdministratorPanelVM administratorPanelVM = new AdministratorPanelVM { administrator = mockAdministratorsRepository.GetAll(). FirstOrDefault((singleAdministrator) => singleAdministrator._Pin._Value == pinCode._Value) }; // Check administrator's find result if (administratorPanelVM.administrator != null) { // Redirect to administrator panel administratorPanelVM.loginPanel = this; AdministratorPanel administratorPanel = new AdministratorPanel(administratorPanelVM); this.PinCodeTextBox.Clear(); this.ErrorLabel.Hide(); administratorPanel.Show(); this.Hide(); } else { ErrorLabel.Text = "!!! Użytkownik O Podanym Pinie Nie Istnieje !!!"; ErrorLabel.Show(); } } catch (MockAdministratorsRepository_Exception mar_e) { ErrorLabel.Text = mar_e.What(); ErrorLabel.Show(); } } } }