Пример #1
0
        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();
                }
            }
        }
Пример #2
0
        private void Button1_Click(object sender, EventArgs e)
        {
            Form sm = new SpecialistMenu();

            Hide();
            DialogResult res = sm.ShowDialog();

            if (res != DialogResult.Cancel)
            {
                Show();
            }
            else
            {
                Close();
            }
        }
Пример #3
0
        private void Button2_Click(object sender, EventArgs e)
        {
            Data.ChangePassSpMen = textBox2.Text;
            Form spm = new SpecialistMenu();

            Hide();
            DialogResult res = spm.ShowDialog();

            if (res != DialogResult.Cancel)
            {
                Show();
            }
            else
            {
                Close();
            }
        }