修改日报时间

This commit is contained in:
gongxh
2022-05-16 10:59:17 +08:00
parent c7762f1c88
commit 9dfb90f683
4 changed files with 13 additions and 5 deletions

View File

@@ -26,11 +26,11 @@ namespace CleanMachine.BLL.CM
if (!_dal.Exists(date)) if (!_dal.Exists(date))
{ {
return _dal.Add(new Model.CM.DayWorkTime() { Date = date, StartValue = value, EndValue = 0 }); return _dal.Add(new Model.CM.DayWorkTime() { Date = date, StartValue = value, StartTime = DateTime.Now, EndValue = 0 });
} }
else else
{ {
return _dal.UpdateEndValue(new Model.CM.DayWorkTime() { Date = date, StartValue = 0, EndValue = value }); return _dal.UpdateEndValue(new Model.CM.DayWorkTime() { Date = date, StartValue = 0, EndValue = value, EndTime = DateTime.Now });
} }
} }

View File

@@ -28,9 +28,9 @@ namespace CleanMachine.DAL.CM
public bool Add(CleanMachine.Model.CM.DayWorkTime model) public bool Add(CleanMachine.Model.CM.DayWorkTime model)
{ {
string strSql = $@"INSERT INTO CM_DayWorkTime string strSql = $@"INSERT INTO CM_DayWorkTime
(Date,StartValue,EndValue) (Date,StartValue,EndValue,StartTime)
values values
(@Date,@StartValue,@EndValue) "; (@Date,@StartValue,@EndValue,@StartTime) ";
return LeadDbHelperSQLite.Execute(strSql, model) > 0; return LeadDbHelperSQLite.Execute(strSql, model) > 0;
} }
@@ -52,7 +52,8 @@ namespace CleanMachine.DAL.CM
public bool UpdateEndValue(CleanMachine.Model.CM.DayWorkTime model) public bool UpdateEndValue(CleanMachine.Model.CM.DayWorkTime model)
{ {
string strSql = $@"UPDATE CM_DayWorkTime SET string strSql = $@"UPDATE CM_DayWorkTime SET
EndValue=@EndValue EndValue=@EndValue,
EndTime=@EndTime
WHERE Date=@Date "; WHERE Date=@Date ";
return LeadDbHelperSQLite.Execute(strSql, model) > 0; return LeadDbHelperSQLite.Execute(strSql, model) > 0;
} }

View File

@@ -10,6 +10,11 @@ namespace CleanMachine.Model.CM
private int startValue; private int startValue;
private int endValue; private int endValue;
private DateTime _startTime;
private DateTime _endTime;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@@ -37,5 +42,7 @@ namespace CleanMachine.Model.CM
set { this.endValue = value; } set { this.endValue = value; }
} }
public DateTime StartTime { get => _startTime; set => _startTime = value; }
public DateTime EndTime { get => _endTime; set => _endTime = value; }
} }
} }

Binary file not shown.