private void ViewDeleteButton_Click(object sender, RoutedEventArgs e) { if (SelectedLabel != null && SelectedLabel != DefaultLabel) { var result = (Forms.DialogResult)PMessageBox.Show("Delete for: " + SelectedLabel.Name + "\nCollection Date is: " + SelectedLabel.DeliveryDate, "Print for: " + SelectedLabel.Name, Forms.MessageBoxButtons.YesNo); if (result == Forms.DialogResult.Yes) { MainWindow.FirebaseManage.DeleteLabel(SelectedLabel, CustomersList); } } }
private void ButtonPrint_Click(object sender, RoutedEventArgs e) { var button = sender as Button; var ParentItem = FindControlParent(button, typeof(ListViewItem)) as ListViewItem; SelectedLabel = LabelListView.ItemContainerGenerator.ItemFromContainer(ParentItem) as TLabel; if (SelectedLabel != null) { var result = (Forms.DialogResult)PMessageBox.Show("Print for: " + SelectedLabel.Name + "\nCollection Date is: " + SelectedLabel.DeliveryDate, "Print for: " + SelectedLabel.Name, Forms.MessageBoxButtons.YesNo); if (result == Forms.DialogResult.Yes) { MainWindow.PrintManage.Print(SelectedLabel); } } }
private void DeleteCustomerButton_Click(object sender, RoutedEventArgs e) { var button = sender as Button; var ParentItem = FindControlParent(button, typeof(ListViewItem)) as ListViewItem; var SelectedCustomer = CustomerListView.ItemContainerGenerator.ItemFromContainer(ParentItem) as Customer; if (SelectedCustomer != null) { var result = (Forms.DialogResult)PMessageBox.Show("Delete Customer: " + SelectedCustomer.Name, "Delete Customer: " + SelectedLabel.Name, Forms.MessageBoxButtons.YesNo); if (result == Forms.DialogResult.Yes) { MainWindow.FirebaseManage.DeleteCustomer(SelectedCustomer, CustomersList); } } }