Hey Eric,
sorry I'm late responding, been out of town for a week.
Right now I have no commercial project for this. I've been
working the better part of a year with thePhile as a way
to educate myself on web programming and learning to work
with a language--in my case,
VB.Net. I hope to use what I learn
to do contract programming for a local tech company that
sells hardware, software and services. But I'm obviously
not ready yet. What I am doing is adding what I feel are
'essentials' to thePhile, which is a great system that I
have enjoyed working with and have learned a lot from.
Here's where I am--I have written an 'update' page to go
from thePhile's "MyAccount" page to input card/account
info into the accounts_users table, with encryption.
I have put update subs right into the "User" classes
in the business and data tiers. I have also 'borrowed'
the encryption subs from the "ASP.NET E-Commerce"
book (WROX Joke Shop) and placed those into the
accounts.business "User" class. My page updates the database
just fine--real easy to make that happen--but without
the data encrypted. Unfortunately, "WROX Joke Shop" is
not constructed in the same data-business-presentation 3-tier
method as "thePhile" is built in, so I am guessing as to where
to reference the encryption subs I'm trying to adapt from there.
I thought it was a natural to have them in the business class,
so here's how I did it:
------------
Public Function UpdateBankAccountData() As Boolean
Dim theAccount As New Data.DDBankInfo
(myModuleSettings.ConnectionString)
Return theAccount.UpdateBankAccountData( _
myCompanyName, _
myDdRouter, _
myDdAccount)
EncryptData()
End Function
------------
...and here's my handler in the page's code-behind:
------------
Private Sub btnConfirm_Click(ByVal Sender As Object, ByVal e As EventArgs)
Handles btnConfirm.Click
Dim currentUser As New AccBusiness.User( _
CType(Context.User, SitePrincipal))
Dim CompanyName = currentUser.CompanyName
Dim DdRouter = currentUser.DdRouter
Dim DdAccount = currentUser.DdAccount
Dim UpdatedAccount As AccBusiness.User = New AccBusiness.User( _
CType(Context.User, SitePrincipal))
UpdatedAccount.DdRouter = txtDdRouter.Text
UpdatedAccount.DdAccount = txtDdAccount.Text
UpdatedAccount.UpdateBankAccountData()
Response.Redirect("MyAccount.aspx")
End Sub
------------
...as you can see from the above, I have only referenced
the "EncryptData()" sub in the business class's "Update
BankAccountData" function. This is obviously wrong since
I'm getting a non-encrypted, but completed transaction
in the datarow.
I don't know if the encryption methods (and references) belong
in the data tier, or need to be written into the event handler,
or what???
If you have any suggestions, I'd appreciate it.
Also, I am just now delving into SQLServer 2005 and the built-in
encryption, but I want to learn this so as to have an
application-based solution for encryption so I can work in
multiple database environments(make sense?).
Sorry so long and thanks again for looking at this.
Reid C.