Esempio n. 1
0
 public ManageEmployee(HomeOfAdmin ha)
 {
     this.ha = ha;
     InitializeComponent();
     this.Da = new DataAccess();
     this.PopulateGridView();
 }
Esempio n. 2
0
 public ChangePassword(HomeOfAdmin ha, string id, string cp)
 {
     this.id = id;
     this.cp = cp;
     this.ha = ha;
     InitializeComponent();
     this.Da = new DataAccess();
 }
Esempio n. 3
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");
            }
        }