/// keyname:数据库参数
///BGDataService.Query4DataTable:数据库连接 自行替换
/// </summary>
/// <returns></returns>
public string restHjStatus(string keyname)
{
string msg = "运行";
string strSql = "select cast((sysdate-zxsj)*24*60 as int) Minutes from sys_service_execstatue where KEYNAME=@0";
DataTable dt = BGDataService.Query4DataTable(strSql, keyname);
if (dt.Rows.Count == 0)
{
return "未启动过服务";
}
int number = Convert.ToInt32(dt.Rows[0]["Minutes"] == DBNull.Value ? "0" : dt.Rows[0]["Minutes"]);
TimeSpan ts = new TimeSpan(0, 0, number, 0);
if (ts.Days > 30)
{
return "服务停止时间大于30天";
}
if (number >=5)//大于5min代表停止
{
msg = "已停止" + ts.Days + "天" + ts.Hours + "小时" + ts.Minutes + "分钟";
}
return msg;
}
标签:
原文地址:
踩
(0)
赞
(0)
举报
评论 一句话评论(0)
,