public DataRow[] DisplayAllUsersActive() { DataRow[] allaccount; mydb = new sqlClass(); sSql = "select Email, Active from User"; allaccount = mydb.drExecute(sPath, sSql); if (allaccount == null) { mydb = null; return null; } return allaccount; }
public Dictionary<string, int> GetAccountMessages() { accauntsMessages = new Dictionary<string, int>(); mydb = new sqlClass(); sSql = "select Email, LastCountMessage from User;"; DataRow[] datarows = mydb.drExecute(sPath, sSql); if (datarows == null) { mydb = null; return new Dictionary<string, int>(); } else { foreach (DataRow dr in datarows) { accauntsMessages.Add(dr["Email"].ToString(), int.Parse(dr["LastCountMessage"].ToString())); } return accauntsMessages; } }
public List<string> DisplayAllUsers() { users = new List<string>(); mydb = new sqlClass(); sSql = "select Email from User"; DataRow[] datarows = mydb.drExecute(sPath, sSql); if (datarows == null) { mydb = null; return new List<string>(); } else { foreach (DataRow dr in datarows) { users.Add(dr["Email"].ToString()); } return users; } }
public Dictionary<string, string> ActiveAccount() { activeaccount = new Dictionary<string, string>(); mydb = new sqlClass(); sSql = "select Email, Password from User where Active<>0"; DataRow[] datarows = mydb.drExecute(sPath, sSql); if (datarows == null) { mydb = null; return new Dictionary<string,string>(); } else { foreach (DataRow dr in datarows) { activeaccount.Add(dr["Email"].ToString(), dr["Password"].ToString()); } return activeaccount; } }
public void UpdateAccountMessages(string email, int i) { mydb = new sqlClass(); sSql = @"Update User set LastCountMessage =" + i + " where Email='" + email + "'"; DataRow[] datarows = mydb.drExecute(sPath, sSql); if (datarows == null) { mydb = null; return; } else { mydb = null; } }