private void btnAuthorization_Click(object sender, EventArgs e) //кнопка авторизация { AuthorizationForm authorizationForm = new AuthorizationForm(); this.Hide(); authorizationForm.Show(); }
private void InformationConnection(bool value) //проверка подключения к базе данных { try { Action action = () => { switch (value) { case (true): lbsstConnection.Text = RegistryData.DataSourceIP + "\\" + RegistryData.DataSourceServerName + " - " + RegistryData.InitialCatalog; AuthorizationForm authorizationForm = new AuthorizationForm(); authorizationForm.Show(this); break; case (false): lbsstConnection.Text = MessageUser.NoConnection; foreach (Form f in Application.OpenForms) { if (f.Name == "ConnectionForm") { return; } } ConnectionForm connectionForm = new ConnectionForm(); connectionForm.Show(this); break; } }; Invoke(action); } catch { threadCheckConnection.Abort(); } }
private void miAuthorization_Click(object sender, EventArgs e) //открытие окна авторизации { AuthorizationForm authorizationForm = new AuthorizationForm(); authorizationForm.Show(this); }
private void miExitProfile_Click(object sender, EventArgs e) //выход из профиля { switch (AuthorizationForm.userRole) { case 1: //админ miHandbook.Enabled = false; miRegistrationCardReader.Enabled = false; miBooks.Enabled = false; miFormulars.Enabled = false; miGenreBook.Enabled = false; miPublishingBook.Enabled = false; miWriterBook.Enabled = false; miUsers.Enabled = false; miExitProfile.Enabled = false; miSettings.Enabled = false; miSettings.Enabled = false; miSettingApplication.Enabled = false; miSettingConnection.Enabled = false; miAuthorization.Enabled = true; miPersonalCabinet.Enabled = false; miFeedback.Enabled = false; miStatistics.Enabled = false; break; case 2: //гость miHandbook.Enabled = false; miRegistrationCardReader.Enabled = false; miBooks.Enabled = false; miExitProfile.Enabled = false; miSettings.Enabled = false; miAuthorization.Enabled = true; miPersonalCabinet.Enabled = false; miFeedback.Enabled = false; break; case 3: //директор miHandbook.Enabled = false; miRegistrationCardReader.Enabled = false; miBooks.Enabled = false; miDocument.Enabled = false; miCreateActs.Enabled = false; miExitProfile.Enabled = false; miSettings.Enabled = false; miSettingApplication.Enabled = false; miAuthorization.Enabled = true; miPersonalCabinet.Enabled = false; miFeedback.Enabled = false; miStatistics.Enabled = false; break; case 4: //библиограф miHandbook.Enabled = false; miRegistrationCardReader.Enabled = false; miBooks.Enabled = false; miFormulars.Enabled = false; miGenreBook.Enabled = false; miPublishingBook.Enabled = false; miWriterBook.Enabled = false; miDocument.Enabled = false; miCreateInventoryBook.Enabled = false; miCreateSummaryBook.Enabled = false; miExitProfile.Enabled = false; miSettings.Enabled = false; miSettingApplication.Enabled = false; miAuthorization.Enabled = true; miPersonalCabinet.Enabled = false; miFeedback.Enabled = false; miStatistics.Enabled = false; break; case 5: //библиотекарь miHandbook.Enabled = false; miRegistrationCardReader.Enabled = false; miBooks.Enabled = false; miFormulars.Enabled = false; miIssueBook.Enabled = false; miReturnBook.Enabled = false; miDocument.Enabled = false; miCreatedRegistrationCardAndFormular.Enabled = false; miExitProfile.Enabled = false; miSettings.Enabled = false; miSettingApplication.Enabled = false; miAuthorization.Enabled = true; miPersonalCabinet.Enabled = false; miFeedback.Enabled = false; miStatistics.Enabled = false; break; } AuthorizationForm authorizationForm = new AuthorizationForm(); authorizationForm.Show(this); AuthorizationForm.userRole = 0; }
private void miExitProfile_Click(object sender, EventArgs e) //выход из профиля { switch (AuthorizationForm.userRole) { case 1: miHandbook.Enabled = false; miRegistrationCardReader.Enabled = false; miBooks.Enabled = false; miFormulars.Enabled = false; miGenreBook.Enabled = false; miPublishingBook.Enabled = false; miWriterBook.Enabled = false; miUsers.Enabled = false; miExitProfile.Enabled = false; miSettings.Enabled = false; miSettings.Enabled = false; miSettingApplication.Enabled = false; miSettingConnection.Enabled = false; miAuthorization.Enabled = true; break; case 2: miHandbook.Enabled = false; miRegistrationCardReader.Enabled = false; miBooks.Enabled = false; miExitProfile.Enabled = false; miSettings.Enabled = false; miAuthorization.Enabled = true; break; case 3: miHandbook.Enabled = false; miRegistrationCardReader.Enabled = false; miBooks.Enabled = false; miDocument.Enabled = false; miCreateActs.Enabled = false; miExitProfile.Enabled = false; miSettings.Enabled = false; miSettingApplication.Enabled = false; miAuthorization.Enabled = true; break; case 4: miHandbook.Enabled = false; miRegistrationCardReader.Enabled = false; miBooks.Enabled = false; miFormulars.Enabled = false; miGenreBook.Enabled = false; miPublishingBook.Enabled = false; miWriterBook.Enabled = false; miDocument.Enabled = false; miCreateInventoryBook.Enabled = false; miCreateSummaryBook.Enabled = false; miExitProfile.Enabled = false; miSettings.Enabled = false; miSettingApplication.Enabled = false; miAuthorization.Enabled = true; break; case 5: miHandbook.Enabled = false; miRegistrationCardReader.Enabled = false; miBooks.Enabled = false; miFormulars.Enabled = false; miIssueBook.Enabled = false; miReturnBook.Enabled = false; miDocument.Enabled = false; miCreatedRegistrationCardAndFormular.Enabled = false; miExitProfile.Enabled = false; miSettings.Enabled = false; miSettingApplication.Enabled = false; miAuthorization.Enabled = true; break; } AuthorizationForm authorizationForm = new AuthorizationForm(); authorizationForm.Show(this); AuthorizationForm.userRole = 0; }