title: UI BLL communication using interfaces
body: <p>Found this <a href="https://stackoverflow.com/questions/800161/handing-exception-in-bll-and-return-to-client-either-winforms-or-webforms">question</a> that explained a way to communicate between layers.
  However there is one more aspect.</p>
  
  <p>Assuming I am using interfaces to send messages from the BLL to the UI as seen in the folowing example:</p>
  
  <pre><code>public interface IUiCallbacks
  {
    void SendMessage(string message);
    void SendException(string message, Exception ex);
  }
  
  public class WinFormsUiCallbacks : IUiCallbacks
  {
    public void SendMessage(string message)
    {
      MessageBox.Show(message);
    }
  
    public void SendException(string message, Exception ex)
    {
      MessageBox.Show(string.Format("Unfortunately, the following errror has occurred:{0}{1}", Environment.NewLine, ex.Message));
    }
  }
  
  public class OrderService
  {
    private IUiCallbacks _iUiCallbacks;
    ...
    public OrderService() { ... }
    public OrderService(IUiCallbacks iUiCallbacks)
    {
      _iUiCallbacks = iUiCallbacks;
    }
    ...
    public void AddOrder(Order order)
    {
      ...
      if(OrderAlreadyExists(order))
      {
        if(_iUiCallbacks != null)
          _iUiCallbacks.SendMessage("The order can not be added, because it is already accepted.");
        return;
      }
      ...
    }
    ...
  }
  </code></pre>
  
  <p>Instead of the information message I want a confirmation box that would confirm the  overwrite for the existing order.</p>
  
  <p>How can I handle the result of the confirmation box in this case?</p>
  
  <p>Thanks, 
  Alex</p>