private void btnHome_Click(object sender, EventArgs e) { AdminHome A = new AdminHome(); A.name = this.name; A.type = this.type; A.Show(); this.Hide(); }
private void btnHome_Click(object sender, EventArgs e) { if (UserType == "Admin") { AdminHome A = new AdminHome(); A.name = this.name; A.type = this.type; A.Show(); this.Hide(); } else if (UserType == "Receptionist") { Receptionist receptionist = new Receptionist(); receptionist.Show(); this.Hide(); } }
private void dlbtn_Click(object sender, EventArgs e) { if (txtUid.Text == "") { MessageBox.Show("Please Select A Row First"); return; } int row = DataAccess.ExecuteQuery("delete from [Hotel_Management].[dbo].[UserLogin] where [Hotel_Management].[dbo].[UserLogin].userID='" + txtUid.Text + "'"); if (row > 0) { MessageBox.Show("Deleted"); AdminHome A = new AdminHome(); A.name = this.name; A.type = this.type; A.Show(); this.Hide(); } }
private void loginBtn_Click(object sender, EventArgs e) { DataTable table1 = DataAccess.LoadData("select * from [Hotel_Management].[dbo].[UserLogin] where userID = '" + loginusername.Text + "' AND password = '******'"); if (table1.Rows.Count != 1) { MessageBox.Show("wrong user Id or Password"); loginusername.Clear(); loginpassword.Clear(); return; } type = table1.Rows[0]["type"].ToString(); if (type == "Admin") { AdminHome A = new AdminHome(); A.name = loginusername.Text; A.type = this.type; A.Show(); this.Hide(); } else if (type == "Receptionist") { Receptionist c = new Receptionist(); c.name = loginusername.Text; c.type = this.type; c.Show(); this.Hide(); } }