public async void AddInstrument()
        {
            var existing = await _instrumentRepository.GetInstrumentAsync(NewInstrument.Code);

            if (existing != null)
            {
                return;
            }

            _instrumentRepository.Add(NewInstrument);

            if (await _instrumentRepository.SaveChangesAsync())
            {
                WindowLoaded();
                MessageBox.Show("Added Successfully", "Done");
                NewInstrument = new Instrument();
            }
        }
Example #2
0
        public async void ChangeStatus(string status)
        {
            var order = await _instrumentRepository.GetOrdersByOrderNumberToSetStatusAsync(SelectedOrder.OrderNumber, status);

            if (order == null)
            {
                return;
            }
            else
            {
                await _instrumentRepository.SaveChangesAsync();

                WindowLoaded();
                SelectedOrder = new Order();
            }
        }