public List <Users> SelectList() { List <Users> paperList = new List <Users>(); Users paper = null; using (SqlDataReader dr = DBHelperProcedure.Select("UP_Users_GetList", null)) { while (dr.Read()) { paper = new Users(); paper.Name = dr.GetString(dr.GetOrdinal("name")); paperList.Add(paper); } } return(paperList); }
public Users SelectByID(string paperID) { SqlParameter[] parameters = { new SqlParameter("@paperID", SqlDbType.Int, 4) }; parameters[0].Value = paperID; Users paper = null; using (SqlDataReader dr = DBHelperProcedure.Select("UP_T_Paper_GetModel", parameters)) { if (dr.Read()) { paper = new Users(); paper.Name = dr.GetString(dr.GetOrdinal("paperName")); } } return(paper); }
public List <Users> SelectListByDeptID(int deptID) { SqlParameter[] parms = { new SqlParameter("@deptID", SqlDbType.Int) }; parms[0].Value = deptID; List <Users> paperList = new List <Users>(); Users paper = null; using (SqlDataReader dr = DBHelperProcedure.Select("UP_T_Paper_GetListByDeptID", parms)) { while (dr.Read()) { paper = new Users(); paper.Name = dr.GetString(dr.GetOrdinal("paperName")); paperList.Add(paper); } } return(paperList); }