Example #1
0
        private void ExportToExcel()
        {
            var report = _excelReportService.CreateAccountWithStatusesReport(new ObservableCollection <AccountsMainSet>(AccountSelectedList.Select(a => a.Account)));

            if (report != null)
            {
                _accountsController.SaveDialogWindow();
                if (!string.IsNullOrWhiteSpace(_filename))
                {
                    _excelReportService.SaveReport(_filename, report);
                }
            }
        }
 private void ChangeStatus()
 {
     if (string.IsNullOrWhiteSpace(AccountPayNumber))
     {
         _accountStatusService.UpdateStatus(AccountForChangeList, SelectedStatus, AccountForChangeDate);
     }
     else
     {
         int payNumber;
         if (int.TryParse(AccountPayNumber, out payNumber))
         {
             _accountStatusService.UpdateStatus(AccountForChangeList, SelectedStatus, AccountForChangeDate, payNumber);
         }
     }
     ExportConfirmationRequest.Raise(new Confirmation {
         Title = "Экспорт", Content = "Выгрузить в Excel?"
     },
                                     c =>
     {
         if (c.Confirmed)
         {
             var report = _excelReportService.CreateNewStatusesReport(AccountForChangeList);
             if (report != null)
             {
                 _accountsController.SaveDialogWindow();
                 if (!string.IsNullOrWhiteSpace(_filename))
                 {
                     _excelReportService.SaveReport(_filename, report);
                 }
             }
         }
     });
     AccountForChangeList.Clear();
     SearchAccountText    = string.Empty;
     AccountPayNumber     = string.Empty;
     AccountForChangeDate = DateTime.Now;
 }