public Account(string username, string password, string ssn, string email, string fname, string lname) { this.ssn = ssn; this.username = username; this.password = password; //FName_txt.Text = fname; this.email = email; this.fname = fname; this.lname = lname; InitializeComponent(); Name_lbl.Text = username; UserNameAE_lbl.Text = username; PassAE_lbl.Text = password; SSNA_lbl.Text = ssn; EmailA_lbl.Text = email; FNameA_lbl.Text = fname; LNameA_lbl.Text = lname; PassAE_lbl.Hide(); UserNameE_txt.Hide(); PasswordE_txt.Hide(); interestAE_cmbo.Hide(); InterestsAE_lbl.Hide(); Email_txt.Hide(); FName_txt.Hide(); LName_txt.Hide(); ShowToolTip.SetToolTip(show_lbl, "Show Password"); ThemeFunction(); con = new OracleConnection(ordb); con.Open(); }
private void Edit_btn_Click(object sender, EventArgs e) { if (Edit_btn.Text.ToString() != "Done") { interestAE_cmbo.Show(); InterestsAE_lbl.Show(); UserNameE_txt.Text = username; UserNameE_txt.Show(); PasswordE_txt.Text = password; PasswordE_txt.Show(); Email_txt.Text = email; Email_txt.Show(); FName_txt.Text = fname; FName_txt.Show(); LName_txt.Text = lname; LName_txt.Show(); Line7_lbl.Location = new Point(3, 269); Edit_btn.Text = "Done"; } else { OracleCommand c = new OracleCommand(); c.Connection = con; c.CommandText = "updateAccount"; c.CommandType = CommandType.StoredProcedure; c.Parameters.Add("ussn", ssn); c.Parameters.Add("ufname", FName_txt.Text); c.Parameters.Add("ulname", LName_txt.Text); c.Parameters.Add("uemail", Email_txt.Text); c.Parameters.Add("upassword", PasswordE_txt.Text); c.Parameters.Add("uusername", UserNameE_txt.Text); c.ExecuteNonQuery(); OracleCommand cc = new OracleCommand(); cc.Connection = con; cc.CommandText = "deleteInterests"; cc.CommandType = CommandType.StoredProcedure; cc.Parameters.Add("ussn", ssn); cc.ExecuteNonQuery(); OracleCommand ccc = new OracleCommand(); ccc.Connection = con; ccc.CommandText = "insertIntersts"; ccc.CommandType = CommandType.StoredProcedure; for (int i = 0; i < Intr.Count; i++) { ccc.Parameters.Clear(); ccc.Parameters.Add("ussn", ssn); ccc.Parameters.Add("intrest", Intr[i]); ccc.ExecuteNonQuery(); } MessageBox.Show("Account Updated"); interestAE_cmbo.Hide(); InterestsAE_lbl.Hide(); UserNameE_txt.Hide(); PasswordE_txt.Hide(); Email_txt.Hide(); FName_txt.Hide(); LName_txt.Hide(); Line7_lbl.Location = new Point(3, 232); Edit_btn.Text = "Edit Info"; } }