Esempio n. 1
0
        private void btnMenu_Click(object sender, EventArgs e)
        {
            fAdministrator administrator = new fAdministrator();

            administrator.Show();
            Hide();
        }
Esempio n. 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            HousingCooperativeEntities context = new HousingCooperativeEntities();
            Users user = context.Users.Find(tbLogin.Text);

            try
            {
                if (user.Password == tbPassword.Text)
                {
                    Properties.Settings.Default.ApplicationRole = user.Role;
                    if (user.Role == "Управляющий домом")
                    {
                        fAdministrator administrator = new fAdministrator();
                        administrator.Show();
                        Hide();
                    }
                    else
                    {
                        fReceipts fReceipts = new fReceipts();
                        fReceipts.Show();
                        Hide();
                    }
                }
                else
                {
                    lbWarning.Show();
                }
            }
            catch (Exception)
            {
                lbWarning.Show();
            }
        }