///// <summary> ///// 获取实体 ///// </summary> ///// <param name="userName"></param> ///// <param name="password"></param> ///// <returns></returns> //public UserInfo GetUser(string userName, string password) //{ // string cmdText = "select * from [loachs_users] where [userName] = @userName and [Password]=@password"; // SqlParameter[] prams = { // MSSQLHelper.MakeInParam("@userName",SqlDbType.VarChar,50,userName), // MSSQLHelper.MakeInParam("@password",SqlDbType.VarChar,50,password), // }; // List<UserInfo> list = DataReaderToUserList(MSSQLHelper.ExecuteReader(CommandType.Text, cmdText, prams)); // if (list.Count > 0) // { // return list[0]; // } // return null; //} /// <summary> /// 获取全部 /// </summary> /// <returns></returns> public List <UserInfo> GetUserList() { string cmdText = "select * from [loachs_users] order by [displayorder] asc,[userid] asc"; return(DataReaderToUserList(MSSQLHelper.ExecuteReader(cmdText))); }
//public LinkInfo GetLink(int linkid) //{ // string cmdText = "select * from [loachs_links] where [linkid] = @linkid"; // SqlParameter[] prams = { // MSSQLHelper.MakeInParam("@linkid",SqlDbType.Int,4,linkid) // }; // List<LinkInfo> list = DataReaderToList(MSSQLHelper.ExecuteReader(CommandType.Text, cmdText, prams)); // return list.Count > 0 ? list[0] : null; //} //public List<LinkInfo> GetLinkList(int type, int position, int status) //{ // string condition = " 1=1 "; // if (type != -1) // { // condition += " and [type]=" + type; // } // if (position != -1) // { // condition += " and [position]=" + position; // } // if (status != -1) // { // condition += " and [status]=" + status; // } // string cmdText = "select * from [loachs_links] where " + condition + " order by [displayorder] asc"; // return DataReaderToList(MSSQLHelper.ExecuteReader(cmdText)); //} public List <LinkInfo> GetLinkList() { string cmdText = "select * from [loachs_links] order by [displayorder] asc,[linkid] asc"; return(DataReaderToList(MSSQLHelper.ExecuteReader(cmdText))); }