コード例 #1
0
        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>());
        }
コード例 #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>());
        }