Tables("本机注册表").Rows(0)("机器码") = ComputerId '在"本机注册表""机器码"列第一行填入机器码
DataTables("本机注册表").Save()
Dim r As Row = Tables("本机注册表").Rows(0) 'r代表"本机注册表"第一行
Dim jqm As DataRow = DataTables("系统注册信息表").Find("机器码 = '" & r("机器码") & "'") 'fdr代表"系统注册信息表"的机器码=r表的机器码
Dim zcm As DataRow = DataTables("系统注册信息表").Find("使用授权 = 'FALSE '") 'fdr代表"系统注册信息表"的机器码=r表的机器码
If jqm Is Nothing Then '如果"本机注册表"的"机器码"与"系统注册信息表"的"机器码"列没有相同内容,那么
MainTable = Tables("系统注册信息表") '打开"***"表
Forms("填写申请资料窗口").Open() '打开"***"窗口
Else
If jqm IsNot Nothing AndAlso jqm("使用授权") = "FALSE" Then '如果"系统注册信息表"的"使用授权"为"FALSE",那么
MessageBox.Show("管理员还未完成对本机的授权,请与管理员联系", "未授权提示",MessageBoxButtons.Ok,MessageBoxIcon.Warning,0, Windows.forms.MessageBoxOptions.ServiceNotification) '弹出提示窗口
Syscmd.Project.Exit() '正常退出飞狐
Return '这个要加上,因为既然要退出,就不应该再执行后面的初始化代码了,否则会出错
Else
If jqm IsNot Nothing AndAlso jqm("使用授权") = "TRUE" AndAlso jqm("截止日期") < Date.Today Then
MessageBox.Show("本计算机使用该软件的期限已经过期,请与管理员联系", "未授权提示",MessageBoxButtons.Ok,MessageBoxIcon.Warning,0, Windows.forms.MessageBoxOptions.ServiceNotification) '弹出提示窗口
Syscmd.Project.Exit() '正常退出飞狐
Return '这个要加上,因为既然要退出,就不应该再执行后面的初始化代码了,否则会出错
Else
If jqm IsNot Nothing AndAlso jqm("使用授权") = "FALSE" AndAlso jqm("截止日期") >= Date.Today Then
MessageBox.Show("管理员还未完成对本机的授权,请与管理员联系", "未授权提示",MessageBoxButtons.Ok,MessageBoxIcon.Warning,0, Windows.forms.MessageBoxOptions.ServiceNotification) '弹出提示窗口
Syscmd.Project.Exit() '正常退出飞狐
Return '这个要加上,因为既然要退出,就不应该再执行后面的初始化代码了,否则会出错
Else
If Syscmd.Project.Update(False,True) = False Then '如果没有升级(False,True)
Forms("用户登录").Open() '打开 用户登录 窗口
If _UserName = "" Then '如果用户名= 空
system.diagnostics.process.GetProcessesByName("foxtable")(0).kill
End If
End If
End If
Applicati '系统抬头显示该名称
MainTable = Tables("主页") '打开"主页"表
Forms("主页背景窗口").Open() '打开"主窗口(主页)"窗口
For Each u As Row In Tables("本机注册表").Rows
Dim dru As DataRow = DataTables("系统注册信息表").Find("机器码 = '" & u("机器码") & "'")
If dru IsNot Nothing Then
For Each s As String In "截止日期".Split("|")
u(s) = dru(s)
Next
End If
Next
End If
End If
End If
If User.Type <> UserTypeEnum.Developer AndAlso User.Type <> UserTypeEnum.Administrator AndAlso _UserGroup <> "特级管理员" AndAlso _UserGroup <> "省公司" Then
Dim fdr As DataRow = DataTables("Users").SQLFind("Name = '" & _userName & "'")
If fdr IsNot Nothing Then
_user分公司 = fdr("分公司")
End If
For Each dt As DataTable In DataTables
If dt.DataCols.Contains("分公司") Then
dt.GlobalHandler.DataRowAdded = True
dt.LoadFilter = "分公司 = '" & _user分公司 & "'" '只加载分公司=当前用户"分公司"列所属分公司内容
dt.Load
End If
Next
Else
For Each dt As DataTable In DataTables
If dt.DataCols.Contains("分公司") Then
dt.GlobalHandler.DataRowAdded = True
dt.LoadFilter = "分公司 <> ''" '加载分公司列不等于"空"
dt.Load
End If
Next
End If