显示提示时间
#region 显示提示时间
/**//// <summary>
/// 显示提示时间
/// </summary>
private void ShowTime()
...{
int second = 0;
TimeSpan diff;
string message = string.Empty;
if (EnableWrite() )
...{
diff=ExamETime .Subtract( System.DateTime.Now );
message=" 之后考试结束";
}
else
...{
diff=ExamBTime.Subtract(System.DateTime.Now);
message=" 之后考试开始";
}
//ShowTime
//=ExamETime.Subtract(ExamBTime);
second = Convert.ToInt32( diff.TotalSeconds );
string scriptString = string.Empty;
scriptString = " <script language='Javascript'> "+
//"<!-- "+
" var sum="+ second.ToString() +";"+
" function cDate(oSum) "+
" { "+
" var min=Math.floor(oSum/60); "+
" if(min<1) "+
" { "+
" min==0 "+
" } "+
" var sec=oSum%60; "+
" str=min+':'+sec+'"+message+"'; "+
" return str "+
" }"+
" function submitForm() "+
" { "+
" sum=sum-1 "+
" document.getElementById('Time').value= cDate(sum) "+
" if(sum==0) "+
" { "+
" clearInterval(newstimer); "+
" document.getElementById( 'But_HandOver' ).click();"+
" document.getElementById( 'But_HandOver' ).disabled='disabled';"+
" } "+
" }"+
" var newstimer=setInterval('submitForm()',1000);"+
// "--> "+
" </script> ";
if (!IsStartupScriptRegistered("ShowTime"))
...{
Page.RegisterStartupScript("ShowTime",scriptString);
}
}
#endregion
/**//// <summary>
/// 显示提示时间
/// </summary>
private void ShowTime()
...{
int second = 0;
TimeSpan diff;
string message = string.Empty;
if (EnableWrite() )
...{
diff=ExamETime .Subtract( System.DateTime.Now );
message=" 之后考试结束";
}
else
...{
diff=ExamBTime.Subtract(System.DateTime.Now);
message=" 之后考试开始";
}
//ShowTime
//=ExamETime.Subtract(ExamBTime);
second = Convert.ToInt32( diff.TotalSeconds );
string scriptString = string.Empty;
scriptString = " <script language='Javascript'> "+
//"<!-- "+
" var sum="+ second.ToString() +";"+
" function cDate(oSum) "+
" { "+
" var min=Math.floor(oSum/60); "+
" if(min<1) "+
" { "+
" min==0 "+
" } "+
" var sec=oSum%60; "+
" str=min+':'+sec+'"+message+"'; "+
" return str "+
" }"+
" function submitForm() "+
" { "+
" sum=sum-1 "+
" document.getElementById('Time').value= cDate(sum) "+
" if(sum==0) "+
" { "+
" clearInterval(newstimer); "+
" document.getElementById( 'But_HandOver' ).click();"+
" document.getElementById( 'But_HandOver' ).disabled='disabled';"+
" } "+
" }"+
" var newstimer=setInterval('submitForm()',1000);"+
// "--> "+
" </script> ";
if (!IsStartupScriptRegistered("ShowTime"))
...{
Page.RegisterStartupScript("ShowTime",scriptString);
}
}
#endregion