private void buttonDelete_Click(object sender, EventArgs e) { ProgressDialog dlgProgresss = new ProgressDialog(); BrokerServiceClient client = GetWizard().Tag as BrokerServiceClient; dlgProgresss.Title = "Deleting MPPS"; dlgProgresss.Description = "Deleting..."; dlgProgresss.Action = () => { client.DeleteMPPS(MainForm.Mpps.MPPSSOPInstanceUID); }; if (dlgProgresss.ShowDialog(this) == DialogResult.Cancel) { if (dlgProgresss.Exception != null) { Messager.ShowError(this, dlgProgresss.Exception); } } else { OnReset(); buttonQuery_Click(buttonQuery, EventArgs.Empty); } }
public override void OnWizardFinish(object sender, CancelEventArgs e) { if (MainForm.Mpps.Patient == null) { ProgressDialog dlgProgresss = new ProgressDialog(); BrokerServiceClient client = GetWizard().Tag as BrokerServiceClient; UpdatePatient(); dlgProgresss.Title = "Update patient information"; dlgProgresss.Description = "Updating..."; dlgProgresss.Action = () => { client.UpdateMPPS(MainForm.Mpps.MPPSSOPInstanceUID, MainForm.Mpps); }; if (dlgProgresss.ShowDialog(this) == DialogResult.Cancel) { if (dlgProgresss.Exception != null) { e.Cancel = true; Messager.ShowError(this, dlgProgresss.Exception); } } } base.OnWizardFinish(sender, e); }
public void Channel_Faulted(object sender, EventArgs e) { BrokerServiceClient client = wizardSheet.Tag as BrokerServiceClient; client.InnerChannel.Faulted -= Channel_Faulted; client.Abort(); SetServiceClient(); }
private bool VerifySelectedBroker() { if (BrokerComboBox.SelectedItem == null) { MessageBox.Show("Please select a broker."); return(false); } var selected = BrokerComboBox.SelectedItem as ToolStripMenuItem; broker = new BrokerServiceClient(selected.Name, selected.Tag.ToString()); return(true); }
public override void OnSetActive(object sender, WizardCancelEventArgs e) { base.OnSetActive(sender, e); if (e.PreviousPage != null && e.PreviousPage.GetType() == typeof(ImagingServiceRequestPage)) { ImagingServiceRequestPage p = e.PreviousPage as ImagingServiceRequestPage; ImagingServiceRequest o = _ImagingServiceRequest; _ImagingServiceRequest = p.ImagingServiceRequest; comboBoxRequestedId.Items.Clear(); // *** if ( (o == null) || (o.AccessionNumber != _ImagingServiceRequest.AccessionNumber) || (string.IsNullOrEmpty(comboBoxRequestedId.Text)) ) { ProgressDialog dlgProgresss = new ProgressDialog(); BrokerServiceClient client = GetWizard().Tag as BrokerServiceClient; List <string> ids = null; ids = new List <string>(); dlgProgresss.Title = "Find"; dlgProgresss.Description = "Getting list of requested procedure ids"; dlgProgresss.Action = () => { ids = client.GetRequestedProcedureIDs(_ImagingServiceRequest.AccessionNumber); }; UpdateUI(true); comboBoxRequestedId.Items.Clear(); if (dlgProgresss.ShowDialog(this) == DialogResult.OK) { foreach (string id in ids) { comboBoxRequestedId.Items.Add(id); } } if (dlgProgresss.Exception != null) { Messager.ShowError(this, dlgProgresss.Exception); } if (dlgProgresss.Exception != null) { Messager.ShowError(this, dlgProgresss.Exception); } } } }
public override void OnWizardNext(object sender, WizardPageEventArgs e) { if (!IsValid()) { e.Cancel = true; return; } else { ProgressDialog dlgProgresss = new ProgressDialog(); BrokerServiceClient client = GetWizard().Tag as BrokerServiceClient; UpdateMpps(); dlgProgresss.Title = "Update MPPS"; dlgProgresss.Description = "Updating..."; dlgProgresss.Action = () => { client.UpdateMPPS(MainForm.Mpps.MPPSSOPInstanceUID, MainForm.Mpps); }; if (dlgProgresss.ShowDialog(this) == DialogResult.Cancel) { if (dlgProgresss.Exception != null) { e.Cancel = true; Messager.ShowError(this, dlgProgresss.Exception); } } dlgProgresss.Title = "Update Patient"; dlgProgresss.Description = "Updating..."; dlgProgresss.Action = () => { client.UpdatePatient(MainForm.Mpps.Patient.PatientID, MainForm.Mpps.Patient.IssuerOfPatientID, MainForm.Mpps.Patient); }; if (dlgProgresss.ShowDialog(this) == DialogResult.Cancel) { if (dlgProgresss.Exception != null) { e.Cancel = true; Messager.ShowError(this, dlgProgresss.Exception); } } } base.OnWizardNext(sender, e); }
static void Main(string[] args) { var wallstreetClient = new WallstreetDataServiceClient(new InstanceContext(new WallstreetHandlerDummy())); Console.WriteLine("Type in the name of the exchange you want to connect to. Available:"); var exchanges = wallstreetClient.GetExchanges(); foreach (string e in exchanges) { Console.WriteLine(e); } var exchangeId = Console.ReadLine(); var handler = new BrokerHandler(wallstreetClient, exchangeId); BrokerServiceClient client = new BrokerServiceClient(new InstanceContext(handler)); client.RegisterBroker(exchangeId); Console.WriteLine("Broker online. Press enter to exit ..."); Console.ReadLine(); client.UnregisterBroker(exchangeId); client.Close(); }
private void GetPatientInformation() { ProgressDialog dlgProgresss = new ProgressDialog(); BrokerServiceClient client = GetWizard().Tag as BrokerServiceClient; string pid = comboBoxPatientId.Text; string ipid = textBoxIssuerOfPatientId.Text; dlgProgresss.Title = "Querying"; dlgProgresss.Description = "Getting patient information"; dlgProgresss.Action = () => { _Patient = client.FindPatient(pid, ipid); }; _Update = false; _OriginalPatientId = string.Empty; _OriginalIssuerOfPatientId = string.Empty; if (dlgProgresss.ShowDialog(this) == DialogResult.OK) { if (_Patient != null) { _Update = true; UpdateUI(); _OriginalPatientId = _Patient.PatientID; _OriginalIssuerOfPatientId = _Patient.IssuerOfPatientID; errorProvider.Clear(); } else { Messager.ShowError(this, "Patient not found."); } } else { if (dlgProgresss.Exception != null) { Messager.ShowError(this, dlgProgresss.Exception); } } }
/// <summary> /// Gets the scheduled procedure step info. /// </summary> private void GetScheduledProcedureStepInfo() { ProgressDialog dlgProgresss = new ProgressDialog(); BrokerServiceClient client = GetWizard().Tag as BrokerServiceClient; string id = comboBoxId.Text; dlgProgresss.Title = "Search"; dlgProgresss.Description = "Searching for scheduled procedure step"; dlgProgresss.Action = () => { _ScheduledProcedureStep = client.FindScheduledProcedureStep(id); }; _Update = false; _OriginalScheduledProcedureId = string.Empty; if (dlgProgresss.ShowDialog(this) == DialogResult.OK) { if (_ScheduledProcedureStep != null) { _Update = true; UpdateUI(false); _OriginalScheduledProcedureId = _ScheduledProcedureStep.ScheduledProcedureStepID; errorProvider.Clear(); } else { Messager.ShowError(this, "Schedule procedure step not found."); } } else { if (dlgProgresss.Exception != null) { Messager.ShowError(this, dlgProgresss.Exception); } } }
private void GetRequestedProcedureInfo() { ProgressDialog dlgProgresss = new ProgressDialog(); BrokerServiceClient client = GetWizard().Tag as BrokerServiceClient; string id = comboBoxRequestedId.Text; dlgProgresss.Title = "Search"; dlgProgresss.Description = "Searching for requested procedure"; dlgProgresss.Action = () => { _RequestedProcedure = client.FindRequestedProcedure(_ImagingServiceRequest.AccessionNumber, id); }; _Update = false; _OriginalRequestedProcedureId = string.Empty; if (dlgProgresss.ShowDialog(this) == DialogResult.OK) { if (_RequestedProcedure != null) { _Update = true; UpdateUI(false); _OriginalRequestedProcedureId = _RequestedProcedure.RequestedProcedureID; errorProvider.Clear(); } else { Messager.ShowError(this, "Requested procedure not found."); } } else { if (dlgProgresss.Exception != null) { Messager.ShowError(this, dlgProgresss.Exception); } } }
/// <summary> /// /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">An <see cref="T:Leadtools.Wizard.WizardPageEventArgs">WizardPageEventArgs</see> that contains the event data.</param> /// <remarks></remarks> public override void OnWizardFinish(object sender, CancelEventArgs e) { if (!IsValid()) { e.Cancel = true; return; } else { ProgressDialog dlgProgresss = new ProgressDialog(); BrokerServiceClient client = GetWizard().Tag as BrokerServiceClient; if (_Update && comboBoxId.Text != _OriginalScheduledProcedureId) { DialogResult r = Messager.ShowQuestion(this, "You searched for a scheduled procedure but have changed te scheduled procedure UID. " + "Would you like to update this scheduled procedure with the new UID?\r\n\r\n Clicking No will add a new scheduled procedure.", MessageBoxButtons.YesNo); _Update = r == DialogResult.Yes; } UpdateScheduledProcedureStep(); dlgProgresss.Title = _Update ? "Update Scheduled Procedure" : "Add Scheduled Procedure"; dlgProgresss.Description = _Update ? "Updating..." : "Adding..."; dlgProgresss.Action = () => { if (_Update) { client.UpdateScheduledProcedureStep(_OriginalScheduledProcedureId, _ScheduledProcedureStep); } else { client.AddScheduledProcedureStep(_ImagingServiceRequest.AccessionNumber, _RequestedProcedure.RequestedProcedureID, _ScheduledProcedureStep); } }; if (dlgProgresss.ShowDialog(this) == DialogResult.Cancel) { if (dlgProgresss.Exception != null) { e.Cancel = true; Messager.ShowError(this, dlgProgresss.Exception); return; } } else { if (_Update) { int index = comboBoxId.Items.IndexOf(_OriginalScheduledProcedureId); if (index != -1) { comboBoxId.Items.Remove(_OriginalScheduledProcedureId); } } comboBoxId.Items.Add(_ScheduledProcedureStep.ScheduledProcedureStepID); comboBoxId.Text = _ScheduledProcedureStep.ScheduledProcedureStepID; _OriginalScheduledProcedureId = _ScheduledProcedureStep.ScheduledProcedureStepID; } } base.OnWizardFinish(sender, e); }
public QueryForm(BrokerServiceClient client) { InitializeComponent(); _Client = client; LoadModalities(); }