void multiShipToTabContainer_SelectedPageChanging(object sender, DevExpress.XtraLayout.LayoutTabPageChangingEventArgs e) { string question = ""; if (multiShipToTabContainer.SelectedTabPage == singleShipToTab) { if (!string.IsNullOrEmpty(m_salesOrder.ShipToAddress)) { question = "This will clear the Single Ship To. Are you sure you want to do this?"; } } else { if (m_salesOrder.ShipTos.Count > 0) { question = "This will clear the Multiple Ship Tos. Are you sure you want to do this?"; } } if (!string.IsNullOrEmpty(question)) { if (Scout.Core.UserInteraction.Dialog.AskQuestion(question) == DialogResult.No) { e.Cancel = true; } else { if (multiShipToTabContainer.SelectedTabPage == singleShipToTab) { m_salesOrder.ShipToAddress = ""; } else { m_salesOrder.DeleteMultipleShipToAddresses(); } } } }