您目前尚未登陆,请选择【登陆】或【注册
首页->新闻文章->破竹CMS4.0免安装版源码>>admin/Scheduling/ViewScheduleStatus.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:破竹CMS4.0免安装版源码
当前文件:文件类型 PozhuCMS/admin/Scheduling/ViewScheduleStatus.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11using Pozhu.Services.Scheduling; 12using Pozhu.Services.Exceptions; 13using Microsoft.VisualBasic; 14using Pozhu.CMS.Web; 15 16public 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
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:破竹CMS4.0免安装版源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号