Example #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string userName, password;

            userName = txtUserName.Text;
            password = txtPassword.Text;
            Users user = db.Users.Where(x => x.UserName == userName && x.Password == password).FirstOrDefault();

            if (user != null)
            {
                if (user.isManager == true)
                {
                    AdminForms.Dashboard dashboard = new AdminForms.Dashboard();
                    this.Hide();
                    dashboard.ShowDialog();
                }
                else
                {
                    PersonelForms.SmartMedicine sm = new PersonelForms.SmartMedicine();
                    this.Hide();
                    sm.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("Kullanıcı adı veya parola yanlış.");
            }
        }