private void buttonClientSave_Click(object sender, EventArgs e) { if (textBoxClientName.Text == "") { MessageBox.Show("Please fill the required information", "Error"); } else { try { DBL.Clients client = new DBL.Clients(); client.Name = textBoxClientName.Text; client.Username = textBoxClientUsername.Text; client.Password = textBoxClientPassword.Text; client.Mobile = textBoxClientMobile.Text; client.addClient(client); MessageBox.Show("Inserted Well", "Success"); allClientTable(); textBoxClientName.Text = ""; textBoxClientUsername.Text = ""; textBoxClientPassword.Text = ""; textBoxClientMobile.Text = ""; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } } }
public bool foundClient(String username) { DBL.Clients client = new DBL.Clients(); client.Username = username; SqlDataReader rdr = client.getClient(client); if (rdr.Read()) { /* * string col = rdr["id"].ToString(); * MessageBox.Show(col, "Success"); */ return(true); } else { return(false); } }
private void buttonClientDelete_Click(object sender, EventArgs e) { if (textBoxClientSearch.Text == "") { MessageBox.Show("Please fill the required information", "Error"); } else { try { DBL.Clients client = new DBL.Clients(); client.Username = textBoxClientSearch.Text; client.deleteClient(client); MessageBox.Show("Deleted Well", "Success"); allClientTable(); textBoxClientSearch.Text = ""; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } } }