public new static IAgenteHipatiaList GetAgentes(EntidadInfo entidad) { IAgenteHipatiaList lista = new IAgenteHipatiaList(new List <IAgenteHipatia>()); if (entidad.Tipo == typeof(Auditoria).Name) { AuditoriaList list = AuditoriaList.GetList(false); foreach (AuditoriaInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(InformeDiscrepancia).Name) { InformeDiscrepanciaList list = InformeDiscrepanciaList.GetList(false); foreach (InformeDiscrepanciaInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(InformeCorrector).Name) { InformeCorrectorList list = InformeCorrectorList.GetList(); foreach (InformeCorrectorInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(InformeAmpliacion).Name) { InformeAmpliacionList list = InformeAmpliacionList.GetList(); foreach (InformeAmpliacionInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else { throw new iQException("No se ha encontrado el tipo de entidad " + entidad.Tipo); } return(lista); }
protected override bool DoFilterByFirst(string value, string column_name) { if (column_name == null) { column_name = ControlsMng.GetCurrentColumn(Tabla).Name; } _filter_results = Localize(value, column_name); return(_filter_results != null); }
protected new SortedBindingList <IAgenteHipatia> Localize(FilterItem item) { SortedBindingList <IAgenteHipatia> list = null; IAgenteHipatiaList sourceList = null; switch (FilterType) { case IFilterType.None: if (List == null) { MessageBox.Show(Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = List; break; case IFilterType.Filter: if (FilteredList == null) { MessageBox.Show(Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = FilteredList; break; } if (item.FilterProperty == IFilterProperty.All) { FCriteria criteria = GetCriteria(string.Empty, item.Value, item.SecondValue, item.Operation); list = sourceList.GetSortedSubList(criteria, _properties_list); } else { FCriteria criteria = GetCriteria(item.Column, item.Value, item.SecondValue, item.Operation); list = sourceList.GetSortedSubList(criteria, _properties_list); } if (list.Count == 0) { PgMng.ShowInfoException(Face.Resources.Messages.NO_RESULTS); return(sourceList); } DatosSearch.DataSource = list; DatosSearch.MoveFirst(); AddFilterItem(item); return(list); }
public new static IAgenteHipatiaList GetAgentes(EntidadInfo entidad) { IAgenteHipatiaList lista = new IAgenteHipatiaList(new List <IAgenteHipatia>()); if (entidad.Tipo == typeof(Cliente).Name) { ClienteList list = ClienteList.GetList(false); foreach (ClienteInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Charge).Name) { ChargeList list = ChargeList.GetList(false); foreach (ChargeInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(OutputInvoice).Name) { OutputInvoiceList list = OutputInvoiceList.GetList(false); foreach (OutputInvoiceInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else { throw new iQException("No se ha encontrado el tipo de entidad " + entidad.Tipo); } return(lista); }
protected override IAgenteHipatiaList GetAgentes(EntidadInfo entidad) { IAgenteHipatiaList lista = new IAgenteHipatiaList(new List <IAgenteHipatia>()); try { lista = Library.Application.AgenteSelector.GetAgentes(entidad); return(lista); } catch { } try { lista = Library.Invoice.AgenteSelector.GetAgentes(entidad); return(lista); } catch { } try { lista = Library.Store.AgenteSelector.GetAgentes(entidad); return(lista); } catch { } try { lista = Library.Instruction.AgenteSelector.GetAgentes(entidad); return(lista); } catch { } try { lista = Library.Quality.AgenteSelector.GetAgentes(entidad); return(lista); } catch { } throw new iQException("No se ha encontrado el tipo de entidad " + entidad.Tipo); }
/// <summary> /// Asigna el objeto principal al origen de datos /// <returns>void</returns> /// </summary> protected override void RefreshMainData() { PgMng.Grow(string.Empty, "Agentes"); long oid = ActiveOID; _list = GetAgentes(CurrentEntidad); Datos.DataSource = _list; DatosSearch.DataSource = Datos.DataSource; Fields_CB.DataSource = Tabla.Columns; Fields_CB.DisplayMember = "HeaderText"; Fields_CB.ValueMember = "DataPropertyName"; if (oid > 0) { Select(oid); } }
protected new IAgenteHipatiaList Localize(object value, string column_name) { IAgenteHipatiaList list = null; if (_list == null) { MessageBox.Show(Messages.NO_RESULTS); return(null); } FCriteria criteria = null; string related = "none"; switch (column_name) { default: { criteria = GetCriteria(column_name, value, _operation); } break; } switch (related) { case "none": { list = _list.GetSortedSubList(criteria, SortProperty, SortDirection); } break; } if (list.Count == 0) { MessageBox.Show(Messages.NO_RESULTS); return(null); } DatosSearch.DataSource = list; DatosSearch.MoveFirst(); return(list); }
public new static IAgenteHipatiaList GetAgentes(EntidadInfo entidad) { IAgenteHipatiaList lista = new IAgenteHipatiaList(new List <IAgenteHipatia>()); if (entidad.Tipo == typeof(BankAccount).Name) { BankAccountList list = BankAccountList.GetList(false); foreach (BankAccountInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else { throw new iQException("No se ha encontrado el tipo de entidad " + entidad.Tipo); } return(lista); }
protected override bool DoFilter(object value) { _filter_results = Localize(value, ((DataGridViewColumn)(Fields_CB.SelectedItem)).Name); return(_filter_results != null); }
public new static IAgenteHipatiaList GetAgentes(EntidadInfo entidad) { IAgenteHipatiaList lista = new IAgenteHipatiaList(new List <IAgenteHipatia>()); if (entidad.Tipo == typeof(Almacen).Name) { StoreList list = StoreList.GetList(false); foreach (StoreInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Despachante).Name) { DespachanteList list = DespachanteList.GetList(false); foreach (DespachanteInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Employee).Name) { EmployeeList list = EmployeeList.GetList(false); foreach (EmployeeInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Expedient).Name) { ExpedienteList list = ExpedienteList.GetList(false); foreach (ExpedientInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(InputInvoice).Name) { InputInvoiceList list = InputInvoiceList.GetList(false); foreach (InputInvoiceInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(LineaFomento).Name) { LineaFomentoList list = LineaFomentoList.GetList(false); foreach (LineaFomentoInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Naviera).Name) { NavieraList list = NavieraList.GetList(false); foreach (NavieraInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Payment).Name) { PaymentList list = PaymentList.GetList(false); foreach (PaymentInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Product).Name) { ProductList list = ProductList.GetList(false); foreach (ProductInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Proveedor).Name) { ProveedorList list = ProveedorList.GetList(false); foreach (ProveedorInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Transporter).Name) { TransporterList list = TransporterList.GetList(false); foreach (TransporterInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else { throw new iQException("No se ha encontrado el tipo de entidad " + entidad.Tipo); } return(lista); }
public new static IAgenteHipatiaList GetAgentes(EntidadInfo entidad) { IAgenteHipatiaList lista = new IAgenteHipatiaList(new List <IAgenteHipatia>()); if (entidad.Tipo == typeof(Alumno).Name) { AlumnoList alumnos = AlumnoList.GetList(false); foreach (AlumnoInfo obj in alumnos) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Instructor).Name) { InstructorList instructores = InstructorList.GetList(false); foreach (InstructorInfo obj in instructores) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Promocion).Name) { PromocionList promociones = PromocionList.GetList(false); foreach (PromocionInfo obj in promociones) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Curso).Name) { CursoList cursos = CursoList.GetList(false); foreach (CursoInfo obj in cursos) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Modulo).Name) { ModuloList modulos = ModuloList.GetList(false); foreach (ModuloInfo obj in modulos) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else { throw new iQException("No se ha encontrado el tipo de entidad " + entidad.Tipo); } return(lista); }