Exemplo n.º 1
0
 protected void OnActionFittingsActivated(object sender, EventArgs e)
 {
     tdiMain.OpenTab(
         ReferenceRepresentation.GenerateHashName <FittingsVM>(),
         () => new ReferenceRepresentation(new FittingsVM())
         );
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 protected void OnActionAddressActivated(object sender, EventArgs e)
 {
     tdiMain.OpenTab(
         ReferenceRepresentation.GenerateHashName <DeliveryPointsVM>(),
         () => new ReferenceRepresentation(new DeliveryPointsVM()).Buttons(ReferenceButtonMode.CanEdit | ReferenceButtonMode.CanDelete)
         );
 }
Exemplo n.º 4
0
 protected void OnActionCounterpartyActivated(object sender, EventArgs e)
 {
     tdiMain.OpenTab(
         ReferenceRepresentation.GenerateHashName <CounterpartyVM>(),
         () => new ReferenceRepresentation(new CounterpartyVM())
         );
 }
Exemplo n.º 5
0
        protected void OnButtonAddDeliveryPointsClicked(object sender, EventArgs e)
        {
            var dlg = new ReferenceRepresentation(new ViewModel.ClientDeliveryPointsVM(UoW, Entity.Counterparty));

            dlg.Mode            = OrmReferenceMode.MultiSelect;
            dlg.ObjectSelected += Dlg_ObjectSelected;
            TabParent.AddSlaveTab(this, dlg);
        }
Exemplo n.º 6
0
        protected void OnButtonAddClicked(object sender, EventArgs e)
        {
            var dlg = new ReferenceRepresentation(new FittingsVM());

            dlg.Mode            = OrmReferenceMode.MultiSelect;
            dlg.ObjectSelected += Dlg_ObjectSelected1;
            TabParent.AddSlaveTab(this, dlg);
        }
Exemplo n.º 7
0
        protected void OnButtonAddClicked(object sender, EventArgs e)
        {
            var addEmployeeDlg = new ReferenceRepresentation(new EmployeesVM());

            addEmployeeDlg.Mode            = OrmReferenceMode.Select;
            addEmployeeDlg.ObjectSelected += AddEmployeeDlg_ObjectSelected;
            TabParent.AddSlaveTab(this, addEmployeeDlg);
        }
        protected void OnButtonAddClicked(object sender, EventArgs e)
        {
            var view = new ViewModel.ClientDeliveryPointsVM(ContractUoW, ContractUoW.Root.Counterparty);
            var dlg  = new ReferenceRepresentation(view);

            dlg.ObjectSelected += Dlg_ObjectSelected;
            dlg.Mode            = OrmReferenceMode.Select;
            MyTab.TabParent.AddSlaveTab(MyTab, dlg);
        }
Exemplo n.º 9
0
        protected void OnButtonEdit1Clicked(object sender, EventArgs e)
        {
            editingItem = projectTreeView.GetSelectedObject <ProjectItem> ();
            var dlg = new ReferenceRepresentation(new FittingsVM());

            dlg.Mode            = OrmReferenceMode.Select;
            dlg.ObjectSelected += Dlg_EditObjectSelected;
            TabParent.AddSlaveTab(this, dlg);
        }
Exemplo n.º 10
0
        protected void OnButtonManualSetClicked(object sender, EventArgs e)
        {
            var editingRow = ytreeviewParsing.GetSelectedObjects <ReadingXLSRow> ().First();
            var dlg        = new ReferenceRepresentation(new Fittings.ViewModel.FittingsVM());

            dlg.Tag             = editingRow;
            dlg.Mode            = OrmReferenceMode.Select;
            dlg.ObjectSelected += DlgManualSet_ObjectSelected;
            TabParent.AddSlaveTab(this, dlg);
        }
Exemplo n.º 11
0
        protected void OnButtonSelectPriceClicked(object sender, EventArgs e)
        {
            var priceEditingItem = projectTreeView.GetSelectedObject <ProjectItem> ();
            var dlg = new ReferenceRepresentation(new FittingPricesVM(priceEditingItem.Fitting));

            dlg.Tag             = priceEditingItem;
            dlg.Mode            = OrmReferenceMode.Select;
            dlg.ObjectSelected += Dlg_ItemPriceSelected;;
            TabParent.AddSlaveTab(this, dlg);
        }
Exemplo n.º 12
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);
        }
Exemplo n.º 13
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);
        }
Exemplo n.º 14
0
        protected void OnButtonResolveMultiFoundClicked(object sender, EventArgs e)
        {
            var editingRow = ytreeviewParsing.GetSelectedObjects <ReadingXLSRow> ().First();
            var filter     = new FittingsFlt(UoW);

            filter.RestrictDiameter = editingRow.Diameter;
            filter.RestrictModel    = editingRow.Code;
            var dlg = new ReferenceRepresentation(new Fittings.ViewModel.FittingsVM(filter));

            dlg.Tag             = editingRow;
            dlg.Mode            = OrmReferenceMode.Select;
            dlg.ObjectSelected += DlgMultiFoundResolve_ObjectSelected;
            TabParent.AddSlaveTab(this, dlg);
        }
Exemplo n.º 15
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);
        }