private void priceTab_Enter(object sender, EventArgs e) { promoComboBox.Items.Clear(); productComboBox.Items.Clear(); promoComboBox.Items.AddRange(PromoPresenter.GetPromotions().ToArray()); productComboBox.Items.AddRange(ProductPresenter.GetProducts().ToArray()); }
public PriceModel(Ceny price) { Id = price.Id; RealPrice = price.Cena; Discount = price.Rabat; DiscountPrice = Discount == null ? RealPrice : RealPrice * (1 - (decimal)Discount / 100); Promotion = price.CennikId == null ? null : PromoPresenter.GetPromotionById(price.CennikId); Product = price.TowarId == null ? null : ProductPresenter.GetProductById(price.TowarId); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var prodTabView = new ProductTabUC(); var prodPresenter = new ProductPresenter(prodTabView); var promoTabView = new PromoTabUC(); var promoPresenter = new PromoPresenter(promoTabView); var priceTabView = new PriceTabUC(); var pricePresenter = new PricePresenter(priceTabView); Application.Run(new MainForm(prodTabView, promoTabView, priceTabView)); }
private void UpdatePromoDataGridView() { promoDataGridView.DataSource = PromoPresenter.GetPromotions(); }