private void btnBack_Click(object sender, EventArgs e) { this.Hide(); FormLoign f = new FormLoign(); f.Show(); }
private void btnDelete_Click(object sender, EventArgs e) { if (pass == txtDelete.Text.ToString()) { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Wojtek\Documents\Data.mdf;Integrated Security=True;Connect Timeout=30"); string query; if (typeOfAccount == "p") { query = "delete from Login where Username = '******' and Password = '******'"; } else { query = "delete from Login2 where Username = '******' and Password = '******'"; } SqlCommand cmd = new SqlCommand(query, con); // wykonuje polecenie sql con.Open(); cmd.ExecuteNonQuery(); con.Close(); // wracamy do okna logowania FormLoign f = new FormLoign(); this.Hide(); MessageBox.Show("Success delete."); f.Show(); } else { MessageBox.Show("Bad password!"); txtDelete.Clear(); } }
private void btnLogOff_Click(object sender, EventArgs e) // wylogowanie sie i przeniesienie do okna logowania { this.Hide(); FormLoign f = new FormLoign(); f.Show(); MessageBox.Show("You are succesfully logged off."); }