예제 #1
0
        public void Add()
        {
            const string title       = "Add new Loan Product";
            const string message     = "Please enter a description";
            var          inputWindow = new InputWindow(message, title);

            if (inputWindow.ShowDialog() == true)
            {
                var input = inputWindow.InputText;
                if (string.IsNullOrEmpty(input))
                {
                    MessageWindow.ShowAlertMessage("Please specify a Loan Product Name");
                    return;
                }
                var newLoanProduct = LoanProduct.WhereTitleIs(input);
                if (newLoanProduct != null)
                {
                    MessageWindow.ShowAlertMessage(input + "already exists");
                    return;
                }

                var editView = new EditLoanProductView(input);
                if (editView.ShowDialog() == true)
                {
                    newLoanProduct = new LoanProduct();
                    newLoanProduct.Find(editView.CurrentItem.ID);
                    _lookup.Add(newLoanProduct);
                    _viewModel.Collection.Add(newLoanProduct);
                }
            }
        }
예제 #2
0
        public void Edit()
        {
            if (_viewModel.SelectedItem == null)
            {
                return;
            }
            var editView = new EditLoanProductView(_viewModel.SelectedItem.ID);

            if (editView.ShowDialog() == true)
            {
                _viewModel.SelectedItem.Find(_viewModel.SelectedItem.ID);
            }
        }