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);
        }
Exemple #2
0
        public AgenteAddForm(EntidadInfo entity, IAgenteHipatia agent, Form parent)
            : base(-1, parent)
        {
            InitializeComponent();

            _entity.CopyFrom(entity, agent);
            _entity.Codigo = _entity.GetCode();
            SetFormData();

            _mf_type  = ManagerFormType.MFAdd;
            this.Text = Resources.Labels.AGENTE_ADD_TITLE;
        }
        public AgenteSelectBaseForm(EntidadInfo entidad, bool isModal, Form parent, string schema)
            : base(isModal, parent)
        {
            InitializeComponent();

            SetView(molView.Select);
            _entidad = entidad;

            // Parche para poder abrir el formulario en modo diseño y no perder la configuracion de columnas
            DatosLocal_BS    = Datos;
            Tabla.DataSource = DatosLocal_BS;

            SetMainDataGridView(Tabla);

            base.SortProperty = Nombre.DataPropertyName;
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }
        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 virtual IAgenteHipatiaList GetAgentes(EntidadInfo entidad)
 {
     throw new iQImplementationException("SelectAgenteInputBaseForm::GetAgentes()");
 }
Exemple #8
0
        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);
        }
Exemple #9
0
 public AgenteSelectForm(Form parent, EntidadInfo entidad)
     : base(entidad, true, parent)
 {
     InitializeComponent();
 }
Exemple #10
0
        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);
        }
Exemple #11
0
        protected override void SelectEntities(EntidadInfo entidad)
        {
            _tipo            = entidad.Tipo;
            _entity_type_oid = entidad.Oid;
            switch (_tipo)
            {
            case "Cliente":
            {
                ClienteList        clientes = ClienteList.GetList(false);
                List <ClienteInfo> lista    = new List <ClienteInfo>();

                foreach (ClienteInfo obj in clientes)
                {
                    if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null)
                    {
                        lista.Add(obj);
                    }
                }
                Datos_Agentes.DataSource = lista;
            }
            break;

            case "Alumno":
            {
                AlumnoList        alumnos = AlumnoList.GetList(false);;
                List <AlumnoInfo> lista   = new List <AlumnoInfo>();

                foreach (AlumnoInfo obj in alumnos)
                {
                    if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null)
                    {
                        lista.Add(obj);
                    }
                }

                Datos_Agentes.DataSource = lista;
            }
            break;

            case "Empleado":
            {
                InstructorList        empleados = InstructorList.GetList(false);
                List <InstructorInfo> lista     = new List <InstructorInfo>();

                foreach (InstructorInfo obj in empleados)
                {
                    if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null)
                    {
                        lista.Add(obj);
                    }
                }

                Datos_Agentes.DataSource = lista;
            }
            break;
            //case "Factura":
            //    {
            //        FacturaList facturas = FacturaList.GetList(false);
            //        List<FacturaInfo> lista = new List<FacturaInfo>();

            //        foreach (FacturaInfo obj in facturas)
            //        {
            //            if (!entidad.Agentes.ContainsAgent(obj.Oid))
            //                lista.Add(obj);
            //        }

            //        Datos_Agentes.DataSource = lista;
            //    }
            //    break;
            case "Auditoria":
            {
                AuditoriaList        auditorias = AuditoriaList.GetList();
                List <AuditoriaInfo> lista      = new List <AuditoriaInfo>();

                foreach (AuditoriaInfo obj in auditorias)
                {
                    if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null)
                    {
                        lista.Add(obj);
                    }
                }

                Datos_Agentes.DataSource = lista;
            }
            break;

            case "Proveedor":
            {
                ProveedorList        proveedores = ProveedorList.GetList(false);
                List <ProveedorInfo> lista       = new List <ProveedorInfo>();

                foreach (ProveedorInfo obj in proveedores)
                {
                    if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null)
                    {
                        lista.Add(obj);
                    }
                }

                Datos_Agentes.DataSource = lista;
            }
            break;

            case "Promocion":
            {
                PromocionList        promociones = PromocionList.GetList(false);
                List <PromocionInfo> lista       = new List <PromocionInfo>();

                foreach (PromocionInfo obj in promociones)
                {
                    if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null)
                    {
                        lista.Add(obj);
                    }
                }

                Datos_Agentes.DataSource = lista;
            }
            break;

            case "Curso":
            {
                CursoList        cursos = CursoList.GetList(false);
                List <CursoInfo> lista  = new List <CursoInfo>();

                foreach (CursoInfo obj in cursos)
                {
                    if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null)
                    {
                        lista.Add(obj);
                    }
                }

                Datos_Agentes.DataSource = lista;
            }
            break;

            case "Modulo":
            {
                ModuloList        modulos = ModuloList.GetList(false);
                List <ModuloInfo> lista   = new List <ModuloInfo>();

                foreach (ModuloInfo obj in modulos)
                {
                    if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null)
                    {
                        lista.Add(obj);
                    }
                }

                Datos_Agentes.DataSource = lista;
            }
            break;
                //default:
                //    _tipo = "";
                //    throw new iQException("No se ha encontrado el tipo de entidad " + entidad.Tipo);
            }
            Format();
        }
 public AgenteSelectBaseForm(EntidadInfo entidad, bool isModal, Form parent)
     : this(entidad, isModal, parent, string.Empty)
 {
 }