private void cmiExitProfile_Click(object sender, EventArgs e) //выход из профиля { switch (AuthorizationForm.userRole) { case 1: lblDelete.Visible = false; pbDelete.Visible = false; dgvOrders.Visible = false; break; case 2: lblDelete.Visible = false; pbDelete.Visible = false; dgvOrders.Visible = false; break; case 3: lblDelete.Visible = false; pbDelete.Visible = false; dgvOrders.Visible = false; break; } Hide(); AuthorizationForm autFm = new AuthorizationForm(); autFm.Show(); AuthorizationForm.userRole = 0; }
//private bool CheckTextLoginPassword() //функция проверки //{ // if (usersForm.CheckPasswordUpperLatin() == true || usersForm.CheckPasswordLowerLatin() == true || usersForm.CheckPasswordUpperCyrill() == true || usersForm.CheckPasswordLowerCyrill() == true || usersForm.CheckPasswordNumber() == true || usersForm.CheckPassworSymbol() == true || usersForm.CheckLoginCyrill() == false) // MessageBox.Show(MessageUser.LetterPassLog, MessageUser.TitleApp, MessageBoxButtons.OK, MessageBoxIcon.Error); // else // return true; // return false; //} //private bool CheckUniqueLogin() //функция проверки уникальности логина //{ // SqlCommand commandSearchLogin = new SqlCommand("", DBConnection.sqlConnection); // commandSearchLogin.CommandText = "select count(*) from [dbo].[User] where CONVERT([nvarchar] (16), DECRYPTBYKEY([Login_User])) = '" + tbLogin.Text + "'"; // DBConnection.sqlConnection.Open(); // dbTables.CommandOpenKey.ExecuteNonQuery(); // uniqueLogin = Convert.ToInt32(commandSearchLogin.ExecuteScalar().ToString()); // dbTables.CommandCloseKey.ExecuteNonQuery(); // RegistryData.DBConnectionString.Close(); // if (uniqueLogin != 0) // MessageBox.Show(MessageUser.UserAlreadyHave, MessageUser.TitleLibrary, MessageBoxButtons.OK, MessageBoxIcon.Error); // else // return true; // return false; //} private void btnAuthoriz_Click(object sender, EventArgs e) { AuthorizationForm authorizationForm = new AuthorizationForm(); authorizationForm.Show(); Hide(); }