private void onDeleteInvoiceClick(object sender, EventArgs e)
        {
            Invoices inv = new Invoices()
            {
                workOrderNum  = workOrderNumberTb.Text,
                accountNum    = acctNumBox.Text,
                bankID        = bankIDTb.Text,
                streetName    = streetAddressTb.Text,
                cityName      = cityTb.Text,
                stateName     = stateTb.Text,
                zipCode       = zipTb.Text,
                workCompleted = richTb.Text,
            };

            foreach (ListViewItem item in invoiceView.Items)
            {
                if ((string)item.Tag == inv.workOrderNum)
                {
                    item.Remove();
                    if (DeleteInvoiceRecord(inv) == true)
                    {
                        mL.GeneralLog("DELETED ----" + inv.workOrderNum + " - " + inv.Address);
                    }
                }
            }
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Invoices inv = new Invoices()
            {
                workOrderNum  = textBox1.Text,
                accountNum    = comboBox1.Text,
                bankID        = textBox3.Text,
                streetName    = textBox4.Text,
                cityName      = textBox5.Text,
                stateName     = textBox6.Text,
                zipCode       = textBox7.Text,
                workCompleted = textBox2.Text,
                dateAdded     = DateTime.Today.ToString("dd-MM-yyyy")
            };

            if (insertNewInvoice(inv) == true)
            {
                mL.GeneralLog("INSERT ---- " + inv.workOrderNum + " - " + inv.Address);
                _invoiceAddedCallback(inv);

                textBox1.Text  = "";
                comboBox1.Text = "";
                textBox3.Text  = "";
                textBox4.Text  = "";
                textBox5.Text  = "";
                textBox6.Text  = "";
                textBox7.Text  = "";
                textBox2.Text  = "";
            }
        }