Tag: STR service count AST replaces key data ice sel
<summary>
Function: How long a Time field of a table has been updated (compared to the current time of the database)
KeyName: Database Parameters
Bgdataservice.query4datatable: Database connection replaces itself
</summary>
<returns></returns>
public string Resthjstatus (string keyname)
{
String msg = "Run";
String strSQL = "Select cast ((SYSDATE-ZXSJ) *24*60 as int) Minutes from sys_service_execstatue where [email protected]";
DataTable dt = bgdataservice.query4datatable (strSQL, KeyName);
if (dt. Rows.Count = = 0)
{
Return "service not Started";
}
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 "service stop time greater than 30 days";
}
if (number >=5)//greater than 5min means stop
{
msg = "Stopped" + TS. Days + "Day" + TS. Hours + "hours" + TS. Minutes + "Minutes";
}
return msg;
}
C # Pass in a time value to determine the day of the month and seconds