温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:破竹CMS4.0免安装版源码
当前文件:
PozhuCMS/admin/Scheduling/ViewScheduleStatus.aspx.cs,打开代码结构图
PozhuCMS/admin/Scheduling/ViewScheduleStatus.aspx.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using Pozhu.Services.Scheduling; 12
using Pozhu.Services.Exceptions; 13
using Microsoft.VisualBasic; 14
using Pozhu.CMS.Web; 15
16
public partial class admin_Scheduling_ViewScheduleStatus : AdminPageBase 17
{ 18
private ScheduleStatus Status; 19
20
private void BindData() 21
{ 22
lblFreeThreads.Text = SchedulingProvider.Instance().GetFreeThreadCount().ToString(); 23
lblActiveThreads.Text = SchedulingProvider.Instance().GetActiveThreadCount().ToString(); 24
lblMaxThreads.Text = SchedulingProvider.Instance().GetMaxThreadCount().ToString(); 25
26
Collection arrScheduleQueue = SchedulingProvider.Instance().GetScheduleQueue(); 27
if( arrScheduleQueue.Count == 0 ) 28
{ 29
pnlScheduleQueue.Visible = false; 30
} 31
else 32
{ 33
dgScheduleQueue.DataSource = arrScheduleQueue; 34
dgScheduleQueue.DataBind(); 35
} 36
37
Collection arrScheduleProcessing = SchedulingProvider.Instance().GetScheduleProcessing(); 38
if( arrScheduleProcessing.Count == 0 ) 39
{ 40
pnlScheduleProcessing.Visible = false; 41
} 42
else 43
{ 44
dgScheduleProcessing.DataSource = arrScheduleProcessing; 45
dgScheduleProcessing.DataBind(); 46
} 47
} 48
49
private void BindStatus() 50
{ 51
Status = SchedulingProvider.Instance().GetScheduleStatus(); 52
lblStatus.Text = Status.ToString(); 53
if( Status == ScheduleStatus.STOPPED && SchedulingProvider.SchedulerMode != SchedulerMode.DISABLED ) 54
{ 55
cmdStart.Enabled = true; 56
cmdStop.Enabled = false; 57
} 58
else if( Status == ScheduleStatus.WAITING_FOR_REQUEST || SchedulingProvider.SchedulerMode == SchedulerMode.DISABLED ) 59
{ 60
cmdStart.Enabled = false; 61
cmdStop.Enabled = false; 62
} 63
else 64
{ 65
cmdStart.Enabled = false; 66
cmdStop.Enabled = true; 67
} 68
} 69
70
protected string GetOverdueText( double OverdueBy ) 71
{ 72
if( OverdueBy > 0 ) 73
{ 74
return OverdueBy.ToString(); 75
} 76
else 77
{ 78
return ""; 79
} 80
} 81
82
/// <summary> 83
/// Page_Load runs when the control is loaded. 84
/// </summary> 85
/// <returns></returns> 86
/// <remarks> 87
/// </remarks> 88
/// <history> 89
/// [cnurse] 9/28/2004 Updated to reflect design changes for Help, 508 support 90
/// and localisation 91
/// </history> 92
protected void Page_Load( Object sender, EventArgs e ) 93
{ 94
try 95
{ 96
if( SchedulingProvider.Enabled ) 97
{ 98
if( ! Page.IsPostBack ) 99
{ 100
BindData(); 101
BindStatus(); 102
} 103
} 104
else 105
{ 106
107
lblStatus.Text = "Disabled"; 108
cmdStart.Enabled = false; 109
cmdStop.Enabled = false; 110
lblFreeThreads.Text = "0"; 111
lblActiveThreads.Text = "0"; 112
lblMaxThreads.Text = "0"; 113
pnlScheduleQueue.Visible = false; 114
pnlScheduleProcessing.Visible = false; 115
} 116
} 117
catch( Exception exc ) //Module failed to load 118
{ 119
Exceptions.LogException( exc ); 120
} 121
} 122
123
/// <summary> 124
/// cmdStart_Click runs when the Start Button is clicked 125
/// </summary> 126
/// <returns></returns> 127
/// <remarks> 128
/// </remarks> 129
/// <history> 130
/// [cnurse] 9/28/2004 Updated to reflect design changes for Help, 508 support 131
/// and localisation 132
/// </history> 133
protected void cmdStart_Click( Object sender, EventArgs e ) 134
{ 135
SchedulingProvider.Instance().StartAndWaitForResponse(); 136
BindData(); 137
BindStatus(); 138
} 139
140
/// <summary> 141
/// cmdStop_Click runs when the Stop Button is clicked 142
/// </summary> 143
/// <returns></returns> 144
/// <remarks> 145
/// </remarks> 146
/// <history> 147
/// [cnurse] 9/28/2004 Updated to reflect design changes for Help, 508 support 148
/// and localisation 149
/// </history> 150
protected void cmdStop_Click( Object sender, EventArgs e ) 151
{ 152
SchedulingProvider.Instance().Halt("ManuallyStopped"); 153
BindData(); 154
BindStatus(); 155
} 156
157
158
159
160
} 161





}
}