public void Remove(object o) { switch (o.GetType().Name) { case "Products": Products p = (Products)o; this.ProductCache.Remove(p); break; case "Service": Service s = (Service)o; this.ServiceCache.Remove(s); break; case "Customer": Customer c = (Customer)o; this.CustomerCache.Remove(c); break; case "ListCache": ListCache lc = (ListCache)o; this.InvoiceCache.Remove(lc); break; } }
private void Remove_Invoice(object sender, RoutedEventArgs e) { if (App.Manager.ActiveUser.Perms.CanAddPS == true) { if (InvoiceViewbox.SelectedItem != null) { ListCache l = (ListCache)this.InvoiceViewbox.SelectedItem; App.Manager.MainCache.Remove(l); } } }
private void InvoiceInfo_Click(object sender, RoutedEventArgs e) { ListCache i = (ListCache)this.InvoiceViewbox.SelectedItem; App.VisibleInvoice = App.LoadInvoice("data/invoices/InvoiceID" + i.ID.ToString() + ".inv"); if (this.PP_IP != null) { this.PP_IP.Close(); } this.PP_IP = new InvoicePopup(); this.PP_IP.Show(); ViewPopup.IsOpen = false; }