Esempio n. 1
0
        /// <summary>
        /// Handles the Click event of the addCustomerRecordButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void addCustomerRecordButton_Click(object sender, RoutedEventArgs e)
        {
            CustomerRecordWindow window = new CustomerRecordWindow();

            if (window.OpenWindowInMode(OpenWindowMode.Add) == true)
            {
                this.selectedCustomer.AddCustomerRecord(new CustomerRecord(window.Date, window.Note));
                this.RefreshSelectedCustomer();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Handles the MouseDoubleClick event of the customerRecordsListBox control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Input.MouseButtonEventArgs"/> instance containing the event data.</param>
        private void customerRecordsListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            CustomerRecord       customerRecord = (this.customerRecordsListBox.SelectedItem as CustomerRecord);
            CustomerRecordWindow window         = new CustomerRecordWindow();

            window.Date = customerRecord.Date;
            window.Note = customerRecord.Text;
            if (window.OpenWindowInMode(OpenWindowMode.Edit) == true)
            {
                customerRecord.Date = window.Date;
                customerRecord.Text = window.Note;
                this.RefreshSelectedCustomer();
            }
        }