private void btnUserProfile_Click(object sender, EventArgs e) { OwnerProfile op = new OwnerProfile(userid, status); op.Show(); this.Hide(); }
private void btnUpdate_Click(object sender, EventArgs e) { string newstatus = "Unverified"; try { DBConnect dbc = new DBConnect(); String query = "Update OwnerDetails set name = '" + txtName.Text + "', email = '" + txtEmail.Text + "', phonenumber = '" + txtPhone.Text + "', nid = '" + txtNID.Text + "', address = '" + txtAddress.Text + "', status = '" + newstatus + "' where userid = " + userid + " ;"; dbc.InsertIntoDatabase(query); status = newstatus; MessageBox.Show(this, "Update Successful"); OwnerProfile op = new OwnerProfile(userid, status); op.Show(); this.Hide(); } catch (Exception er) { MessageBox.Show(this, "Wrong Input"); Console.WriteLine("Error : " + er); } //string query = "update OwnerDetails(name, email, nid, address) values('" // + txtName.Text + "','" + txtEmail.Text + "','" + txtPhone.Text + "'," + txtNID.Text + ",'" + txtAddress.Text + "' " + ");"; }