--
AfterOpenProject事件:
Functions.Execute("更新表结构")
BaseMainForm.Text = "XXX公司【ERP管理系统】"
Forms("用户登录").Open()
If _UserName = "" Then
Syscmd.Project.Exit()
Return \'这个要加上,因为既然要退出,就不应该再执行后面的初始化代码了,否则会出错
End If
StatusBar.Message2= "当前用户:" & _UserName & " 今天日期:" & Date.Today
If _Username = "张三" OrElse _Username = "黎" Then
Dim dt As Date = Date.Today
Dim dr As DataRow = DataTables("生产入库明细表").SQLFind("提醒日期 <= \'" & dt & "\' and 已出货 = 0 " )
If dr IsNot Nothing Then
MessageBox.Show("有产品逾期未出货!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Forms("出货提醒").open
End If
End If
If _Username = "陈" OrElse _Username = "李" Then
Dim dr As DataRow = DataTables("订单明细表").SQLFind("变更 = 1 and 已阅 = 0 " )
If dr IsNot Nothing Then
MessageBox.Show("有客户订单变更!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Forms("订单变更提醒").open
End If
End If
If _Username = "张三" Then
Dim dr As DataRow = DataTables("物料信息表").SQLFind("物料类型 <> 原材料 and 加工价格 = 0 " )
If dr IsNot Nothing Then
MessageBox.Show("有新规格,请及时录入加工单价!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Forms("加工单价新增").open
End If
End If
Forms("主界面").Open()
MainTable = Tables("物料信息表")
If User.Type <> UserTypeEnum.Developer
TableCaptionVisible = 0
End If
Forms("导航栏").Open()
Forms("标题栏").Open()
Output.Logs("登录日志").Add(_UserName & ":" & Date.Now )
Output.Logs("登录日志").Save("\\\\MSSQLSERVER\\Users\\Public\\Documents\\log.txt",1)
Output.Logs("登录日志").Clear
BeforCloseProject事件
Output.Logs("删除日志").Save("\\\\MSSQLSERVER\\Users\\Public\\Documents\\Delete.txt",True)