private bool AgenteExists()
        {
            AgenteList agentes = AgenteList.GetList(false);

            foreach (AgenteInfo item in agentes)
            {
                if (item.OidEntidad == CurrentEntidad.Oid &&
                    item.OidAgenteExt == ActiveItem.Oid)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
                if (_entity == null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    AgenteList listA = AgenteList.GetList(_filter_results);
                    listA.AddItem(_entity.GetInfo(false));
                    _filter_results = listA.GetSortedList();
                }
                break;

            case molAction.Edit:
            case molAction.Lock:
            case molAction.Unlock:
                if (_entity == null)
                {
                    return;
                }
                ActiveItem.CopyFrom(_entity);
                break;

            case molAction.Delete:
                if (ActiveItem == null)
                {
                    return;
                }
                List.RemoveItem(ActiveOID);
                if (FilterType == IFilterType.Filter)
                {
                    AgenteList listD = AgenteList.GetList(_filter_results);
                    listD.RemoveItem(ActiveOID);
                    _filter_results = listD.GetSortedList();
                }
                break;
            }

            _entity = null;
            RefreshSources();
        }
Exemplo n.º 3
0
        public AgenteMngBaseForm(bool isModal, Form parent, string schema)
            : base(isModal, parent, null)
        {
            InitializeComponent();

            SetView(molView.Normal);

            // 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);
            Datos.DataSource = AgenteList.NewList().GetSortedList();
            SortProperty     = Nombre.DataPropertyName;

            base.SortProperty = Nombre.DataPropertyName;
        }
Exemplo n.º 4
0
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "Agente");

            long oid = ActiveOID;

            if (CurrentEntidad != null)
            {
                List = AgenteList.GetListByEntidad(CurrentEntidad);
            }
            else
            {
                List = AgenteList.GetList(false);
            }

            PgMng.Grow(string.Empty, "Lista de Agentes");
        }
Exemplo n.º 5
0
        public override void RefreshSecondaryData()
        {
            SortedBindingList <EntidadInfo> elist = EntidadList.GetSortedList(EntidadList.GetList(true), "Tipo", ListSortDirection.Ascending);
            List <AgenteList> agentes             = new List <AgenteList>();

            foreach (EntidadInfo item in elist)
            {
                TreeNode node = new TreeNode();
                node.Name               = item.Tipo;
                node.Text               = item.Observaciones;
                node.Tag                = item;
                node.ImageIndex         = 1;
                node.SelectedImageIndex = 2;

                Entidades_TV.Nodes[0].Nodes.Add(node);

                agentes.Add(AgenteList.GetListByEntidad(item));
            }

            Entidades_TV.ExpandAll();

            int i = -1;

            foreach (TreeNode item in Entidades_TV.Nodes[0].Nodes)
            {
                i++;

                foreach (AgenteInfo agente in agentes[i])
                {
                    TreeNode node = new TreeNode();
                    node.Name               = agente.Oid.ToString();
                    node.Text               = agente.Nombre;
                    node.Tag                = agente;
                    node.ImageIndex         = 1;
                    node.SelectedImageIndex = 2;

                    item.Nodes.Add(node);
                }
            }
        }