コード例 #1
0
        /// <summary>
        /// Opens the daily prices record window for adding a new record
        /// </summary>
        private void buttonAdd_Click(object sender, RoutedEventArgs e)
        {
            DailyPricesWindow dailyPricesWindow = new DailyPricesWindow();

            dailyPricesWindow.Closed += DailyPricesWindow_Closed;
            dailyPricesWindow.ShowDialog();
        }
コード例 #2
0
 /// <summary>
 /// Opens the daily prices record window for editing
 /// </summary>
 private void buttonEdit_Click(object sender, RoutedEventArgs e)
 {
     if (DataGridDailyPrices.SelectedItem != null)
     {
         DataRowView       datagridRow       = (DataRowView)DataGridDailyPrices.SelectedItems[0];
         DailyPricesWindow dailyPricesWindow = new DailyPricesWindow(Int32.Parse(datagridRow["ID"].ToString())); // Pass the ID for record editing
         dailyPricesWindow.Closed += DailyPricesWindow_Closed;
         dailyPricesWindow.ShowDialog();
     }
 }