修改
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user