Beispiel #1
0
 public SetMovie(ManagerHome mh)
 {
     InitializeComponent();
     this.Da = new DataAccess();
     this.PopulateGridView();
     this.mh = mh;
 }
Beispiel #2
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            string un = "select * from Login where id = '" + this.txtUserName.Text.ToString() + "' and password = '******';";

            this.Ds = this.Da.ExecuteQuery(un);

            status = this.Ds.Tables[0].Rows[0]["status"].ToString();
            string id = txtUserName.Text;
            string pw = txtPassword.Text;


            if (this.Ds.Tables[0].Rows.Count == 1)
            {
                if (status == "1")

                {
                    this.Visible = false;
                    HomeOfAdmin a = new HomeOfAdmin(this, id, pw);
                    a.Visible = true;
                }
                else if (status == "2")
                {
                    this.Visible = false;
                    ManagerHome m = new ManagerHome(this);
                    m.Visible = true;
                }
                else if (status == "3")
                {
                    this.Visible = false;
                    CustomerLogin u = new CustomerLogin(this, id, pw);
                    u.Visible = true;
                }
            }
            else
            {
                MessageBox.Show("Invalid Credentials");
            }
        }