Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }