private void BTT_Ok_Click(object sender, EventArgs e) { if (uiProductProperties.ValidateChildren()) { try { Product p = uiProductProperties.GetObject(); p.Added += P_Added; p.Add(); } catch (Exception ex) { PremadeMessage.Notification(ex.Message); } } }
private void BTT_AddToList_Click(object sender, EventArgs e) { try { Product P = ProductProperties.GetObject(); if (ShoppingCart.Contains(P)) { throw new ProductRepeatedException(); } else { AddToList(P); } } catch (ProductException ex) { PremadeMessage.Notification(ex.Message); } }
private void P_Added(object sender, string Action, int AffectedsRecords) { PremadeMessage.ObjectAction(sender, Action, AffectedsRecords); Added?.Invoke(this, (Product)sender); Close(); }
private void Product_ListPurchased(object sender, string e) { PremadeMessage.Notification(e); Close(); }