コード例 #1
0
        private void CheckContractAndDisplayIt(SavingSearchResult saving)
        {
            if (!_isSearchSavingContractForTransfer)
            {
                try
                {
                    ClientServices clientServices = ServicesProvider.GetInstance().GetClientServices();

                    IClient client = ServicesProvider.GetInstance().GetClientServices().FindTiers(saving.ClientId, saving.ClientType);

                    if (clientServices.CheckIfTiersIsValid(client))
                    {
                        var mainForm = (MainView)Application.OpenForms[0];
                        mainForm.InitializeSavingContractForm(client, saving.Id);
                    }
                }
                catch (Exception ex)
                {
                    new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog();
                }
            }
            else
            {
                groupBoxContractType.Enabled       = true;
                _isSearchSavingContractForTransfer = false;
                SelectedSavingContract             = saving;
                DialogResult = DialogResult.OK;
            }
        }
コード例 #2
0
        private void CheckContractAndDisplayIt(CreditSearchResult pCredit)
        {
            if (!_isSearchLoanContractForCompulsory)
            {
                try
                {
                    ClientServices clientServices = ServicesProvider.GetInstance().GetClientServices();

                    // if client has no contract (i.e. in Village)
                    if (pCredit.Id == 0)
                    {
                        MessageBox.Show(@"This client in a village has no contract yet!");
                    }
                    else
                    {
                        IClient client = clientServices.FindTiersByContractId(pCredit.Id);

                        if (clientServices.CheckIfTiersIsValid(client))
                        {
                            var mainForm = (MainView)Application.OpenForms[0];
                            mainForm.InitializeCreditContractForm(client, pCredit.Id);
                        }
                    }
                }
                catch (Exception ex)
                {
                    new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog();
                }
            }
            else
            {
                groupBoxContractType.Enabled       = true;
                _isSearchSavingContractForTransfer = false;
                SelectedLoanContract = pCredit;
                DialogResult         = DialogResult.OK;
            }
        }
コード例 #3
0
 public void TestIfTiersIsValidWhenTiersIsNull()
 {
     clientServices.CheckIfTiersIsValid(null);
 }