| | |
| | | } |
| | | |
| | | // 更新员工状态的方法 |
| | | private bool UpdateStaffStatus(SqlSugarScope db, decimal staffId, |
| | | string status) |
| | | private bool UpdateStaffStatus(SqlSugarScope db, decimal staffId,string status) |
| | | { |
| | | var result = db.Updateable<MesStaff>().SetColumns(s => s.FforbidStatus == status).Where(s => s.Id == staffId).ExecuteCommand(); |
| | | return true; |
| | |
| | | // 插入或更新员工的方法 |
| | | private bool InsertOrUpdateStaff(SqlSugarScope db, MesStaff entity) |
| | | { |
| | | var exists = db.Queryable<MesStaff>().Any(e => e.Id == entity.Id); |
| | | var exists = db.Queryable<MesStaff>().Any(e => e.Id == entity.Id && e.StaffNo==entity.StaffNo); |
| | | if (exists) |
| | | { |
| | | var update = db.Updateable(entity).ExecuteCommand(); |
| | | var update = db.Updateable(entity).Where(e => e.Id == entity.Id && e.StaffNo == entity.StaffNo).ExecuteCommand(); |
| | | return true; |
| | | } |
| | | else |