public void Execute() { AuditLogViewerModel viewModel = new AuditLogViewerModel() { Model = new AuditLogModel(this.CurrentNode) }; AuditLogViewer window = new AuditLogViewer(); window.DataContext = viewModel; window.ShowDialog(); }
public void RefreshAuditLog() { try { List <AuditLogEntry> entries = new List <AuditLogEntry>(); List <KeyValuePair <long, string> > _contracts = AuditLog.GetContractsInRange(StartDate, EndDate); //AuditLogEntries = new ObservableCollection<AuditLogEntry>(_contracts); // IEnumerable<AuditLogEntry> obsCollection = (IEnumerable<AuditLogEntry>)AuditLogEntries; // var list = new List<AuditLogEntry>(obsCollection); AuditLogViewer.LocalReport.DataSources.Clear(); AuditLogViewer.BorderStyle = System.Windows.Forms.BorderStyle.None; AuditLogViewer.LocalReport.ReportPath = ApplicationInfo.ApplicationPath + "\\AuditLogRpt.rdlc"; AuditLogViewer.ProcessingMode = ProcessingMode.Local; AuditLogViewer.LocalReport.ReportEmbeddedResource = "Spheris.BillingAdmin.AuditLogRpt.rdlc"; if (this.EnableContractList) { entries = AuditLog.GetEntries(StartDate, EndDate, SelectedContract.Key); } else if (EnableChangedByList && String.IsNullOrEmpty(ChangedBy) == false) { entries = AuditLog.GetEntries(StartDate, EndDate, ChangedBy); } else { entries = AuditLog.GetEntries(StartDate, EndDate); } AuditLogViewer.LocalReport.DataSources.Add(new ReportDataSource("Spheris_Billing_AuditLogEntry", entries)); //AuditLogViewer.da //ApplicationInfo.ApplicationPath AuditLogViewer.Name = "Spheris_Billing_AuditLogEntry"; ReportParameter[] parameters = new ReportParameter[2]; parameters[0] = new ReportParameter("BeginDate", StartDate.ToShortDateString()); parameters[1] = new ReportParameter("EndDate", EndDate.ToShortDateString()); AuditLogViewer.LocalReport.SetParameters(parameters); AuditLogViewer.RefreshReport(); } catch (Exception x) { View.ShowMsg(x.ToString()); } //View.SetAuditLog( list ); }