using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using Model;
namespace ServerDAL
{
public class UserDAL
{
private static readonly string PROC = "proc_user";
public IList<Users> All(string user)
{
IList<Users> list = new List<Users>();
SqlParameter param = new SqlParameter("@user",user);
using (SqlDataReader dr = SQLServerDAL.SqlHelper.Exefdn(SQLServerDAL.SqlHelper.ConnectionStringLocalTransaction, CommandType.StoredProcedure, PROC, param))
{
while (dr.Read())
{
Users u = new Users();
u.Id = dr.GetInt32(0);
u.Name = dr.GetString(1);
u.Email = dr.GetString(2);
list.Add(u);
}
}
return list;
}
}
}