public static List <string> getLoginInfo(string strUser, string strPass) { string strSql = "select UID,Name,Pass,Email,Phone,Tel,Address,IP,VIP.VName,VImg from [User],VIP where Name='" + strUser.Trim() + "' and Pass='******' and VIP.VID=[User].VID"; List <string> list = new List <string>(); SqlDataReader reader = new DAL.SqlHelper().GetDataReader(strSql); while (reader.Read()) { try { list.Add(reader["UID"].ToString()); } catch { } try { list.Add(reader["Name"].ToString()); } catch { } try { list.Add(reader["Pass"].ToString()); } catch { } try { list.Add(reader["Email"].ToString()); } catch { } try { list.Add(reader["Phone"].ToString()); } catch { } try { list.Add(reader["Tel"].ToString()); } catch { } try { list.Add(reader["Address"].ToString()); } catch { } try { list.Add(reader["IP"].ToString()); } catch { } try { list.Add(reader["VName"].ToString()); } catch { } try { list.Add(reader["VImg"].ToString()); } catch { } } return(list); }
public static List<string> getLoginInfo(string strUser, string strPass) { string strSql = "select UID,Name,Pass,Email,Phone,Tel,Address,IP,VIP.VName,VImg from [User],VIP where Name='" + strUser.Trim() + "' and Pass='******' and VIP.VID=[User].VID"; List<string> list = new List<string>(); SqlDataReader reader = new DAL.SqlHelper().GetDataReader(strSql); while (reader.Read()) { try { list.Add(reader["UID"].ToString()); } catch{ } try { list.Add(reader["Name"].ToString()); } catch{ } try {list.Add(reader["Pass"].ToString()); } catch{ } try {list.Add(reader["Email"].ToString()); } catch{ } try { list.Add(reader["Phone"].ToString()); } catch{ } try { list.Add(reader["Tel"].ToString()); } catch{ } try {list.Add(reader["Address"].ToString()); } catch{ } try { list.Add(reader["IP"].ToString()); } catch{ } try {list.Add(reader["VName"].ToString()); } catch{ } try { list.Add(reader["VImg"].ToString()); } catch { } } return list; }
/// <summary> /// /// </summary> /// <param name="ID"></param> /// <returns></returns> public static List<string> getAllAdminInfoById(int ID) { List<string> list = new List<string>(); SqlDataReader reader = new DAL.SqlHelper().GetDataReader("select * from Admins where AdminID="+ID+""); while (reader.Read()) { list.Add(reader["AdminID"].ToString()); list.Add(reader["UName"].ToString()); list.Add(reader["UPass"].ToString()); } return list; }
/// <summary> /// /// </summary> /// <param name="ID"></param> /// <returns></returns> public static List <string> getAllAdminInfoById(int ID) { List <string> list = new List <string>(); SqlDataReader reader = new DAL.SqlHelper().GetDataReader("select * from Admins where AdminID=" + ID + ""); while (reader.Read()) { list.Add(reader["AdminID"].ToString()); list.Add(reader["UName"].ToString()); list.Add(reader["UPass"].ToString()); } return(list); }