温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:中小企业网站系统前台源码(SmallBusinessStarterKit)
当前文件:
SmallBusinessStarterKit/smallbusiness_vb/App_Code/People/People.vb[1K,2009-6-12 11:54:22],打开代码结构图
SmallBusinessStarterKit/smallbusiness_vb/App_Code/People/People.vb[1K,2009-6-12 11:54:22],打开代码结构图1Imports System 2
Imports System.Configuration 3
Imports System.Web.Configuration 4
Imports System.Collections 5
Imports System.Collections.Specialized 6
Imports System.Collections.Generic 7
Imports System.Web 8
9
_ 10
'/<summary> 11
'/ class People 12
'/ Provides static functions to access 'people' 13
'/ and serves as abastraction layer between the web Page and 14
'/ actual data providers 15
'/</summary> 16
Public Class People 17
18
Private Shared _isInitialized As Boolean = False 19
Private Shared _provider As PeopleProvider 20
Private Shared _providersSection As SmallBusinessDataProvidersSection 21
22
23
Public Shared ReadOnly Property Provider() As PeopleProvider 24
Get 25
Initialize() 26
Return _provider 27
End Get 28
End Property 29
30
31
Public Shared Function GetAllPersons() As List(Of Person) 32
Return Provider.GetAllPersons() 33
End Function 34
35
36
37
Private Shared Sub Initialize() 38
If Not _isInitialized Then 39
_providersSection = ConfigurationManager.GetSection("SmallBusinessDataProviders") ' 40
41
If _providersSection Is Nothing Then 42
Throw New Exception(Messages.PeopleConfigSectionNotFound) 43
End If 44
45
_provider = ProvidersHelper.InstantiateProvider(_providersSection.PeopleProviders(_providersSection.PeopleProviderName), GetType(PeopleProvider)) 46
47
If _provider Is Nothing Then 48
Throw New Exception("People default provider could not be instantiated") 49
End If 50
End If 51
End Sub 'Initialize 52
End Class 'People







