Beispiel #1
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            this.Hide();
            AdminHome hm = new AdminHome();

            hm.Show();
        }
Beispiel #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string sql = @"Select password from FWVUser where userName='******';";
            var    dt  = DataAccess.GetDataTable(sql);
            int    row = dt.Rows.Count;

            if (row == 1)
            {
                string pass = dt.Rows[0][0].ToString();
                if (pass.Equals(this.txtPassword.Text))
                {
                    if (this.txtUserName.Text == "admin")
                    {
                        MessageBox.Show("Login Successful");
                        this.Hide();
                        AdminHome ahm = new AdminHome();
                        ahm.Show();
                    }
                    else
                    {
                        MessageBox.Show("Login Successful");
                        this.Hide();
                        Home hm = new Home(this.txtUserName.Text);

                        hm.Show();
                    }
                }
                else
                {
                    MessageBox.Show("Invalid");
                }
            }
            else
            {
                MessageBox.Show("Invalid User Name");
            }
        }