// Add Button Click private void customerAddButton_Click(object sender, EventArgs e) { // open add customer form DataInterface.DBClose(); addCustomer = new AddCustomerForm(); AddCustomerForm.customerForm = this; addCustomer.Show(); }
// Selected Customer changes private void appointmentCustomerComboBox_SelectedIndexChanged(object sender, EventArgs e) { // Check if ComboBox has text and set color accordingly AddCustomerForm.checkTextChanged(appointmentCustomerComboBox); // create DataRowView of selected row DataRowView drv = (DataRowView)appointmentCustomerComboBox.SelectedItem; // Set customer ID to ID stored in DataRow selectedCustomerID = Convert.ToInt32(drv[0]); }
// Index Changed on ComboBox private void appointmentCustomerComboBox_SelectedIndexChanged(object sender, EventArgs e) { // Check if background color needs to change AddCustomerForm.checkTextChanged(appointmentCustomerComboBox); // Create a DataRowView to obtain data from selection DataRowView drv = (DataRowView)appointmentCustomerComboBox.SelectedItem; // Set customerID by ID from selected row selectedCustomerID = Convert.ToInt32(drv[0]); }
private void appointmentDescriptionTextBox_TextChanged(object sender, EventArgs e) { AddCustomerForm.checkTextChanged(appointmentTitleTextBox); }
private void customerPhoneTextBox_TextChanged(object sender, EventArgs e) { AddCustomerForm.checkTextChanged(customerPhoneTextBox); }