Ejemplo n.º 1
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            if (_upDownAmount.Value == null || _upDownPrice.Value == null)
            {
                return;
            }

            var item = new InvoiceItem
            {
                Name     = _tbName.Text,
                Price    = _upDownPrice.Value.Value,
                Amount   = _upDownAmount.Value.Value,
                Currency = _currency,
                Unit     = _cbUnit.SelectedItem as UnitOfMeasure
            };

            item.SetTotal();

            var result = Saver.Checker(item);

            if (result)
            {
                _items.Add(item);
                Init();
            }
        }