/// <summary> /// Alissa Duffy /// Updated: 2017/04/24 /// /// Deny Approval. /// Standardized methods. /// </summary> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDeny_Click(object sender, RoutedEventArgs e) { if (_supplier != null) { try { if (_supplierMgr.DenySupplier(_supplier, _userid)) { MessageBox.Show("Supplier Denied.", "System Updated", MessageBoxButton.OK, MessageBoxImage.Exclamation); } else { MessageBox.Show("Supplier record not altered", "Oops, no record was modified", MessageBoxButton.OK, MessageBoxImage.Hand); } } catch (Exception ex) { MessageBox.Show("There was an error approving this record. Please try again later" + Environment.NewLine + ex, "Oops, something went wrong", MessageBoxButton.OK, MessageBoxImage.Error); } MessageBox.Show("Supplier not approved.", "System Updated", MessageBoxButton.OK, MessageBoxImage.Exclamation); this.Close(); } if (_commercialCustomer != null) { try { if (_customerMgr.DenyCommercialCustomer(_commercialCustomer, _userid)) { MessageBox.Show("Commercial Customer Denied.", "System Updated", MessageBoxButton.OK, MessageBoxImage.Exclamation); } else { MessageBox.Show("Commercial Customer record not altered", "Oops, no record was modified", MessageBoxButton.OK, MessageBoxImage.Hand); } } catch (Exception ex) { MessageBox.Show("There was an error approving this record. Please try again later" + Environment.NewLine + ex, "Oops, something went wrong", MessageBoxButton.OK, MessageBoxImage.Error); } MessageBox.Show("Commercial Customer not approved.", "System Updated", MessageBoxButton.OK, MessageBoxImage.Exclamation); this.Close(); } }