## 📅2025-11-13 星期四更新
### TimeClock V1.0.2511.1301 本版本作为备份,即将将定时软件从分级升级为秒级,以防万一,故此备份。 - *.[改进]定时功能调整为System.Timers.Timer timer。 - *.[改进]RyTimeClock需要传窗体参数。
This commit is contained in:
parent
23816767b3
commit
1a1426d4d9
Binary file not shown.
Binary file not shown.
|
|
@ -15040,6 +15040,13 @@
|
|||
</summary>
|
||||
<param name="Timeout">超时时间</param>
|
||||
</member>
|
||||
<member name="M:RyWeb.QuickWeb.#ctor(System.Int32,System.Int32)">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="Timeout">超时时间</param>
|
||||
<param name="RetryCount">重试次数</param>
|
||||
</member>
|
||||
<member name="M:RyWeb.QuickWeb.Post(System.String,System.String,System.String)">
|
||||
<summary>
|
||||
以post方式获取网页源码
|
||||
|
|
@ -15075,6 +15082,11 @@
|
|||
<param name="post"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="P:RyWeb.QuickWeb.RetryCount">
|
||||
<summary>
|
||||
重试次数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RyWeb.QuickWeb.HeadText">
|
||||
<summary>
|
||||
头信息
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -1,2 +1,2 @@
|
|||
[TimeClock]
|
||||
hwnd=6239280
|
||||
hwnd=5651228
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
<root>
|
||||
<list id="LastUpdateTime" Value="2025/8/23 17:19:57" />
|
||||
<list id="LastUpdateTime" Value="2025/11/13 10:27:02" />
|
||||
</root>
|
||||
|
|
@ -1,4 +1,11 @@
|
|||
## :date:2025-08-23 星期六更新
|
||||
## :date:2025-11-13 星期四更新
|
||||
|
||||
### TimeClock V1.0.2511.1301
|
||||
本版本作为备份,即将将定时软件从分级升级为秒级,以防万一,故此备份。
|
||||
- :100:[改进]定时功能调整为System.Timers.Timer timer。
|
||||
- :100:[改进]RyTimeClock需要传窗体参数。
|
||||
|
||||
## :date:2025-08-23 星期六更新
|
||||
|
||||
### TimeClock V1.0.2508.2301
|
||||
- :x:[删除]删除对XPTable控件的依赖,界面列表控件全面使用ObjectListView。
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
this.LblName = new System.Windows.Forms.Label();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.LblState = new System.Windows.Forms.Label();
|
||||
this.ryTimeClock1 = new TimeClock.RyTimeClock();
|
||||
this.ryTimeClock1 = new TimeClock.RyTimeClock(this);
|
||||
this.LblVer = new System.Windows.Forms.Label();
|
||||
this.contextMenuStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
|
|
|
|||
|
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
||||
// 方法是按如下所示使用“*”: :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.2508.2301")]
|
||||
[assembly: AssemblyFileVersion("1.0.2508.2301")]
|
||||
[assembly: AssemblyVersion("1.0.2511.1301")]
|
||||
[assembly: AssemblyFileVersion("1.0.2511.1301")]
|
||||
|
|
@ -28,18 +28,9 @@
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Interval = 1000;
|
||||
this.timer1.Tick += new System.EventHandler(this.Timer1_Tick);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ namespace TimeClock
|
|||
[Description("是否开启提醒功能")]
|
||||
public bool Enabled
|
||||
{
|
||||
get {return timer1.Enabled; }
|
||||
get {return timer.Enabled; }
|
||||
set
|
||||
{
|
||||
if (timer1.Enabled != value && !GetIsDesignMode())
|
||||
if (timer.Enabled != value && !GetIsDesignMode())
|
||||
{
|
||||
UpdateTipTime();
|
||||
UpdateTipTime_start(false);
|
||||
|
|
@ -64,7 +64,7 @@ namespace TimeClock
|
|||
}
|
||||
}
|
||||
first_start = false;
|
||||
timer1.Enabled = value;
|
||||
timer.Enabled = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -335,9 +335,14 @@ namespace TimeClock
|
|||
}
|
||||
bool first_start = true;
|
||||
DateTime Last_CloseTime = DateTime.Now;
|
||||
public RyTimeClock()
|
||||
private Form _parentForm;
|
||||
System.Timers.Timer timer = new System.Timers.Timer(1000);
|
||||
public RyTimeClock(Form parentForm)
|
||||
{
|
||||
InitializeComponent();
|
||||
_parentForm = parentForm;
|
||||
timer.SynchronizingObject = parentForm;
|
||||
timer.Elapsed += TimeElapsed;
|
||||
if (!GetIsDesignMode())
|
||||
{
|
||||
TimeClock.Itrycn_Db.CreateTable();
|
||||
|
|
@ -367,66 +372,7 @@ namespace TimeClock
|
|||
}
|
||||
}
|
||||
}
|
||||
DateTime lastRunTime = DateTime.Now.AddDays(-1);
|
||||
bool last_fullscreen = false;
|
||||
bool last_idle = false;
|
||||
/// <summary>
|
||||
/// 计算工作信息
|
||||
/// </summary>
|
||||
/// <param name="dt_now"></param>
|
||||
private void CalcWorkInfo(DateTime dt_now)
|
||||
{
|
||||
var idle = ryCommon.RySystem.GetLastInputTime() / 1000;
|
||||
DateTime dt_now2 = dt_now.AddSeconds(-dt_now.Second).AddMilliseconds(-dt_now.Millisecond);
|
||||
int stype = 0;
|
||||
if (idle>=60)
|
||||
{
|
||||
stype = 0;
|
||||
}
|
||||
else { stype = 1; }
|
||||
DataProvider mydb = new DataProvider();
|
||||
IDbInterface db = TimeClock.Itrycn_Db.CreateDataProvider(TimeClock.Itrycn_Db.dataType);
|
||||
if (db.ConnDb(TimeClock.Itrycn_Db.WorkInfo_ConnStr) == 1)
|
||||
{
|
||||
RyQuickSQL mySQL = new RyQuickSQL("WorkInfo");
|
||||
mySQL.AddField("StartTime", dt_now2.AddMinutes(-1));
|
||||
mySQL.AddField("EndTime", dt_now2);
|
||||
mySQL.AddField("stype", stype);
|
||||
mySQL.AddField("totalSecond", 60);
|
||||
db.ExecuteNonQuery(mySQL.GetInsertSQL());
|
||||
}
|
||||
db.Free();
|
||||
}
|
||||
/// <summary>
|
||||
/// 时间循环一轮是否结束,结束后才能开始下一轮
|
||||
/// </summary>
|
||||
bool TimeComplete = true;
|
||||
/// <summary>
|
||||
/// 开始休息时间
|
||||
/// </summary>
|
||||
DateTime dt_start_idle = DateTime.Now;
|
||||
/// <summary>
|
||||
/// 添加休息记录
|
||||
/// </summary>
|
||||
/// <param name="info"></param>
|
||||
private void AddRestRecord(RestInfo info)
|
||||
{
|
||||
if(Itrycn_Db.list_rest.Count>1000)
|
||||
{
|
||||
Itrycn_Db.list_rest.RemoveAt(0);
|
||||
}
|
||||
Itrycn_Db.list_rest.Add(info);
|
||||
OnRestDataChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
/// <summary>
|
||||
///最近一次是否是休息状态
|
||||
/// </summary>
|
||||
private bool last_IsRestNowing = Itrycn_Info.IsRestNowing;
|
||||
/// <summary>
|
||||
/// 最近一次开始休息的时间
|
||||
/// </summary>
|
||||
private DateTime last_StartRestTime = DateTime.Now;
|
||||
private void Timer1_Tick(object sender, EventArgs e)
|
||||
private void TimeElapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
if (!TimeComplete) { return; }
|
||||
TimeComplete = false;
|
||||
|
|
@ -536,13 +482,12 @@ namespace TimeClock
|
|||
}
|
||||
}
|
||||
}
|
||||
catch{
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
if (!is_form_show)
|
||||
{
|
||||
//System.IO.File.AppendAllText(Application.StartupPath + "\\Logs.txt",
|
||||
//"\r\n" + DateTime.Now + "\t提前一分钟休息弹窗提醒");
|
||||
DbOp.FrmBeforeRestTip frm = new DbOp.FrmBeforeRestTip();
|
||||
frm.FormClosing += delegate (object sender2, FormClosingEventArgs e2)
|
||||
{
|
||||
|
|
@ -848,6 +793,69 @@ namespace TimeClock
|
|||
}
|
||||
TimeComplete = true;
|
||||
}
|
||||
DateTime lastRunTime = DateTime.Now.AddDays(-1);
|
||||
bool last_fullscreen = false;
|
||||
bool last_idle = false;
|
||||
/// <summary>
|
||||
/// 计算工作信息
|
||||
/// </summary>
|
||||
/// <param name="dt_now"></param>
|
||||
private void CalcWorkInfo(DateTime dt_now)
|
||||
{
|
||||
var idle = ryCommon.RySystem.GetLastInputTime() / 1000;
|
||||
DateTime dt_now2 = dt_now.AddSeconds(-dt_now.Second).AddMilliseconds(-dt_now.Millisecond);
|
||||
int stype = 0;
|
||||
if (idle>=60)
|
||||
{
|
||||
stype = 0;
|
||||
}
|
||||
else { stype = 1; }
|
||||
DataProvider mydb = new DataProvider();
|
||||
IDbInterface db = TimeClock.Itrycn_Db.CreateDataProvider(TimeClock.Itrycn_Db.dataType);
|
||||
if (db.ConnDb(TimeClock.Itrycn_Db.WorkInfo_ConnStr) == 1)
|
||||
{
|
||||
RyQuickSQL mySQL = new RyQuickSQL("WorkInfo");
|
||||
mySQL.AddField("StartTime", dt_now2.AddMinutes(-1));
|
||||
mySQL.AddField("EndTime", dt_now2);
|
||||
mySQL.AddField("stype", stype);
|
||||
mySQL.AddField("totalSecond", 60);
|
||||
db.ExecuteNonQuery(mySQL.GetInsertSQL());
|
||||
}
|
||||
db.Free();
|
||||
}
|
||||
/// <summary>
|
||||
/// 时间循环一轮是否结束,结束后才能开始下一轮
|
||||
/// </summary>
|
||||
bool TimeComplete = true;
|
||||
/// <summary>
|
||||
/// 开始休息时间
|
||||
/// </summary>
|
||||
DateTime dt_start_idle = DateTime.Now;
|
||||
/// <summary>
|
||||
/// 添加休息记录
|
||||
/// </summary>
|
||||
/// <param name="info"></param>
|
||||
private void AddRestRecord(RestInfo info)
|
||||
{
|
||||
if(Itrycn_Db.list_rest.Count>1000)
|
||||
{
|
||||
Itrycn_Db.list_rest.RemoveAt(0);
|
||||
}
|
||||
Itrycn_Db.list_rest.Add(info);
|
||||
OnRestDataChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
/// <summary>
|
||||
///最近一次是否是休息状态
|
||||
/// </summary>
|
||||
private bool last_IsRestNowing = Itrycn_Info.IsRestNowing;
|
||||
/// <summary>
|
||||
/// 最近一次开始休息的时间
|
||||
/// </summary>
|
||||
private DateTime last_StartRestTime = DateTime.Now;
|
||||
private void Timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
public class TimeInfo
|
||||
{
|
||||
|
|
|
|||
|
|
@ -117,9 +117,6 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 55</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,9 @@
|
|||
<Reference Include="RaUI">
|
||||
<HintPath>..\..\..\..\睿元公用控件组\Bin\Release\CommonControls\.NET4\RaUI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System">
|
||||
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Design" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user