/// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <param name="retrieve_childs">Retrieving the childs</param>
        /// <returns></returns>
        public static LineaPedidoProveeedorList GetList(bool retrieve_childs)
        {
            CriteriaEx criteria = LineaPedidoProveedor.GetCriteria(LineaPedidoProveedor.OpenSession());

            criteria.Childs = retrieve_childs;

            //No criteria. Retrieve all de List

            if (nHManager.Instance.UseDirectSQL)
            {
                criteria.Query = SELECT();
            }

            LineaPedidoProveeedorList list = DataPortal.Fetch <LineaPedidoProveeedorList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
        public static LineaPedidoProveeedorList GetPendientesChildList(PedidoProveedorInfo parent, bool childs)
        {
            CriteriaEx criteria = LineaPedidoProveedor.GetCriteria(LineaPedidoProveedor.OpenSession());

            criteria.Childs = childs;

            QueryConditions conditions = new QueryConditions
            {
                PedidoProveedor = parent
            };

            criteria.Query = SELECT_PENDIENTES(conditions);

            LineaPedidoProveeedorList list = DataPortal.Fetch <LineaPedidoProveeedorList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }