Exemple #1
0
        public void ShowClientChooseDialog()
        {
            var clientChooseViewModel = new ClientChooseViewModel
            {
                Clients     = Clients,
                ImportTypes = ImportTypes
            };

            var selectClientCommand = new UICommand()
            {
                Caption   = "Выбрать",
                IsCancel  = false,
                IsDefault = false,
                Command   = new DelegateCommand <CancelEventArgs>(
                    x =>
                {
                    var currentSheetInfo = WorkSheetsInBook[SelectedWorkSheetIndex];
                    if (currentSheetInfo.RelatedClientsContainClient(clientChooseViewModel.SelectedClient, currentSheetInfo.RelatedClients) == null)
                    {
                        var relatedClientInfo = new RelatedClientInfo
                        {
                            Client = clientChooseViewModel.SelectedClient,
                            RelatedColumnHeaderCount = currentSheetInfo.ColumnHeaders.Count,
                            ColumnHeaderCount        = currentSheetInfo.ColumnHeaders.Count
                        };
                        currentSheetInfo.RelatedClients.Add(relatedClientInfo);
                        currentSheetInfo.SelectedRelatedClient = relatedClientInfo;
                    }
                    ImportService.AddRelationColumnHeadersClient(currentSheetInfo.ColumnHeadersToArray, clientChooseViewModel.SelectedClient);
                },
                    x => true
                    )
            };
            var cancelCommand = new UICommand()
            {
                Id        = MessageBoxResult.Cancel,
                Caption   = "Отменить",
                IsCancel  = true,
                IsDefault = true
            };

            DialogService.ShowDialog(new List <UICommand>()
            {
                selectClientCommand, cancelCommand
            }, "Выбор Клиента...", clientChooseViewModel);
        }
Exemple #2
0
        public void ShowClientChooseDialog()
        {
            var clientChooseViewModel = new ClientChooseViewModel
            {
                Clients = Clients,
                ImportTypes = ImportTypes
            };

            var selectClientCommand = new UICommand()
            {
                Caption = "Выбрать",
                IsCancel = false,
                IsDefault = false,
                Command = new DelegateCommand<CancelEventArgs>(
                    x =>
                    {
                        var currentSheetInfo = WorkSheetsInBook[SelectedWorkSheetIndex];
                        if (currentSheetInfo.RelatedClientsContainClient(clientChooseViewModel.SelectedClient, currentSheetInfo.RelatedClients) == null)
                        {
                            var relatedClientInfo = new RelatedClientInfo
                            {
                                Client = clientChooseViewModel.SelectedClient,
                                RelatedColumnHeaderCount = currentSheetInfo.ColumnHeaders.Count,
                                ColumnHeaderCount = currentSheetInfo.ColumnHeaders.Count
                            };
                            currentSheetInfo.RelatedClients.Add(relatedClientInfo);
                            currentSheetInfo.SelectedRelatedClient = relatedClientInfo;
                        }
                        ImportService.AddRelationColumnHeadersClient(currentSheetInfo.ColumnHeadersToArray, clientChooseViewModel.SelectedClient);
                    },
                    x => true
                )
            };
            var cancelCommand = new UICommand()
            {
                Id = MessageBoxResult.Cancel,
                Caption = "Отменить",
                IsCancel = true,
                IsDefault = true
            };

            DialogService.ShowDialog(new List<UICommand>() { selectClientCommand, cancelCommand }, "Выбор Клиента...", clientChooseViewModel);
        }