public List <Supermercado> GetALL()
        {
            SqlCommand command = new SqlCommand();

            command.CommandText = "SELECT * FROM Supermercado";
            DataTable table = new DBExecuter().GetData(command);

            if (table.Rows.Count == 0)
            {
                return(null);
            }
            return(table.ToObjectCollection <Supermercado>());
        }
Beispiel #2
0
        public List <Supermercado> GetALL(SqlCommand Where)
        {
            SqlCommand command = new SqlCommand();

            command.CommandText  = "SELECT * FROM Supermercado ";
            command.CommandText += Where.CommandText;
            foreach (SqlParameter item in Where.Parameters)
            {
                command.Parameters.Add(new SqlParameter(item.ParameterName, item.Value));
            }
            DataTable table = new DBExecuter().GetData(command);

            if (table.Rows.Count == 0)
            {
                return(null);
            }
            return(table.ToObjectCollection <Supermercado>());
        }