コード例 #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");
        }
コード例 #2
0
        public static OutputDeliveryLineListViewModel Get()
        {
            OutputDeliveryLineListViewModel list = new OutputDeliveryLineListViewModel();

            OutputDeliveryLineList sourceList = OutputDeliveryLineList.GetList();

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

            return(list);
        }
コード例 #3
0
        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);
        }
コード例 #4
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;
        }