Dim fl As String = "c:\web\" & e.path
If filesys.FileExists(fl)
Dim idx As Integer = fl.LastIndexOf(".")
Dim ext As String = fl.SubString(idx)
Select Case ext
Case ".jpg",".gif",".png",".bmp",".wmf",".js",".css" ,".html",".htm",".zip",".rar"
e.WriteFile(fl)
Return '这里必须返回
End Select
End If
Dim wb As New weui
Select Case e.Path
Case "用户注册.htm"
Functions.Execute("用户注册",e)
'Case "质量优化.htm"
'Functions.Execute("质量优化",e)
Case "重点客户.htm"
Functions.Execute("重点客户",e)
Case "部门日志.htm"
Functions.Execute("部门日志",e)
Case "历史日志.htm"
Functions.Execute("历史日志",e)
Case "客户档案.htm"
Functions.Execute("客户档案",e)
Case "安装在线.htm"
Functions.Execute("安装在线",e)
Case "深化在线.htm"
Functions.Execute("深化在线",e)
Case "制造在线.htm"
Functions.Execute("制造在线",e)
Case "报价在线.htm"
Functions.Execute("报价在线",e)
Case "验收在线.htm"
Functions.Execute("验收在线",e)
Case "终端客户.htm"
Functions.Execute("终端客户",e)
Case "日志报表.htm"
Functions.Execute("日志报表",e)
Case "管理日志.htm"
Functions.Execute("管理日志",e)
Case "gzrb.htm"
Functions.Execute("工作日志",e)
Case "立项事件.htm"
Functions.Execute("立项事件",e)
Case "立项报表.htm"
Functions.Execute("立项报表",e)
Case "iwood.htm"
Functions.Execute("国际馆木作",e)
Case "备忘报表.htm"
Functions.Execute("备忘报表",e)
Case "财务流水.htm"
Functions.Execute("财务流水",e)
Case "部门财务.htm"
Functions.Execute("部门财务",e)
Case "qsqjal.htm"
Functions.Execute("全景案例",e)
Case "xkf1.htm"
Functions.Execute("家居报备",e)
Case "xkf.htm"
Functions.Execute("木作报备",e)
End Select
'身份验证
Dim Verified As Boolean '用于标记用户是否通过了身份验证
Dim UserName As String = e.Cookies("username") '从cookie中获取用户名
Dim Password As String = e.Cookies("password") '从cookie中获取用户密码
If e.Path = "logon.htm" '如果是通过登录页面访问,从PostValues即可中提取用户名和密码
If e.PostValues.ContainsKey("username") AndAlso e.PostValues.ContainsKey("password") Then
UserName = e.PostValues("username")
Password = e.PostValues("password")
End If
End If
'Dim dr As DataRow 自定义窗口使用 密码是明码
'dr = DataTables("用户表").Find("name = '" & UserName & "'")
'If dr IsNot Nothing AndAlso Password = dr("password") Then
'Verified = True
Dim dr As DataRow
dr = DataTables("用户表").Find("name = '" & UserName & "'")
If dr IsNot Nothing AndAlso dr("config").contains(MD5Encrypt(password)) Then
Verified = True
For Each u As UserInfo In users
output.show(u.name)
If u.name = username Then
'msgbox(u.group)
'msgbox(u.Roles)
wb.AppendCookie("部门",u.group)
wb.AppendCookie("岗位",u.Roles)
wb.AppendCookie("name",u.name)
End If
Next
End If
If Verified AndAlso e.Path = "logon.htm" Then '如果用户访问的是登录页,且身份验证成功
wb.AppendCookie("username",UserName) '将用户名和密码写入cookie
wb.AppendCookie("password",Password)
wb.InsertHTML("<meta http-equiv='Refresh' c>") '直接跳转到首页
e.WriteString(wb.Build) '生成网页
Return '必须的
ElseIf Verified = False AndAlso e.Path <> "logon.htm" Then '如果用户身份验证失败,且访问的不是登录页面
wb.InsertHTML("<meta http-equiv='Refresh' c>") '那么直接跳转到登录页面
e.WriteString(wb.Build) '生成网页
Return '必须的
End If
'开始生成网页
Select Case e.path
Case "logon.htm", "" '登录页面
wb.AddPageTitle("","pageheader","IDIR-CASA","TOCASA WUI OPEN")
If e.PostValues.ContainsKey("username") AndAlso e.PostValues.ContainsKey("password") Then '判断是否是验证失败后的重新登录
wb.AddTopTips("","toptip1","用户名或密码错误!").msec = 2000 '如果用户通过登录按钮访问,则给用户一个2秒的提示.
End If
wb.AddForm("","form1","logon.htm")
With wb.AddInputGroup("form1","ipg1")
.AddInput("username","户名","text")
.AddInput("password","密码","password")
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "登录", "submit")
End With
With wb.AddPageFooter("","pf1","开发版权;IDIR 2000-2188")
.AddLink("艾迪尔国际家居","http://www.idircasa.com")
.AddLink("注册艾迪尔账号","用户注册.htm")
End With
Case "exit.htm" '退出登录
wb.DeleteCookie("username") '清除cookie中原来的用户名和密码
wb.DeleteCookie("password")
wb.InsertHTML("<meta http-equiv='Refresh' c>") '那么直接跳转到登录页面
Case "default.htm" '首页
'Functions.Execute("页面导航",e)
wb.AddPageTitle("","pageheader100","IDIR","艾迪尔国际家居")
wb.AddPageTitle("","pageheader1","","日常工作")
With wb.AddGrid("","g1")
.Add("c11","密码修改", "./images/toast.png", "密码修改.htm")
.Add("c3","工作日志", "./images/buttons_27.ico", "gzrb.htm")
.Add("c3","历史日志", "./images/buttons_27.ico", "历史日志.htm")
.Add("c11","立项事件", "./images/tab.png", "立项事件.htm")
.Add("c12","退出系统", "./images/toast.png", "exit.htm")
.Add("c12","质量优化", "./images/toast.png", "zlyh.htm")
.Add("c11","国际馆木作", "./images/toast.png", "iwood.htm")
End With
wb.AddPageTitle("","pageheader21","","商务管理")
With wb.AddGrid("","g21")
.Add("c2","客户档案", "./images/toast.png", "客户档案.htm")
.Add("c2","木作客户报备", "./images/buttons_27.ico", "xkf.htm")
.Add("c2","家居客户报备", "./images/buttons_27.ico", "xkf1.htm")
.Add("c3","重点客户", "./images/toast.png", "重点客户.htm")
.Add("c3","报价在线", "./images/toast.png", "zdyf.htm")
.Add("c3","商务在线", "./images/toast.png", "终端客户.htm")
.Add("c3","木作在线", "./images/toast.png", "zdyf1.htm")
.Add("c3","订单在线", "./images/toast.png", "订单在线.htm")
End With
wb.AddPageTitle("","pageheader2","","订单管理")
With wb.AddGrid("","g2")
.Add("c2","设计在线", "./images/toast.png", "深化在线.htm")
.Add("c2","制造在线", "./images/toast.png", "制造在线.htm")
.Add("c2","结案订单", "./images/toast.png", "结案订单.htm")
End With
wb.AddPageTitle("","pageheader3","","安装管理")
With wb.AddGrid("","g3")
.Add("c2","安装在线", "./images/toast.png", "安装在线.htm")
.Add("c2","验收在线", "./images/toast.png", "验收在线.htm")
End With
wb.AddPageTitle("","pageheader4","","售后管理")
With wb.AddGrid("","g4")
End With
wb.AddPageTitle("","pageheader5","","客诉管理")
With wb.AddGrid("","g5")
.Add("c11","立项报表", "./images/toast.png", "立项报表.htm")
End With
wb.AddPageTitle("","pageheader6","","部门管理")
With wb.AddGrid("","g6")
.Add("c112","财务流水", "./images/toast.png", "财务流水.htm")
.Add("c112","部门财务", "./images/toast.png", "部门财务.htm")
.Add("c11","立项报表", "./images/toast.png", "立项报表.htm")
.Add("c11","备忘报表", "./images/toast.png", "备忘报表.htm")
End With
wb.AddPageTitle("","pageheader7","","集团资源")
With wb.AddGrid("","g7")
.Add("c1","集团主页", "./images/actionSheet.png", "http://www.idircasa.com")
.Add("c3","个人日志", "./images/toast.png", "日志报表.htm")
.Add("c11","管理日志", "./images/toast.png", "管理日志.htm")
.Add("c11","部门日志", "./images/toast.png", "部门日志.htm")
End With
wb.AddPageTitle("","pageheader8","","待开发功能")
With wb.AddGrid("","g8")
.Add("c10","设计师采集", "./images/button.png").Attribute = ""
.Add("c4","木作需求采集", "./images/button.png").Attribute = ""
.Add("c5","软装需求采集", "./images/button.png").Attribute = ""
.Add("c6","家具需求采集", "./images/button.png").Attribute = ""
.Add("c7","楼盘信息采集", "./images/button.png").Attribute = ""
.Add("c8","特殊产品采集", "./images/button.png").Attribute = ""
.Add("c9","财务报销提交", "./images/button.png").Attribute = ""
.Add("c10","出差申请", "./images/button.png").Attribute = ""
.Add("c12","密码修改", "./images/toast.png", "密码修改.htm")
.Add("c12","客户裂变", "./images/toast.png", "cwls.htm")
.Add("c12","艾定制案例", "./images/toast.png", "qsqjal.htm")
.Add("c13","报价交期查询", "./images/toast.png", "filter.htm")
.Add("c111","项目备忘", "./images/toast.png", "xmbw.htm")
.Add("c10","木作投诉", "./images/toast.png").Attribute = ""
End With
End Select
e.WriteString(wb.Build) '生成网页
Select Case e.Path
Case "zlyh.htm"
wb.AddForm("","form1","receive.htm")
With wb.AddInputGroup("form1","ipg1","文件上传")
With .AddUploader("up128","照片",True)
.AllowDelete = True '允许删除
.Incremental = True '允许重复选择文件或连续拍照
End With
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "button").Attribute= "" '调用js函数上传
End With
wb.AddToast("","tst1", "正在上传",1)
wb.AddToast("","tst2", "上传成功",0)
wb.AddToast("","tst3", "上传失败",0).Icon= "warn"
wb.AppendHTML("<script src='./lib/ajaxform.js'></script>") '引入脚本文件
e.WriteString(wb.Build) '生成网页
Case "receive.htm"
For Each key As String In e.Files.Keys
For Each fln As String In e.Files(key)
e.SaveFile(key,fln,"c:\web\uploadfiles\" & fln) '保存接收到的文件
Next
Next
e.WriteString("OK")
End Select