protected void OnButtonAddClicked(object sender, EventArgs e)
        {
            if (DocumentUoW.Root.FromWarehouse == null)
            {
                MessageDialogWorks.RunErrorDialog("Не добавлен склад отправителя.");
                return;
            }

            ITdiTab mytab = DialogHelper.FindParentTab(this);

            if (mytab == null)
            {
                logger.Warn("Родительская вкладка не найдена.");
                return;
            }

            var filter = new StockBalanceFilter(UnitOfWorkFactory.CreateWithoutRoot());

            filter.SetAndRefilterAtOnce(x => x.RestrictWarehouse = DocumentUoW.Root.FromWarehouse);

            ReferenceRepresentation SelectDialog = new ReferenceRepresentation(new ViewModel.StockBalanceVM(filter));

            SelectDialog.Mode            = OrmReferenceMode.Select;
            SelectDialog.ButtonMode      = ReferenceButtonMode.None;
            SelectDialog.ObjectSelected += NomenclatureSelected;

            mytab.TabParent.AddSlaveTab(mytab, SelectDialog);
        }
Esempio n. 2
0
        protected void OnButtonChangeOldClicked(object sender, EventArgs e)
        {
            var filter = new StockBalanceFilter();

            filter.SetAndRefilterAtOnce(x => x.RestrictWarehouse = DocumentUoW.Root.Warehouse);
            var changeOldNomenclature = new ReferenceRepresentation(new ViewModel.StockBalanceVM(filter),
                                                                    "Изменить старую номенклатуру");

            changeOldNomenclature.Mode            = OrmReferenceMode.Select;
            changeOldNomenclature.ObjectSelected += ChangeOldNomenclature_ObjectSelected;
            MyTab.TabParent.AddSlaveTab(MyTab, changeOldNomenclature);
        }
Esempio n. 3
0
        protected void OnButtonAddClicked(object sender, EventArgs e)
        {
            var filter = new StockBalanceFilter();

            filter.SetAndRefilterAtOnce(x => x.RestrictWarehouse = DocumentUoW.Root.Warehouse);
            var selectOldNomenclature = new ReferenceRepresentation(new ViewModel.StockBalanceVM(filter),
                                                                    "Выберите номенклатуру на замену");

            selectOldNomenclature.Mode            = OrmReferenceMode.Select;
            selectOldNomenclature.ObjectSelected += SelectOldNomenclature_ObjectSelected;
            MyTab.TabParent.AddSlaveTab(MyTab, selectOldNomenclature);
        }
Esempio n. 4
0
        protected void OnButtonAddClicked(object sender, EventArgs e)
        {
            ITdiTab mytab = DialogHelper.FindParentTab(this);

            if (mytab == null)
            {
                logger.Warn("Родительская вкладка не найдена.");
                return;
            }

            var filter = new StockBalanceFilter(UnitOfWorkFactory.CreateWithoutRoot());

            filter.SetAndRefilterAtOnce(x => x.RestrictWarehouse = DocumentUoW.Root.WriteOffWarehouse);
            //FIXME возможно нужно добавить ограничение на типы номенклатур.

            ReferenceRepresentation SelectDialog = new ReferenceRepresentation(new ViewModel.StockBalanceVM(filter));

            SelectDialog.Mode            = OrmReferenceMode.Select;
            SelectDialog.ButtonMode      = ReferenceButtonMode.None;
            SelectDialog.ObjectSelected += NomenclatureSelected;

            mytab.TabParent.AddSlaveTab(mytab, SelectDialog);
        }