1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
|
Dim strincome As String = txtLeadIncome.Text
Dim strpaymentamount As String = txtPaymentAmount.Text
Dim strcontractamount As String = txtContractAmount.Text
If txtLeadIncome.Text = "" Then strincome = "0.0000"
If txtPaymentAmount.Text = "" Then strpaymentamount = "0.000"
If txtContractAmount.Text = "" Then strcontractamount = "0.0000"
Dim sqlstrSaveFields As String = "LeadName='" & txtLeadName.Text & _
"',Address1='" & txtLeadAddress.Text & _
"',Address2='" & txtAddress2.Text & _
"',City='" & txtLeadCity.Text & _
"',State='" & txtLeadState.Text & _
"',Zipcode='" & txtLeadZipCode.Text & _
"',PhoneNumber='" & txtLeadPhone.Text & _
"',Relationship='" & cboRelationshipStatus.Text & _
"',Surname='" & cboSurname.Text & _
"',Age='" & txtLeadAge.Text & _
"',DOB='" & txtLeadDOB.Text & _
"',RentOwnLWP='" & cboRentOwnLWP.Text & _
"',RentOwnLWPHowLong='" & txtRentOwnLWPHowlong.Text & _
"',Occupation='" & txtLeadOccupation.Text & _
"',OccupationHowLong='" & txtOccupationHowLong.Text & _
"',Employer='" & txtEmployer.Text & _
"',WorkPhoneNumber='" & txtWorkPhoneNumber.Text & _
"',SpouseName='" & txtSpouseName.Text & _
"',SpouseOccupation='" & txtSpouseOccupation.Text & _
"',SSN='" & txtLeadSSN.Text & _
"',Reference='" & txtReference.Text & _
"',ReferencePhoneNumber='" & txtReferencePhoneNumber.Text & _
"',Income=" & "CONVERT(money,'" & strincome & "',2)" & _
",PaymentAmount=" & "CONVERT(money,'" & strpaymentamount & "',2)" & _
",ContractAmount=" & "CONVERT(money,'" & strcontractamount & "',2)" & _
",PaymentPlan='" & txtPaymentPlan.Text & _
"',PaymentPlanYears='" & txtPaymentPlanYears.Text & _
"',CreditCardNumber='" & txtCreditCardNumber.Text & _
"',CreditCardCVV='" & txtCVVCode.Text & _
"',CreditCardExpDate='" & txtExpirationDate.Text & _
"',CreditCardName='" & txtNameOnCreditCard.Text & _
"',App='" & txtAppCode.Text & _
"',BankName='" & txtBankName.Text & _
"',BankCity='" & txtBankCity.Text & _
"',BankState='" & txtBankState.Text & _
"',BankRoutingNumber='" & txtBankRoutingNumber.Text & _
"',BankAccountNumber='" & txtBankAccountNumber.Text & _
"',BillDate='" & txtBillDate.Text & _
"',Notes='" & txtNotes.Text & _
"',AlternativePhoneNumber='" & txtLeadAlternatePhoneNumber.Text & _
"',CardType='" & cboCreditCardType.Text & "'"
cboNewCallResult.Text = ""
cboNewKillReason.Text = ""
Dim conn As New SqlConnection()
conn.ConnectionString = dbconstring
Dim cmd As New SqlCommand
cmd.CommandType = CommandType.Text
cmd.CommandText = "UPDATE " & "[user].tbl" & accounttype & "_" & listname & " SET " & sqlstrSaveFields & " WHERE LeadID='" & leadID & "'"
cmd.Connection = conn
Dim previousConnectionState As ConnectionState = conn.State
Try
If conn.State = ConnectionState.Closed Then
conn.Open()
cmd.ExecuteNonQuery()
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
If previousConnectionState = ConnectionState.Closed Then
conn.Close()
End If
End Try
End Sub
|