Private Sub btnAddCustomer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddCustomer.Click
Dim CustomerID As Guid
Dim CustomerName As String = ""
Dim dateMade As DateTime
Dim strSQL As String
Dim blnCustomerExist As Boolean = False
Try
blnCustomerExist = CheckCustomers()
If Not blnCustomerExist Then
dateMade = DateTime.Now
CustomerID = New Guid
CustomerName = cboSelectCustomer.Text
strSQL = "INSERT INTO tblCustomers (CustomerID, CustomerName, Enabled, DateMade) "
strSQL = ("VALUES ('" & CustomerID.ToString & "','" & CustomerName.ToString & "','1','" & dateMade.ToString & "')")
Else
MessageBox.Show("Customer already exists...")
End If
'Insert User info into tblCustomers
Catch ex As Exception
End Try
'ADDS New customer txtJobNumber.Text = cboSelectCustomer.SelectedValue.ToString
End Sub
Functions CheckCustomers() as boolean
dim ds as new dataset
ds = select * from tbuser where user_id = 1
if count ds = 0 then
return fasle
else
return true
end if
End Functions