AspMVC控制层扩展
来自站长百科
导航: 上一页
AspMVC控制层扩展会话
Class ComControl
Private Contorl,Page
'初始化
Private Sub Class_Initialize
If Session("UserName") = "" Then
Response.Write("<script>alert(""" & application("Project") & "提示:请您先登录."");location=""Comlogin.asp""</script>")
Response.End()
Else
If Session("GroupId") <>2 Then
Response.Write("<script>alert(""" & application("Project") & "提示:对不起,您不是企业用户."");location=""Comlogin.asp""</script>")
Response.End()
End If
End If
Set Contorl = new ContorlHelp
Set Page = Contorl.GetPage
End Sub
'销毁
Private Sub Class_Terminate
Set Contorl = Nothing
End sub
Public Property Let SetPageSizes(Pages)
Contorl.SetPageSizes = Pages
End Property
'取得分页对像
Public Property Get PageUrl
PageUrl = Page.PageUrl()
End Property
'取得分页对像
Public Property Get PageUrlnl
PageUrlnl = Page.PageUrlnl()
End Property
'设置是否获PK值
Public Property Let SetPk(PkValue)
Contorl.SetPk = PkValue
End Property
'设置是否获FK值
Public Property Let SetFk(FkValue)
Contorl.SetFk = FkValue
End Property
Public Property Let SetUploadPath(Path)
Contorl.SetUploadPath =Path
End Property
'取得[[分页]]对像
Public Property Get GetConn
Set GetConn =Contorl.GetConn
End Property
'***************************************************
' 用户操作 表:users 操作:Save,Del,List,Model
'***************************************************
'保存及修改/返回Bool
Public Function Saveusers(Req)
Saveusers = Contorl.SaveModel(Req,"users")
End Function
'删除
Public Function Delusers(ID)
Delusers = Contorl.DelModel(ID,"users")
End Function
'[[列表]]/[[数组]]中
Public Function Listusers()
Listusers = Contorl.ListModel("users","[[id]] = " & Session("UserId"))
End Function
'实体/Key
Public Function Modelusers()
Set Modelusers = Contorl.GetModel(Session("UserId"),"users")
End Function
[['实体/Key]]
Public Function Getusers(Id)
Set Getusers = Contorl.GetModel(Id,"users")
End Function
'创建Model
public Function CreateModel(Table)
Set CreateModel = Contorl.CreateModel(Table)
End Function
'SavelModel,保存与修改
public Function ModelSave(Object,Table)
ModelSave = Contorl.ModelSave(Object,Table)
End Function
'TempObjectArr
Public Function CreateTempArr(Sql,ObjectName)
CreateTempArr = Contorl.CreateTempArr(Sql,ObjectName)
End Function
Public Sub Exec(Sql)
Contorl.Exec(Sql)
End Sub