/// <summary> /// 更新一条数据 /// </summary> /// <param name="model">要更新的实体对象</param> /// <param name="flag">0:HR同步;1:原系统同步 </param> /// <returns>成功返回True,失败返回False</returns> public bool UpdateUserFinger(Sys_UserFinger model, int flag) { using (var conn = OpenConnection()) { var sqlwhere = ""; if (flag == 0) { sqlwhere = @"update Sys_UserFingerInfor set UserHrId=@hrID,Ssn=@ssn,Name=@name,FingerTemplate=@template where UserId=@userID"; } else { sqlwhere = @"update Sys_UserFingerInfor set FingerTemplate1=@template1,FingerTemplate2=@template2 where UserId=@userID"; } var param = new { userID = model.USERID, hrID = model.TITLE, ssn = model.SSN, name = model.NAME, template = model.FingerTemplate, template1 = model.FingerTemplate1, template2 = model.FingerTemplate2 }; var result = conn.Execute(sqlwhere, param); return(result > 0); } }
/// <summary> /// 增加一条数据 /// </summary> /// <param name="model"></param> public void AddUserFinger(Sys_UserFinger model) { using (var conn = OpenConnection()) { const string sqlwhere = @"insert into Sys_UserFingerInfor (UserId,UserHrId,Ssn,Name,FingerTemplate,FingerTemplate1,FingerTemplate2) values (@userID,@hrID,@ssn,@name,@template,@template1,@template2)"; var param = new { userID = model.USERID, hrID = model.TITLE, ssn = model.SSN, name = model.NAME, template = model.FingerTemplate, template1 = model.FingerTemplate1, template2 = model.FingerTemplate2 }; conn.Execute(sqlwhere, param); } }
/// <summary> /// 更新一条数据 /// </summary> /// <param name="model">要更新的实体对象</param> /// <param name="flag">0:HR同步;1:原系统同步</param> /// <returns>成功返回True,失败返回False</returns> public bool UpdateUserFinger(Sys_UserFinger model, int flag) { return(_userDB.UpdateUserFinger(model, flag)); }
/// <summary> /// 增加一条数据 /// </summary> /// <param name="model"></param> public void AddUserFinger(Sys_UserFinger model) { _userDB.AddUserFinger(model); }