protected void btnAddPromotion_Click(object sender, EventArgs e) { String title = txtTitle.Text; String description = txtDescription.Text; int discount = Int32.Parse(txtDiscount.Text); Promotion x = PromotionFactory.create(title, description, discount); PromotionRepositories.insertPromo(x); erMessage.Text = "Successfully added new Promotion!"; }
public static void create(Promotion promo) { PromotionRepositories.insertPromo(promo); }