This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Global.asax.cs
124 lines (100 loc) · 3.72 KB
/
Global.asax.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using System.Web.Security;
using System.Web.SessionState;
using System.Web.UI.WebControls;
using System.Xml;
namespace elanat
{
public class Global : HttpApplication
{
public Global()
{
}
public void Application_Start(object sender, EventArgs e)
{
// Set Static Object
// Set Config Value
StaticObject.SetConfigValue();
// Set Code Value
StaticObject.SetCodeValue();
// Set Ip Session Indexe Value
StaticObject.SetIpSessionIndexerValue();
// Set Static File Data Value
StaticObject.SetAfterReferenceDocument();
StaticObject.SetBeforeReferenceDocument();
StaticObject.SetEventReferenceDocument();
StaticObject.SetUrlRedirectDocument();
StaticObject.SetDefaultPageDocument();
StaticObject.SetDynamicExtensionDocument();
StaticObject.SetReplacePartDocument();
StaticObject.SetScriptExtensionDocument();
StaticObject.SetRoleBitColumnAccessDocument();
StaticObject.SetUrlRewriteDocument();
StaticObject.SetStartUpDocument();
StaticObject.SetScheduledTaskDocument();
StaticObject.SetStructDocument();
StaticObject.SetGlobalTemplatesDocument();
StaticObject.SetSiteTemplate();
StaticObject.SetAdminTemplate();
StaticObject.SetLanguageDocument();
// Set Role Value
StaticObject.SetRoleValue();
// Run Script Start Command
StaticObject.RunScriptStartCommand();
// Set Scheduled Tasks Value
StaticObject.ScheduledTasksHasABeenImplemented = false;
StaticObject.StartUpHasABeenImplemented = false;
}
void Application_End(object sender, EventArgs e)
{
// Clean Disk Cache File
FileAndDirectory fad = new FileAndDirectory();
try
{
fad.DeleteAllFileAndSubDirectoryInDirectory(HttpContext.Current.Server.MapPath(StaticObject.SitePath + "App_Data/elanat_system_data/cache/disk/"));
fad.DeleteAllFileAndSubDirectoryInDirectory(HttpContext.Current.Server.MapPath(StaticObject.SitePath + "App_Data/elanat_system_data/session_data/"));
}
catch (Exception) {}
}
void Application_Error(object sender, EventArgs e)
{
}
void Application_BeginRequest(object sender, EventArgs e)
{
}
void Application_EndRequest(object sender, EventArgs e)
{
}
void Session_Start(object sender, EventArgs e)
{
// Increase Online Guest
StaticObject.OnlineGuest++;
try
{
// Run Start Up Page
if (!StaticObject.StartUpHasABeenImplemented)
{
StartUpClass suc = new StartUpClass();
suc.Start();
StaticObject.StartUpHasABeenImplemented = true;
}
// Set Ip Session Indexer
Security sc = new Security();
sc.AddIpSessionIndexer();
}
catch (Exception) { }
}
void Session_End(object sender, EventArgs e)
{
// Decrease Online Guest
StaticObject.OnlineGuest--;
}
}
}