Exemplo n.º 1
0
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "ConceptoAlbaran");

            _selectedOid = ActiveOID;

            switch (DataType)
            {
            case EntityMngFormTypeData.Default:
                if (Library.Common.ModulePrincipal.GetUseActiveYear())
                {
                    List = OutputDeliveryLineList.GetList(Library.Common.ModulePrincipal.GetActiveYear().Year, false);
                }
                else
                {
                    List = OutputDeliveryLineList.GetList(false);
                }
                break;

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }
            PgMng.Grow(string.Empty, "Lista de ConceptoAlbaranes");
        }
        public static OutputDeliveryLineListViewModel Get(OutputDeliveryLineList sourceList)
        {
            OutputDeliveryLineListViewModel list = new OutputDeliveryLineListViewModel();

            foreach (OutputDeliveryLineInfo item in sourceList)
            {
                list.Add(OutputDeliveryLineViewModel.New(item));
            }

            return(list);
        }
        protected virtual void VerUltimasVentasProducto()
        {
            if (_producto == null)
            {
                return;
            }

            OutputDeliveryLineList list = OutputDeliveryLineList.GetList(_producto, _cliente, false);

            DeliveryLineMngForm form = new DeliveryLineMngForm(true, this, list);

            form.ShowDialog(this);
        }
Exemplo n.º 4
0
        public DeliveryLineMngForm(bool isModal, Form parent, OutputDeliveryLineList list)
            : 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 = OutputDeliveryLineList.NewList().GetSortedList();
            SortProperty     = Fecha.DataPropertyName;
            SortDirection    = ListSortDirection.Descending;
        }
Exemplo n.º 5
0
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
                if (_entity == null)
                {
                    return;
                }
                if (List.GetItem(_entity.Oid) != null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    OutputDeliveryLineList listA = OutputDeliveryLineList.GetList(_filter_results);
                    listA.AddItem(_entity.GetInfo(false));
                    _filter_results = listA.GetSortedList();
                }
                break;

            case molAction.CustomAction1:
            case molAction.CustomAction2:
            case molAction.Edit:
            case molAction.Lock:
            case molAction.Unlock:

                if (_selected != null)
                {
                    List <OutputDeliveryLineInfo> entities = (List <OutputDeliveryLineInfo>)_selected;
                    foreach (OutputDeliveryLineInfo item in entities)
                    {
                        List.GetItem(item.Oid).CopyFrom(item);
                        if (FilterType == IFilterType.Filter)
                        {
                            OutputDeliveryLineList list   = OutputDeliveryLineList.GetList(_filter_results);
                            OutputDeliveryLineInfo entity = list.GetItem(item.Oid);
                            if (entity != null)
                            {
                                entity.CopyFrom(item);
                            }
                            _filter_results = list.GetSortedList();
                        }
                    }
                }

                if (_entity == null)
                {
                    return;
                }
                ActiveItem.CopyFrom(_entity);

                break;

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

            RefreshSources();
            if (_entity != null)
            {
                Select(_entity.Oid);
            }
            _entity = null;
        }