Guys,
I created a Win Application, which includes user database. Now including user security module.
What I'm trying to do now is, enable end users to set own security setting for each user of the application.
Example, each user will belong to specific group, and each group will be assigned to tasks allowed to be performed. (All the info are stored in the SQL db).
So I've created a class, to which I'll supply specific Forms as object like below :
'check security setting for current user
Sample tasks are like :
Now I get error on 'e' = 'Specific cast is not valid'.
I know why this occurs, but don't know way around for this.
Please help.
If you think my logic is wrong. Please correct me.
I created a Win Application, which includes user database. Now including user security module.
What I'm trying to do now is, enable end users to set own security setting for each user of the application.
Example, each user will belong to specific group, and each group will be assigned to tasks allowed to be performed. (All the info are stored in the SQL db).
So I've created a class, to which I'll supply specific Forms as object like below :
'check security setting for current user
VB.NET:
Public Sub SecurityTask(ByVal obj As Object, ByVal userID As Integer, ByVal connKey As String, ByVal moduleName As String)
'Get DAL access
dal = New DataAccess(connKey)
Dim tbl As New Data.DataTable
Dim e As System.Windows.Forms.Control
'store settings
dal.BeginProc("sp_GetSecurityTask")
dal.AddParameter("@UserID", userID)
dal.AddParameter("@Module", moduleName)
dal.EndProc()
dal.ExecuteDataTable(tbl)
dal.ClearCommandCollection()
For i = 0 To tbl.Rows.Count - 1
e = tbl.Rows(i).Item("Task")
obj.e = tbl.Rows(i).Item("Permission")
Next
- MenuItems(1).MenuItems(0).Enabled
- MenuItems(1).MenuItems(1).Enabled
- cmdSave.Enabled
Now I get error on 'e' = 'Specific cast is not valid'.
I know why this occurs, but don't know way around for this.
Please help.
If you think my logic is wrong. Please correct me.