Ejemplo n.º 1
0
 private void serviceChangeLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     using (var f = new SelectServiceForm())
     {
         if (f.ShowDialog() == DialogResult.OK)
         {
             clientRequest.Service = f.Service;
             serviceTextBlock.Text = clientRequest.Service.ToString();
         }
     }
 }
Ejemplo n.º 2
0
        private async void serviceChangeLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (currentClientRequestPlan != null)
            {
                var clientRequest = currentClientRequestPlan.ClientRequest;

                using (var f = new SelectServiceForm())
                {
                    if (f.ShowDialog() == DialogResult.OK)
                    {
                        clientRequest.Service = f.Service;

                        try
                        {
                            serviceChangeLink.Enabled = false;

                            using (var channel = QueuePlanChannelManager.CreateChannel())
                            {
                                await taskPool.AddTask(channel.Service.EditCurrentClientRequest(clientRequest));
                            }
                        }
                        catch (OperationCanceledException) { }
                        catch (CommunicationObjectAbortedException) { }
                        catch (ObjectDisposedException) { }
                        catch (InvalidOperationException) { }
                        catch (FaultException exception)
                        {
                            UIHelper.Warning(exception.Reason.ToString());
                        }
                        catch (Exception exception)
                        {
                            UIHelper.Warning(exception.Message);
                        }
                        finally
                        {
                            serviceChangeLink.Enabled = true;
                        }
                    }
                }
            }
        }