Esempio n. 1
0
        public void Save()
        {
            try
            {
                _validator.Validate();
                if (_order.Id == -1)
                {
                    _order.Id = _nextId++;
                    _storage.Add(_order);
                    ResetOrderInstance();
                }
                else
                {
                    _storage.Update(_order.Id, _order);
                }

                Util.Info("Wpf_Service", "An order was saved successfully!");
            }
            catch (Exception exc)
            {
                Util.Error("Order error", exc.Message);
            }
        }