示例#1
0
        private void ConfigureQuotation()
        {
            if (SelectedQuotation != null)
            {
                IWindowService configureQuotationView = _windowFactory.GetWindowService(WindowType.ConfigureQuotationView);

                ConfigureQuotationViewModel configureQuotationViewModel = new ConfigureQuotationViewModel(configureQuotationView.Close, SelectedQuotation, ActiveCustomers, _windowFactory);
                configureQuotationView.OpenAsDialog(configureQuotationViewModel);

                _unitOfWork.Save();
            }
        }
示例#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();
            }
        }