protected override bool Execute(ReportingWorklistItemSummary item) { if (item.ReportRef == null) { return(false); } try { //todo: loc var title = string.Format("Print Report for {0} {1} - {2}", Formatting.MrnFormat.Format(item.Mrn), Formatting.PersonNameFormat.Format(item.PatientName), Formatting.AccessionFormat.Format(item.AccessionNumber)); var component = new PrintReportComponent(item.OrderRef, item.ReportRef); ApplicationComponent.LaunchAsDialog( this.Context.DesktopWindow, component, title); } catch (Exception e) { ExceptionHandler.Report(e, this.Context.DesktopWindow); } // always return false - we didn't change any data return(false); }
protected override bool Execute(ReportingWorklistItemSummary item) { if (item.ReportRef == null) return false; try { var title = string.Format(SR.FormatPrintReportMessage, Formatting.MrnFormat.Format(item.Mrn), Formatting.PersonNameFormat.Format(item.PatientName), Formatting.AccessionFormat.Format(item.AccessionNumber)); var component = new PrintReportComponent(item.OrderRef, item.ReportRef); ApplicationComponent.LaunchAsDialog( this.Context.DesktopWindow, component, title); } catch (Exception e) { ExceptionHandler.Report(e, this.Context.DesktopWindow); } // always return false - we didn't change any data return false; }
/// <summary> /// Constructor. /// </summary> public PrintReportComponentControl(PrintReportComponent component) : base(component) { _component = component; InitializeComponent(); _practitionerLookup.LookupHandler = _component.RecipientsLookupHandler; _practitionerLookup.DataBindings.Add("Value", _component, "SelectedRecipient", true, DataSourceUpdateMode.OnPropertyChanged); _contactPoint.DataBindings.Add("DataSource", _component, "RecipientContactPointChoices", true, DataSourceUpdateMode.Never); _contactPoint.DataBindings.Add("Value", _component, "SelectedContactPoint", true, DataSourceUpdateMode.OnPropertyChanged); _contactPoint.Format += delegate(object source, ListControlConvertEventArgs e) { e.Value = _component.FormatContactPoint(e.ListItem); }; _closeOnPrint.DataBindings.Add("Checked", _component, "CloseOnPrint", true, DataSourceUpdateMode.OnPropertyChanged); }
/// <summary> /// Called by the host to assign this view to a component. /// </summary> public void SetComponent(IApplicationComponent component) { _component = (PrintReportComponent)component; }