示例#1
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();
            }
        }
示例#2
0
        private void btnReceipts_Click(object sender, EventArgs e)
        {
            fReceipts fReceipts = new fReceipts();

            fReceipts.Show();
            Hide();
        }