protected CustomAgentSelectForm(Form parent, moleQule.Base.EEstado estado, DespachanteList lista)
            : base(true, parent, estado, lista)
        {
            InitializeComponent();
            _view_mode = molView.Select;

            _action_result = DialogResult.Cancel;
        }
Пример #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)
                {
                    DespachanteList listA = DespachanteList.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)
                {
                    DespachanteList listD = DespachanteList.GetList(_filter_results);
                    listD.RemoveItem(ActiveOID);
                    _filter_results = listD.GetSortedList();
                }
                break;
            }

            RefreshSources();
            if (_entity != null)
            {
                Select(_entity.Oid);
            }
            _entity = null;
        }
Пример #3
0
        public CustomAgentMngForm(bool isModal, Form parent, moleQule.Base.EEstado status, DespachanteList lista)
            : base(isModal, parent, lista)
        {
            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 = DespachanteList.NewList().GetSortedList();
            SortProperty     = Codigo.DataPropertyName;

            _status = status;
        }
Пример #4
0
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "Despachante");

            _selectedOid = ActiveOID;

            switch (DataType)
            {
            case EntityMngFormTypeData.Default:
                List = DespachanteList.GetList(_status, false);
                break;

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }
            PgMng.Grow(string.Empty, "Lista de Despachantes");
        }
        private void Despachante_BT_Click(object sender, EventArgs e)
        {
            if (_entity.PuertoDestino == string.Empty)
            {
                PgMng.ShowInfoException("Debe seleccionar un puerto de destino.");
                return;
            }

            PuertoList pl = PuertoList.GetList(true);
            PuertoInfo pi = pl.GetItemByProperty("Valor", _entity.PuertoDestino);

            DespachanteList despachantes = PuertoDespachanteList.GetDespachanteList(pi.Oid);

            CustomAgentSelectForm form = new CustomAgentSelectForm(this, despachantes);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _custom_agency         = form.Selected as DespachanteInfo;
                _entity.OidDespachante = _custom_agency.Oid;
                _entity.Despachante    = _custom_agency.Nombre;

                Datos.ResetBindings(false);
            }
        }
 public CustomAgentSelectForm(Form parent, DespachanteList lista)
     : this(parent, moleQule.Base.EEstado.Todos, lista)
 {
 }