protected void OnButtonOpenClicked(object sender, EventArgs e) { var node = treeRouteLists.GetSelectedNode() as ViewModel.RouteListsVMNode; var dlg = new RouteListKeepingDlg(node.Id); TabParent.AddTab(dlg, this); }
protected void OnButtonOpenClicked(object sender, EventArgs e) { var node = tableReadyForReception.GetSelectedNode() as ViewModel.ReadyForReceptionVMNode; var dlg = new CarUnloadDocumentDlg(node.Id, viewModel.Filter.RestrictWarehouse?.Id); TabParent.AddTab(dlg, this); }
protected void OnButtonAddClicked(object sender, EventArgs e) { ormtableview.Selection.UnselectAll(); var classDiscript = OrmMain.GetObjectDescription(objectType); if (classDiscript.SimpleDialog) { EntityEditSimpleDialog.RunSimpleDialog(this.Toplevel as Window, objectType, null); } else if (RepresentationModel is IRepresentationModelWithParent) { var dlg = OrmMain.CreateObjectDialog(objectType, (RepresentationModel as IRepresentationModelWithParent).GetParent); TabParent.OpenTab(OrmMain.GenerateDialogHashName(objectType, 0), () => dlg, this ); dlg.EntitySaved += dlg_EntitySaved; } else { var dlg = OrmMain.CreateObjectDialog(objectType); dlg.EntitySaved += dlg_EntitySaved; TabParent.AddTab(dlg, this, true); if (TabParent is TdiSliderTab) { ((TdiSliderTab)TabParent).IsHideJournal = true; } } }
protected void OnBtnAddOtherGoodsClicked(object sender, EventArgs e) { var nomenclatureSelector = _nomenclatureSelectorFactory.CreateNomenclatureOfGoodsWithoutEmptyBottlesSelector(); nomenclatureSelector.OnEntitySelectedResult += NomenclatureSelectorOnEntitySelectedResult; TabParent.AddTab(nomenclatureSelector, this); }
/// <summary> /// Добавить вкладку, указав, скрыт ли по умолчанию журнал. /// </summary> /// <param name="tab">Основная вкладка.</param> /// <param name="afterTab">Дочерняя вкладка.</param> /// <param name="canSlided">Если true, то открываются в одной вкладке.</param> public void AddTab(ITdiTab tab, ITdiTab afterTab, bool canSlided = true) { if (tab.FailInitialize) { logger.Warn("Вкладка <{0}> не добавлена, так как сообщает что построена с ошибкой(Свойство FailInitialize) .", tab.TabName ); return; } if (canSlided && afterTab == Journal) { if (ActiveDialog != null) { var askSave = (ActiveDialog as IAskSaveOnCloseViewModel)?.AskSaveOnClose ?? true; CloseDialog(CloseSource.FromParentPage, askSave); } ActiveDialog = tab; return; } if (afterTab == null || afterTab == Journal || afterTab == ActiveDialog) { TabParent.AddTab(tab, this as ITdiTab); } else { TabParent.AddTab(tab, afterTab); } }
private IJournalAction CreateOpenAnalysisDialogAction() { return(new JournalAction( "Открыть диалог разбора", selectedItems => selectedItems.FirstOrDefault() is RouteListJournalNode node && _analysisViewModelStatuses.Contains(node.StatusEnum), selectedItems => true, selectedItems => { if (selectedItems.FirstOrDefault() is RouteListJournalNode selectedNode) { TabParent.AddTab( new RouteListAnalysisViewModel( EntityUoWBuilder.ForOpen(selectedNode.Id), UnitOfWorkFactory, commonServices, _orderSelectorFactory, _employeeJournalFactory, _counterpartyJournalFactory, _deliveryPointJournalFactory, _subdivisionJournalFactory, _gtkTabsOpener, _undeliveredOrdersJournalOpener, _deliveryShiftRepository, _employeeSettings, _undeliveredOrdersRepository ), this, false ); } } )); }
/// <summary> /// Добавить вкладку, указав, скрыт ли по умолчанию журнал. /// </summary> /// <param name="tab">Основная вкладка.</param> /// <param name="afterTab">Дочерняя вкладка.</param> /// <param name="CanSlided">Если true, то открываются в одной вкладке.</param> public void AddTab(ITdiTab tab, ITdiTab afterTab, bool CanSlided = true) { if (tab.FailInitialize) { logger.Warn("Вкладка <{0}> не добавлена, так как сообщает что построена с ошибкой(Свойство FailInitialize) .", tab.TabName ); return; } if (CanSlided && afterTab == Journal && tab is ITdiDialog) { ActiveDialog = (ITdiDialog)tab; return; } if (afterTab == null || afterTab == Journal || afterTab == ActiveDialog) { TabParent.AddTab(tab, this as ITdiTab); } else { TabParent.AddTab(tab, afterTab); } }
protected void OnButtonAddEnumItemClicked(object sender, QS.Widgets.EnumItemClickedEventArgs e) { var type = (ServiceClaimType)e.ItemEnum; var dlg = new ServiceClaimDlg(type); TabParent.AddTab(dlg, this); }
protected void OnCreateTaskButtonClicked(object sender, EventArgs e) { var newTask = new CallTaskDlg(); CallTaskSingletonFactory.GetInstance().CopyTask(UoW, _employeeRepository, Entity, newTask.Entity); newTask.UpdateAddressFields(); TabParent.AddTab(newTask, this); }
void Orderselectedview1_OrderActivated(object sender, int e) { var doc = UoW.GetById <OrderDocument>(e) as IPrintableRDLDocument; if (doc == null) { return; } TabParent.AddTab(DocumentPrinter.GetPreviewTab(doc), this, false); }
void CreateOrder() { var employee = _employeeRepository.GetEmployeeForCurrentUser(UoWGeneric); var order = Order.CreateFromServiceClaim(Entity, employee); UoWGeneric.Save(order); UoWGeneric.Commit(); var orderDlg = new OrderDlg(order); TabParent.AddTab(orderDlg, this); }
void YtreeviewNotAttached_RowActivated(object o, Gtk.RowActivatedArgs args) { var notAttachedNomenclature = ytreeviewNotAttached.GetSelectedObject() as Nomenclature; if (notAttachedNomenclature == null) { return; } var dlg = new NomenclatureDlg(notAttachedNomenclature); TabParent.AddTab(dlg, this); }
void YtreeviewNotLoaded_RowActivated(object o, Gtk.RowActivatedArgs args) { var notLoadedNomenclature = ytreeviewNotLoaded.GetSelectedObject() as RouteListControlNotLoadedNode; if (notLoadedNomenclature == null) { return; } var dlg = new CarLoadDocumentDlg(Entity.Id, notLoadedNomenclature.Nomenclature.Warehouse?.Id); TabParent.AddTab(dlg, this); }
protected void OpenTab(string hashName, Func <ITdiTab> newTabFunc) { ITdiTab tab = TabParent.FindTab(hashName); if (tab == null) { TabParent.AddTab(newTabFunc(), this); } else { TabParent.SwitchOnTab(tab); } }
protected void OnButtonCreateOrderClicked(object sender, EventArgs e) { if (Entity.DeliveryPoint == null) { return; } OrderDlg orderDlg = new OrderDlg(); orderDlg.Entity.Client = orderDlg.UoW.GetById <Counterparty>(Entity.Counterparty.Id); orderDlg.Entity.UpdateClientDefaultParam(UoW, counterpartyContractRepository, organizationProvider, counterpartyContractFactory); orderDlg.Entity.DeliveryPoint = orderDlg.UoW.GetById <DeliveryPoint>(Entity.DeliveryPoint.Id); orderDlg.CallTaskWorker.TaskCreationInteractive = new GtkTaskCreationInteractive(); TabParent.AddTab(orderDlg, this); }
protected void OnAddTaskButtonClicked(object sender, EventArgs e) { CallTaskDlg dlg = new CallTaskDlg(); TabParent.AddTab(dlg, this); /* * ClientTaskViewModel clientTaskViewModel = new ClientTaskViewModel(employeeRepository, * bottleRepository, * callTaskRepository, * phoneRepository, * EntityUoWBuilder.ForCreate(), * UnitOfWorkFactory.GetDefaultFactory, * ServicesConfig.CommonServices); * TabParent.AddTab(clientTaskViewModel, this); */ }
protected void OnButtonPrintClicked(object sender, EventArgs e) { if (UoWGeneric.HasChanges && CommonDialogs.SaveBeforePrint(typeof(Expense), "квитанции")) { Save(); } var reportInfo = new QS.Report.ReportInfo { Title = String.Format("Квитанция №{0} от {1:d}", Entity.Id, Entity.Date), Identifier = "Cash.Expense", Parameters = new Dictionary <string, object> { { "id", Entity.Id } } }; var report = new QSReport.ReportViewDlg(reportInfo); TabParent.AddTab(report, this, false); }
protected void OnButtonReportByClientClicked(object sender, EventArgs e) { TabParent.AddTab(new ReportViewDlg(Entity.CreateReportInfoByClient()), this); }
protected void OnButtonEditClicked(object sender, EventArgs e) { var dlg = new ServiceClaimDlg((tableServiceClaims.GetSelectedObjects() [0] as ServiceClaimVMNode).Id); TabParent.AddTab(dlg, this); }
protected void OpenTab(ITdiTab tab) { TabParent.AddTab(tab, this); }
protected void OnAddTaskButtonClicked(object sender, EventArgs e) { CallTaskDlg dlg = new CallTaskDlg(); TabParent.AddTab(dlg, this); }
public void MenuFinalOrderActivated(object sender, EventArgs args) { var orderDlg = new OrderDlg(Entity.FinalOrder); TabParent.AddTab(orderDlg, this); }
protected override void CreatePopupActions() { PopupActionsList.Add( new JournalAction( "Открыть заказ", selectedItems => { var selectedNodes = selectedItems.Cast <SelfDeliveryJournalNode>(); return(selectedNodes.Count() == 1); }, selectedItems => true, selectedItems => { var selectedNodes = selectedItems.Cast <SelfDeliveryJournalNode>(); var selectedNode = selectedNodes.FirstOrDefault(); MainClass.MainWin.TdiMain.OpenTab( DialogHelper.GenerateDialogHashName <VodovozOrder>(selectedNode.Id), () => new OrderDlg(selectedNode.Id) ); } ) ); PopupActionsList.Add( new JournalAction( "Создать кассовые ордера", selectedItems => true, selectedItems => { var selectedNodes = selectedItems.Cast <SelfDeliveryJournalNode>(); return(selectedNodes.Count() == 1 && selectedNodes.First().StatusEnum == OrderStatus.WaitForPayment); }, selectedItems => { var selectedNodes = selectedItems.Cast <SelfDeliveryJournalNode>(); var selectedNode = selectedNodes.FirstOrDefault(); if (selectedNode != null) { CreateSelfDeliveryCashInvoices(selectedNode.Id); } } ) ); PopupActionsList.Add( new JournalAction( "Оплата по карте", selectedItems => { var selectedNodes = selectedItems.Cast <SelfDeliveryJournalNode>().ToList(); var selectedNode = selectedNodes.First(); return(selectedNodes.Count() == 1 && selectedNode.PaymentTypeEnum == PaymentType.cash && selectedNode.StatusEnum != OrderStatus.Closed); }, selectedItems => _userCanChangePayTypeToByCard, selectedItems => { var selectedNodes = selectedItems.Cast <SelfDeliveryJournalNode>(); var selectedNode = selectedNodes.FirstOrDefault(); if (selectedNode != null) { TabParent.AddTab( new PaymentByCardViewModel( EntityUoWBuilder.ForOpen(selectedNode.Id), UnitOfWorkFactory, commonServices, _callTaskWorker, _orderPaymentSettings, _orderParametersProvider, _currentEmployee), this ); } } ) ); }