/// <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); }
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); }
public static string SELECT(InputInvoiceInfo factura) { string query; QueryConditions conditions = new QueryConditions { FacturaRecibida = factura }; query = InputInvoiceLine.SELECT(conditions, false); return(query); }
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); }
public static InputInvoiceLineList GetByFacturaList(long oid_factura, bool childs) { InputInvoiceLineList list; QueryConditions conditions = new QueryConditions { FacturaRecibida = InputInvoice.New().GetInfo(false) }; conditions.FacturaRecibida.Oid = oid_factura; list = GetList(InputInvoiceLine.SELECT(conditions, false), childs); return(list); }
/// <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); }
public void CopyValues(InputInvoiceLine source) { if (source == null) { return; } _record.CopyValues(source._base.Record); _oid_store = source.OidAlmacen; _store = source.Almacen; _store_id = source.IDAlmacen; _cuenta_contable = source.CuentaContable; _n_factura = source.NFactura; _fecha_factura = source.FechaFactura; _acreedor = source.Acreedor; _id_batch = source.IDBatch; }
public static InputInvoiceLineList GetChildList(IList <InputInvoiceLine> list) { InputInvoiceLineList flist = new InputInvoiceLineList(); if (list != null) { int sessionCode = InputInvoiceLine.OpenSession(); flist.IsReadOnly = false; foreach (InputInvoiceLine item in list) { flist.AddItem(item.GetInfo()); } flist.IsReadOnly = true; InputInvoiceLine.CloseSession(sessionCode); } return(flist); }
public static InputInvoiceLineList GetCostesByExpedienteList(long oidExpediente, bool childs, bool cache) { InputInvoiceLineList list; if (!Cache.Instance.Contains(typeof(InputInvoiceLineList))) { QueryConditions conditions = new QueryConditions { Expedient = ExpedientInfo.New(oidExpediente), TipoAcreedor = new ETipoAcreedor[1] { ETipoAcreedor.Proveedor } }; list = GetList(InputInvoiceLine.SELECT_COSTES(conditions, false), childs); Cache.Instance.Save(typeof(InputInvoiceLineList), list); } else { list = Cache.Instance.Get(typeof(InputInvoiceLineList)) as InputInvoiceLineList; } return(list); }
public static string SELECT(Library.Store.QueryConditions conditions) { return(InputInvoiceLine.SELECT(conditions, false)); }