This commit is contained in:
gongxh
2022-05-17 09:25:44 +08:00
parent 4fe118f2e5
commit d14b2ac45f
14 changed files with 125 additions and 114 deletions

View File

@@ -16,10 +16,10 @@ namespace CleanMachine.DAL.CM
/// <summary>
/// 存在
/// </summary>
public bool Exists(DateTime Date)
public bool Exists(DateTime Date,string UserName)
{
string strSql = @"SELECT count(1) from CM_DayWorkTime WHERE Date=@Date ";
return LeadDbHelperSQLite.ExecuteScalar<int>(strSql, new { Date }) > 0;
string strSql = @"SELECT count(1) from CM_DayWorkTime WHERE Date=@Date and UserName=@UserName ";
return LeadDbHelperSQLite.ExecuteScalar<int>(strSql, new { Date, UserName }) > 0;
}
/// <summary>
@@ -28,9 +28,9 @@ namespace CleanMachine.DAL.CM
public bool Add(CleanMachine.Model.CM.DayWorkTime model)
{
string strSql = $@"INSERT INTO CM_DayWorkTime
(Date,StartValue,EndValue,StartTime)
(Date,StartValue,EndValue,StartTime,UserName)
values
(@Date,@StartValue,@EndValue,@StartTime) ";
(@Date,@StartValue,@EndValue,@StartTime,@UserName) ";
return LeadDbHelperSQLite.Execute(strSql, model) > 0;
}
@@ -41,7 +41,7 @@ namespace CleanMachine.DAL.CM
{
string strSql = $@"UPDATE CM_DayWorkTime SET
StartValue=@StartValue,EndValue=@EndValue
WHERE Date=@Date ";
WHERE Date=@Date and UserName=@UserName ";
return LeadDbHelperSQLite.Execute(strSql, model) > 0;
}