Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            l.username = txtusername.Text;
            l.password = txtpassword.Text;
            bool isSuccess = dal.LoginCheck(l);

            if (isSuccess)
            { //loggedInUSer static metodu username yadda saxlamaq
                loggedInUser = l.username;
                if (l.username == "samirquluzadeh")
                {
                    frmHome home = new frmHome(txtusername.Text);
                    home.Show();
                    this.Hide();
                }
                else if (l.username == "reception")
                {
                    frmReception rec = new frmReception(txtusername.Text);
                    rec.Show();
                    this.Hide();
                }
                else
                {
                    frmForDoctor forDoctor = new frmForDoctor(txtusername.Text);
                    forDoctor.Show();
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("İstifadəçi adı və ya parol səhvdir");
            }
        }
Exemplo n.º 2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            l.username  = txtUsername.Text.Trim();
            l.password  = txtpassword.Text.Trim();
            l.user_type = cmbUserType.Text.Trim();


            bool sucess = dal.LoginCheck(l);

            if (sucess == true)
            {
                MessageBox.Show("Login Successfull");
                loggedIn = l.username;
                switch (l.user_type)
                {
                case "Admin":
                {
                    frmAdminDashboard admin = new frmAdminDashboard();
                    admin.Show();
                    this.Hide();
                }
                break;

                case "User":
                {
                    frmUserDashboard user = new frmUserDashboard();
                    user.Show();
                    this.Hide();
                }
                break;

                default:
                {
                }
                break;
                }
            }

            else
            {
                MessageBox.Show("Login Failed");
            }
        }