예제 #1
0
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "Documento");

            _selectedOid = ActiveOID;

            switch (DataType)
            {
            case EntityMngFormTypeData.Default:
                if (CurrentEntidad != null)
                {
                    List = DocumentoList.GetListByEntidad(CurrentEntidad);
                }
                else
                {
                    List = DocumentoList.GetListByEntidad(null);
                }
                break;

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }

            PgMng.Grow(string.Empty, "Lista de Documentos");
        }
예제 #2
0
        protected override void AttachAction()
        {
            DocumentoList       list = DocumentoList.GetListExceptAgente(_entity.Oid);
            DocumentoSelectForm f    = new DocumentoSelectForm(this, _entity, list);

            f.ShowDialog();
            RefreshSecondaryData();
        }
예제 #3
0
 public override void RefreshSecondaryData()
 {
     if (_entity != null)
     {
         _documentos = DocumentoList.GetListByAgente(_entity);
         Datos_Documentos.DataSource = _documentos;
     }
 }
예제 #4
0
        public DocumentoSelectForm(Form parent, Agente agente, DocumentoList lista)
            : base(true, parent, lista, string.Empty)
        {
            InitializeComponent();
            _view_mode = molView.Select;

            _action_result = DialogResult.Cancel;

            _agente = agente;
        }
예제 #5
0
        protected override void RefreshMainData()
        {
            Datos.DataSource = _entity;
            Bar.Grow();

            _documentos = DocumentoList.GetListByAgente(_entity);
            Datos_Documentos.DataSource = _documentos;
            Bar.Grow();

            base.RefreshMainData();
        }
예제 #6
0
        public static DocumentListViewModel Get(DocumentoList sourceList, IAgenteHipatia agent)
        {
            DocumentListViewModel list = new DocumentListViewModel();

            foreach (DocumentoInfo item in sourceList)
            {
                list.Add(DocumentViewModel.New(item, agent));
            }

            return(list);
        }
예제 #7
0
        public static DocumentListViewModel Get()
        {
            DocumentListViewModel list = new DocumentListViewModel();

            DocumentoList sourceList = DocumentoList.GetList();

            foreach (DocumentoInfo item in sourceList)
            {
                list.Add(DocumentViewModel.New(item));
            }

            return(list);
        }
예제 #8
0
        public DocumentoMngForm(bool isModal, Form parent, DocumentoList list, string schema)
            : base(isModal, parent, list)
        {
            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 = DocumentoList.NewList().GetSortedList();
            SortProperty     = Nombre.DataPropertyName;

            _ftp = new FtpClient(Principal.GetHipatiaFTPHost(), Principal.GetHipatiaFTPUser(), Principal.GetHipatiaFTPPwd(), Principal.GetHipatiaFTPRootPath());
        }
예제 #9
0
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
                if (_entity == null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    DocumentoList list = DocumentoList.GetList(_filter_results);
                    list.AddItem(_entity.GetInfo(false));
                    _filter_results = list.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)
                {
                    DocumentoList list = DocumentoList.GetList(_filter_results);
                    list.RemoveItem(ActiveOID);
                    _filter_results = list.GetSortedList();
                }
                break;
            }

            _entity = null;
            RefreshSources();
        }