예제 #1
0
 private YellowstonePathology.Business.ClientOrder.Model.ClientOrderCollection GetClientOrdersForExternalOrderIds()
 {
     YellowstonePathology.Business.ClientOrder.Model.ClientOrderCollection result = null;
     if (this.ListViewClientOrders.SelectedItems.Count == 0)
     {
         MessageBox.Show("Select one or more Client Orders from the Recent Client Orders List.");
     }
     else
     {
         result = new Business.ClientOrder.Model.ClientOrderCollection();
         foreach (YellowstonePathology.Business.ClientOrder.Model.ClientOrder clientOrder in this.ListViewClientOrders.SelectedItems)
         {
             if (string.IsNullOrEmpty(clientOrder.ExternalOrderId) == false)
             {
                 if (clientOrder.PanelSetId.HasValue && result.PanelSetIdExists(clientOrder.PanelSetId.Value) == true)
                 {
                     MessageBox.Show("Only one Client Order for " + clientOrder.OrderType + "may be used.  Choose one of the Client Orders to use.");
                     result = null;
                     break;
                 }
                 else if (result.ExternalOrderIdExists(clientOrder.ExternalOrderId) == false)
                 {
                     result.Add(clientOrder);
                 }
             }
             else
             {
                 result.Add(clientOrder);
             }
         }
     }
     if (result != null && this.SelectedClientOrders != null)
     {
         this.SelectedClientOrders(this, new CustomEventArgs.ClientOrderCollectionReturnEventArgs(result));
     }
     return(result);
 }