Vb.net Billing Software Source Code -
Private Sub CalculateTotals() Dim subtotal As Decimal = 0 For Each row As DataGridViewRow In dgvItems.Rows If Not row.IsNewRow Then subtotal += CDec(row.Cells("colTotal").Value) End If Next
' Save Customer Dim custID As Integer = SaveCustomer(txtCustomerName.Text, txtMobile.Text, txtGSTIN.Text) vb.net billing software source code
Private Sub LoadBillData() ' Fetch Bill Header and Items using billID from DB ' (Implement using OleDbDataAdapter) ' Then bind to PrintDocument End Sub Private Sub CalculateTotals() Dim subtotal As Decimal =
Private Sub SaveBillItem(billID As Integer, productID As Integer, qty As Integer, price As Decimal, total As Decimal) Dim query As String = "INSERT INTO BillItems (BillID, ProductID, Quantity, Price, Total) VALUES (@bid, @pid, @qty, @price, @total)" Using conn As New OleDbConnection(connString) Dim cmd As New OleDbCommand(query, conn) cmd.Parameters.AddWithValue("@bid", billID) cmd.Parameters.AddWithValue("@pid", productID) cmd.Parameters.AddWithValue("@qty", qty) cmd.Parameters.AddWithValue("@price", price) cmd.Parameters.AddWithValue("@total", total) conn.Open() cmd.ExecuteNonQuery() End Using End Sub productID As Integer