protected override void HandleTierSelect(ClientSearchResult pClient) { var clientServices = ServicesProvider.GetInstance().GetClientServices(); var person = clientServices.FindPersonById(pClient.Id); Value = new CustomClientField(person); }
protected virtual void HandleTierSelect(ClientSearchResult pClient) { try { _client = ServicesProvider.GetInstance().GetClientServices().FindTiers(pClient.Id, pClient.Type); /* * This code is for loading compulsory savings. Compulsory savings are being * loaded here because in LoanManager class SavingsManager trigers problems. * Ruslan Kazakov */ if (_client.Projects != null) { foreach (Project project in _client.Projects) { if (project.Credits != null) { foreach (Loan loan in project.Credits) { loan.CompulsorySavings = ServicesProvider.GetInstance().GetAccountServices().GetSavingForLoan(loan.Id, true); } } } } if (test != 2) { var mainForm = (MainView)Application.OpenForms[0]; if (pClient.Type == OClientTypes.Person) { mainForm.InitializePersonForm((Person)_client, null); } if (pClient.Type == OClientTypes.Group) { mainForm.InitializeGroupForm((Group)_client, null); } if (pClient.Type == OClientTypes.Corporate) { mainForm.InitializeCorporateForm((Corporate)_client, null); } if (OClientTypes.Village == pClient.Type) { mainForm.InitializeVillageForm((Village)_client); } } else { DialogResult = DialogResult.OK; } Close(); } catch (Exception ex) { new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }
public async Task Get_Index_with_default_pager() { var pager = new SearchPager(); var viewModel = new ClientSearchResult { Items = new PagedList <Client>(Enumerable.Empty <Client>(), 1, 10) }; mediator.SendAsync(Arg.Any <ClientSearchQuery>()) .Returns(Task.FromResult(viewModel)); var result = await controller.Index(pager) as ViewResult; Assert.AreEqual(result.Model, viewModel); mediator.Received() .SendAsync(Arg.Is <ClientSearchQuery>(q => q.Pager == pager)) .IgnoreAwaitForNSubstituteAssertion(); }