/// <summary>
        /// Builds a FacturaRecibidaList from IList<!--<FacturaRecibida>--> and retrieve FacturaRecibidaInfo Childs from DB
        /// </summary>
        /// <param name="list"></param>
        /// <returns>FacturaRecibidaList</returns>
        public static InputInvoiceList GetChildList(IList <InputInvoice> list)
        {
            InputInvoiceList flist = new InputInvoiceList();

            if (list != null)
            {
                int        sessionCode = InputInvoice.OpenSession();
                CriteriaEx criteria    = null;

                flist.IsReadOnly = false;

                foreach (InputInvoice item in list)
                {
                    criteria = InputInvoiceLine.GetCriteria(sessionCode);
                    criteria.AddEq("OidFactura", item.Oid);
                    item.Conceptos = InputInvoiceLines.GetChildList(criteria.List <InputInvoiceLine>());

                    flist.AddItem(item.GetInfo());
                }

                flist.IsReadOnly = true;

                InputInvoice.CloseSession(sessionCode);
            }

            return(flist);
        }
Ejemplo n.º 2
0
        private static InputInvoiceLineList GetList(string query, bool childs)
        {
            CriteriaEx criteria = InputInvoiceLine.GetCriteria(InputInvoiceLine.OpenSession());

            criteria.Childs = childs;

            criteria.Query = query;
            InputInvoiceLineList list = DataPortal.Fetch <InputInvoiceLineList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
Ejemplo n.º 3
0
        public static InputInvoiceLineList GetChildList(InputInvoiceInfo parent, bool childs)
        {
            CriteriaEx criteria = InputInvoiceLine.GetCriteria(InputInvoiceLine.OpenSession());

            criteria.Query  = InputInvoiceLineList.SELECT(parent);
            criteria.Childs = childs;

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

            CloseSession(criteria.SessionCode);

            return(list);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <param name="get_childs">retrieving the childs</param>
        /// <returns>ConceptoFacturaRecibidaList</returns>
        public static InputInvoiceLineList GetChildList(bool childs)
        {
            CriteriaEx criteria = InputInvoiceLine.GetCriteria(InputInvoiceLine.OpenSession());

            criteria.Childs = childs;

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

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

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