public List <Account> GetRestaurantAccounts(int RestaurantID) { string sql = "Select * From Account Where RestaurantID = @restaurantid"; Dictionary <object, object> parameters = new Dictionary <object, object>(); parameters.Add("restaurantid", RestaurantID); DataSet results = GetDataSetSql(sql, parameters); List <Account> Accounts = new List <Account>(); if (results != null && results.Tables[0].Rows.Count > 0) { for (int x = 0; x < results.Tables[0].Rows.Count; x++) { Account a = DataSetParser.DataSetToAccount(results, x); Accounts.Add(a); } } else { return(null); } return(Accounts); }
public Account GetAccountByID(int id) { string sql = "Select * From Account where AccountID= @id"; Dictionary <object, object> parameters = new Dictionary <object, object>(); parameters.Add("id", id.ToString()); DataSet results = GetDataSetSql(sql, parameters); Account a = null; if (results != null && results.Tables[0].Rows.Count > 0) { a = DataSetParser.DataSetToAccount(results, 0); } return(a); }
public Account Check(string Email) { string sql = "Select * From Account where Email = @Email"; Dictionary <object, object> parameters = new Dictionary <object, object>(); parameters.Add("Email", Email.ToString()); DataSet results = GetDataSetSql(sql, parameters); Account a = null; if (results != null && results.Tables[0].Rows.Count > 0) { a = DataSetParser.DataSetToAccount(results, 0); } else { return(null); } return(a); }