コード例 #1
0
        void AddEntry(Service service)
        {
            var entry = new Entry()
            {
                Id = new Guid(service.Id),
                Name = service.Name,
                Quantity = 1,
                CurrentMarkupPrice = Math.Round(service.TotalCost(), 2),
                TaxPercentage = Math.Round(service.TaxPercentage, 3)
            };

            Entries.Add(entry);
            _registry.Add(new KeyValuePair<Guid, Entry>(entry.Id, entry));
            _entryDictionary.Add(service, entry);

            bool collectionsInSync = Entries.Count == _registry.Count &&
                                     Entries.Count == _entryDictionary.Count;
            Debug.Assert(collectionsInSync);
        }
コード例 #2
0
        void ProcessEntry(Service service)
        {
            Services.Add(service);

            AddMaterials(service);

            var entry = new Entry()
            {
                Id = new Guid(service.Id),
                Name = service.Name,
                Quantity = 1,
                CurrentMarkupPrice = Math.Round(service.TotalCost(), 2),
                TaxPercentage = Math.Round(service.TaxPercentage, 3)
            };

            Entries.Add(entry);
            _registry.Add(new KeyValuePair<Guid, Entry>(entry.Id, entry));
            _entryDictionary.Add(service, entry);

            SelectedEntry = entry;
            UpdateSummary();
        }