Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        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;
                //}
            }
        }
Exemplo n.º 5
0
        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;
                //}
            }
        }
Exemplo n.º 6
0
 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();
 }