Beispiel #1
0
        private void DeleteQuotation()
        {
            if (SelectedQuotation != null)
            {
                _unitOfWork.QuotationRepository.Delete(SelectedQuotation.QuotationModel);
                _unitOfWork.Save();

                Quotations.Remove(SelectedQuotation);
            }
        }
Beispiel #2
0
        // Methods
        private void CreateNewQuotation()
        {
            QuotationViewModel quotation = new QuotationViewModel(new Quotation(new QuotationStatus(DateTime.Now, QuotationStatusType.Created)));

            Quotations.Add(quotation);
            _unitOfWork.QuotationRepository.Add(quotation.QuotationModel);
            _unitOfWork.Save();

            IWindowService configureQuotationView = _windowFactory.GetWindowService(WindowType.ConfigureQuotationView);
            ConfigureQuotationViewModel configureQuotationViewModel = new ConfigureQuotationViewModel(configureQuotationView.Close, quotation, ActiveCustomers, _windowFactory);

            configureQuotationView.OpenAsDialog(configureQuotationViewModel);

            if (!configureQuotationViewModel.NeedToBeAdded)
            {
                _unitOfWork.QuotationRepository.Delete(quotation.QuotationModel);
                Quotations.Remove(quotation);
                _unitOfWork.Save();
            }
        }
Beispiel #3
0
 public void ExecuteDeleteQuotationCommand()
 {
     Quotations.Remove(selectedQuotation);
     SelectedQuotation = null;
 }