list model DAL
来源:互联网 发布:淘宝登录优酷会员 编辑:程序博客网 时间:2024/05/27 16:40
public List<sys_User> GetUserList(int pageIndex, int pageSize, ref int recordCount) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("dbo.[GetUserList]"); db.AddInParameter(dbCommand, "@PageIndex", DbType.Int32, pageIndex); db.AddInParameter(dbCommand, "@PageSize", DbType.Int32, pageSize); db.AddOutParameter(dbCommand, "@RecordCount", DbType.Int32, recordCount); List<sys_User> list = new List<sys_User>(); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { list.Add(ReaderBind(dataReader)); } } recordCount = (int)dbCommand.Parameters["@RecordCount"].Value; return list; } private sys_User ReaderBind(IDataReader dataReader) { sys_User u = new sys_User(); u.UserID = Convert.ToInt32(dataReader["UserID"]); u.UserName = dataReader["UserName"].ToString(); u.LoginName = dataReader["LoginName"].ToString(); u.Gender = Convert.ToInt32(dataReader["Gender"]); u.MobelTel = dataReader["MobelTel"].ToString(); u.InterTel = dataReader["InterTel"].ToString(); u.OfficeTel = dataReader["OfficeTel"].ToString(); u.EmailAddress = dataReader["EmailAddress"].ToString(); object ojb; ojb = dataReader["SoldToUser"]; if (ojb != null && ojb != DBNull.Value) { u.IsSoldToUser = Convert.ToBoolean(ojb); } u.CustomerCode = dataReader["CustomerCode"].ToString(); u.ReceiverCode = dataReader["ReceiverCode"].ToString(); return u; }
*****************************************************************************
public List<sys_User> GetUserListByRoleAllocation(int roleID) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("dbo.[GetUserListByRoleAllocation]"); db.AddInParameter(dbCommand, "@RoleID", DbType.Int32, roleID); List<sys_User> list = new List<sys_User>(); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { sys_User u = new sys_User(); u.UserID = Convert.ToInt32(dataReader["UserID"]); u.UserName = dataReader["UserName"].ToString(); list.Add(u); } } return list; }
********************************************************************************
public DataTable GetOrderProductList(int orderID) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("dbo.[GetOrderProductList]"); db.AddInParameter(dbCommand, "@OrderID", DbType.Int32, orderID); DataSet ds = db.ExecuteDataSet(dbCommand); DataTable dt = ds.Tables[0]; return dt; }
- list model DAL
- model,dal,DataHelp
- .NET中的DAL+IDAL+Model+BLL+Web
- .NET中 DAL+IDAL+Model+BLL+Web
- BLL 、DAL、MODEL三层架构+UI
- 关于BLL DAL MODEL的小问题
- BLL、DAL、IDAL、MODEL、DBUtility、DALFactory层级 (
- DAL
- DAL
- DAL
- DAL
- BLL DAL List四个参数重载方法
- 黑马程序员_精简三层架构DAL(初步认识DAL,Model,DBNull.Value的作用)
- 在.NET中 DAL+IDAL+Model+BLL+Web的含义
- 在.NET中 DAL+IDAL+Model+BLL+Web
- 在.NET中 DAL+IDAL+Model+BLL+Web是什么意思
- 在.NET中 DAL+IDAL+Model+BLL+Web
- 在.NET中 DAL+IDAL+Model+BLL+Web的意思
- 2013年10月12日、|面试心得|
- MyEclipse使用技巧:快速找到某个文件在包中的位置
- RANSAC消除SIFT错配
- js中的preventDefault
- gitlab 411 413错误
- list model DAL
- SSH原理与运用:远程登录
- Latex 换行顶格、不缩进
- 选择jQuery的n个理由
- jquery ajax请求返回xml,html,text,json,..数据实例详解
- C#泛型类之LIST<T>
- 使用jsoncpp解析JSON数据(转)
- 名企经典面试题
- 至多只用一个变量就可以输出九九乘法表