// Update name and invoise amount of client in Invoice table using ID private void btnUpdate_Click(object sender, EventArgs e) { if (txtUpdId.Text != "") { SQLFunctions.Update(Convert.ToInt32(txtUpdId.Text), txtNewClientName.Text, numNewInvoice.Value); SQLFunctions.Refresh(this.dataGridView1); } }
// Insert into Invoice table new line with name and sum of money private void btnInsert_Click(object sender, EventArgs e) { if (insertBox.Text != "") { SQLFunctions.Insert(insertBox.Text, numInvoice.Value); SQLFunctions.Refresh(this.dataGridView1); } }
// Delete from Invoice table new line using ID of Client private void btnDelete_Click(object sender, EventArgs e) { if (txtID.Text != "") { SQLFunctions.Delete(Convert.ToInt32(txtID.Text)); SQLFunctions.Refresh(this.dataGridView1); } }
// Filter data in grid by name written in textbox private void textboxNameFilter_TextChanged(object sender, EventArgs e) { SQLFunctions.Select(this.dataGridView1, textboxNameFilter.Text); }
// Staring initialization of Invoice table private void Invoice_Load(object sender, EventArgs e) { SQLFunctions.Refresh(this.dataGridView1); }