コード例 #1
0
        /// <summary>
        /// Use the Search textbox and UpdateHomeAsSold Menu Item to search for and update a HomeSale, Home, and OwnerID.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MenuUpdateHomeAsSold_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ClearSearchResultsViews();

                if (MainWindow.SelectedHomesaleID > 0 && MainWindow.SelectedHomeID > 0)
                {
                    var homeUpdaterWindow = new HomeUpdaterWindow(MainWindow.SelectedHomeID, SelectedHomesaleID);
                    DisplayStatusMessage("Loading update window");
                    homeUpdaterWindow.Show();
                }
                else
                {
                    DisplayStatusMessage("Select an item from the results and try again.");
                    return;
                }
            }
            catch (Exception ex)
            {
                DisplayStatusMessage("Select a Home first, then click Menu, Update Home As Sold.");
                logger.Data(System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message);
                logger.Flush();
            }
            finally
            {
            }
        }
コード例 #2
0
 /// <summary>
 /// Opens Home Updater Window to edit a selected Home to put it up for sale or change other For Sale properties.
 /// </summary>
 /// <param name="sender">sender</param>
 /// <param name="e">e</param>
 private void MenuAddHomeForSale_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         ClearSearchResultsViews();
         DisplayStatusMessage($"Selected Home ID: { SelectedHomeID }.");
         var homeUpdaterWindow = new HomeUpdaterWindow(MainWindow.SelectedHomeID);
         homeUpdaterWindow.Show();
     }
     catch (Exception ex)
     {
         DisplayStatusMessage("Select a Home that is not already for Sale then click Menu Add Home For Sale.");
         logger.Data(System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message);
         logger.Flush();
     }
     finally
     {
     }
 }