private void AddBt_Click(object sender, EventArgs e) { WareDiscountsLogic discountsLogic = new WareDiscountsLogic(manager); int discoutId = Convert.ToInt32(AvailableDiscountsGV.SelectedRows[0].Cells["DiscountID"].Value); acceptedDiscounts.Add(discountsLogic.Get(discoutId)); FillDiscounts(); }
private void RemoveBt_Click(object sender, EventArgs e) { WareDiscountsLogic discountsLogic = new WareDiscountsLogic(manager); int discoutId = Convert.ToInt32(AcceptedDiscountsGV.CurrentRow.Cells["DiscountID0"].Value); acceptedDiscounts.Remove(discountsLogic.Get(discoutId)); FillDiscounts(); }
private void AddBt_Click(object sender, EventArgs e) { WareDiscountsLogic discountsLogic = new WareDiscountsLogic(manager); int discoutId = Convert.ToInt32(AvailableDiscountsGV.SelectedRows[0].Cells["DiscountID"].Value); acceptedDiscounts.Add(discountsLogic.Get(discoutId)); FillDiscounts(); }
private void Fill() { WareDiscountTypesLogic discountTypes = new WareDiscountTypesLogic(manager); DiscountTypesCB.DataSource = discountTypes.GetAll(); DiscountTypesCB.ValueMember = "ID"; DiscountTypesCB.DisplayMember = "Name"; DiscountTypesCB.Update(); if (mode == "edit") { if (id != null) { WareDiscountsLogic discounts = new WareDiscountsLogic(manager); WareDiscount discount = discounts.Get(Convert.ToInt32(id)); if (discount != null) { NameTB.Text = discount.Name; ActiveCB.Checked = discount.Active; DefaultDiscountPercentNUD.Value = discount.DefaultDiscountPercent; //int i = 0; foreach (WareDiscountType a in DiscountTypesCB.Items) { if (a.ID == discount.DiscountTypeID) { DiscountTypesCB.SelectedItem = a; } } } } //WareDiscountType discountTypes = discountTypes.Get(Convert.ToInt32(id)); //if (currency != null) //{ // NameTB.Text = currency.Name; //} } }
private void Fill() { WareDiscountTypesLogic discountTypes = new WareDiscountTypesLogic(manager); DiscountTypesCB.DataSource = discountTypes.GetAll(); DiscountTypesCB.ValueMember = "ID"; DiscountTypesCB.DisplayMember = "Name"; DiscountTypesCB.Update(); if (mode == "edit") { if (id != null) { WareDiscountsLogic discounts = new WareDiscountsLogic(manager); WareDiscount discount = discounts.Get(Convert.ToInt32(id)); if (discount != null) { NameTB.Text = discount.Name; ActiveCB.Checked = discount.Active; DefaultDiscountPercentNUD.Value = discount.DefaultDiscountPercent; //int i = 0; foreach (WareDiscountType a in DiscountTypesCB.Items) { if (a.ID == discount.DiscountTypeID) DiscountTypesCB.SelectedItem = a; } } } //WareDiscountType discountTypes = discountTypes.Get(Convert.ToInt32(id)); //if (currency != null) //{ // NameTB.Text = currency.Name; //} } }
private void RemoveBt_Click(object sender, EventArgs e) { WareDiscountsLogic discountsLogic = new WareDiscountsLogic(manager); int discoutId = Convert.ToInt32(AcceptedDiscountsGV.CurrentRow.Cells["DiscountID0"].Value); acceptedDiscounts.Remove(discountsLogic.Get(discoutId)); FillDiscounts(); }