--打卡记录表
create table UsersClock
(
ID int identity primary key, --ID
Department varchar(50), --部门
Name varchar(50), --姓名
Num varchar(50), --打卡号
ClockDate varchar(50), --打卡日期
position varchar(50) --职位
)
--获得所有打卡记录
create proc pro_GetUsersLocks
as
begin
select ID, Department, Name, Num, ClockDate, position from dbo.UsersClock
end
namespace Clock.DAL
{
using System.Configuration;
using Clock.Model;
using System.Data;
using System.Data.SqlClient;
using Dapper;
using Clock.IDAL;
public class UsersClockDAL:IUsersClock
{
private static readonly string ConnectionString = ConfigurationManager.ConnectionStrings["Clock"].ConnectionString;
/// <summary>
/// 获得所有打卡记录
/// </summary>
/// <returns></returns>
public List<UsersClock> GetUsersClocks()
{
SqlConnection conn = new SqlConnection(ConnectionString);
//DynamicParameters parameters = new DynamicParameters();
List<UsersClock> usersClocks = conn.Query<UsersClock>("pro_GetUsersLocks", CommandType.StoredProcedure).ToList();
return usersClocks;
}
}
}