private void setBonus(ORDERS order)
        {
            int bonusID = 0;

            if (Int32.TryParse(ddlBonus.SelectedValue, out bonusID) && bonusID != -1)
            {
                BONUS bonus = new BONUS() { ID = bonusID, Version = Version.Where(b => b.Key == bonusID).FirstOrDefault().Value };

                ORDER_BONUS ordBonus = new ORDER_BONUS() { OrderID = order.ID, BonusID = bonusID, Value = BonusUsed, ORDERS = order, BONUS = bonus };

                order.BonusUsed = BonusUsed;
                order.ORDER_BONUS.Add(ordBonus);
            }
        }
 private void setBonus(ORDERS order, int bonusID, decimal BonusUsed)
 {
     BONUS bonus = new BONUS() { ID = bonusID };
     ORDER_BONUS ordBonus = new ORDER_BONUS() { OrderID = order.ID, BonusID = bonusID, Value = BonusUsed, ORDERS = order, BONUS = bonus };
     order.BonusUsed = BonusUsed;
     order.ORDER_BONUS.Add(ordBonus);
 }
 public void RemoveBonus(ORDER_BONUS Bonus)
 {
     Context.ORDER_BONUS.Attach(Bonus);
     Context.DeleteObject(Bonus);
 }