private void Button2_Click(object sender, EventArgs e) { Form crm = new CreatorMenu(); Hide(); crm.ShowDialog(); Show(); }
private void Button1_Click(object sender, EventArgs e) { Data.PassCr = textBox2.Text; Form crm = new CreatorMenu(); Hide(); crm.ShowDialog(); Show(); }
private void Button1_Click(object sender, EventArgs e) { //настройка ввода логина и пароля var userTA = new dbDataSetTableAdapters.WorkersTableAdapter(); var users = userTA.GetDataByLoginAndPass(textBox1.Text, textBox2.Text); if (users.Count == 0) { MessageBox.Show("Неверный логин или пароль!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } //переходы по формам, зависящие от TypeAcc Data.UserAutorized = userTA.GetDataByLogin(textBox1.Text.Trim()).First(); if (Data.UserAutorized.TypeAcc == 1) { Form cm = new CreatorMenu(); Hide(); DialogResult res = cm.ShowDialog(); if (res != DialogResult.Cancel) { Show(); } else { Close(); } } else if (Data.UserAutorized.TypeAcc == 2) { Form sm = new SpecialistMenu(); Hide(); DialogResult res = sm.ShowDialog(); if (res != DialogResult.Cancel) { Show(); } else { Close(); } } else if (Data.UserAutorized.TypeAcc == 3) { Form tm = new TechnicianMenu(); Hide(); DialogResult res = tm.ShowDialog(); if (res != DialogResult.Cancel) { Show(); } else { Close(); } } }