Example #1
0
        private void LoginButton_Click(object sender, EventArgs e)
        {
            bool check = autentification.CheckLogin(LoginBox.Text, PasswordBox.Text);

            if (check)
            {
                ConfigurateRepositories(autentification.GetConnectionString());
                Roles role = autentification.GetRole(LoginBox.Text, PasswordBox.Text);
                Hide();
                string cs = autentification.GetConnectionString();
                switch (role)
                {
                case Roles.Worker:
                    FormForWorker mainWorkerPage = new FormForWorker(this);
                    mainWorkerPage.ShowDialog();
                    break;

                case Roles.Gosty:
                    FormForGosty mainGostyPage = new FormForGosty(this);
                    mainGostyPage.ShowDialog();
                    break;

                case Roles.Buhgalter:
                    FormForBuhgalter mainBuhgalterPage = new FormForBuhgalter(this);
                    mainBuhgalterPage.ShowDialog();
                    break;
                }
            }
            else
            {
                label4.Visible = true;
            }
        }