JobStep.cs
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using Model;
namespace BLL
{
public class JobStep<T>
{
private T _step;
private DateTime _time;
private string _msg;
public JobStep(T step)
{
_step = step;
_time = DateTime.Now;
_msg = "";
}
public bool Equals(T step)
{
return _step.Equals(step);
}
public bool TimeOut(int ms)
{
TimeSpan span = DateTime.Now - _time;
if (span.TotalMilliseconds > ms)
return true;
else
return false;
}
public void NextStep(T step)
{
_step = step;
_time = DateTime.Now;
_msg = "";
}
public string Msg
{
get
{
return _msg;
}
set
{
if (!string.IsNullOrEmpty(value) && !_msg.Equals(value))
{
_msg = value;
string s = string.Format("{0} (step={1})", _msg, _step.ToString());
Common.log.Info(s);
Common.log.UI_Display(_msg);
}
}
}
}
}