예제 #1
0
        // 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);
            }
        }
예제 #2
0
        // 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);
            }
        }
예제 #3
0
        // 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);
            }
        }
예제 #4
0
        // Filter data in grid by name written in textbox

        private void textboxNameFilter_TextChanged(object sender, EventArgs e)
        {
            SQLFunctions.Select(this.dataGridView1, textboxNameFilter.Text);
        }
예제 #5
0
        // Staring initialization of Invoice table

        private void Invoice_Load(object sender, EventArgs e)
        {
            SQLFunctions.Refresh(this.dataGridView1);
        }