コード例 #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 listViewContracts_DoubleClick(object sender, EventArgs e)
        {
            object result = listViewContracts.SelectedItems[0].Tag;

            if (result is CreditSearchResult)
            {
                CreditSearchResult csr = (CreditSearchResult)result;
                if (!csr.IsViewableBy(User.CurrentUser))
                {
                    Fail("cannotView");
                    return;
                }
                CheckContractAndDisplayIt((CreditSearchResult)result);
            }
            else
            {
                SavingSearchResult ssr = (SavingSearchResult)result;
                if (!ssr.IsViewableBy(User.CurrentUser))
                {
                    Fail("cannotView");
                    return;
                }
                CheckContractAndDisplayIt((SavingSearchResult)result);
            }
        }
コード例 #3
0
        private void btSearchContract_Click(object sender, EventArgs e)
        {
            SearchCreditContractForm searchCreditContractForm = SearchCreditContractForm.GetInstance(null);

            searchCreditContractForm.BringToFront();
            searchCreditContractForm.WindowState = FormWindowState.Normal;
            if (searchCreditContractForm.ShowForSearchSavingsContractForTransfer("") == DialogResult.OK)
            {
                ToSaving             = searchCreditContractForm.SelectedSavingContract;
                lbClientName.Text    = ToSaving.ClientName;
                tbTargetAccount.Text = ToSaving.ContractCode;
            }
        }
コード例 #4
0
        private void btSearchContract_Click(object sender, EventArgs e)
        {
            SearchCreditContractForm searchCreditContractForm = SearchCreditContractForm.GetInstance(null);

            searchCreditContractForm.BringToFront();
            searchCreditContractForm.WindowState = FormWindowState.Normal;
            if (searchCreditContractForm.ShowForSearchSavingsContractForTransfer("") == DialogResult.OK)
            {
                SavingSearchResult saving = searchCreditContractForm.SelectedSavingContract;
                lblClientName.Text   = saving.ClientName;
                tbTargetAccount.Text = saving.ContractCode;

                _savingTarget          = ServicesProvider.GetInstance().GetAccountServices().GetSaving(saving.Id);
                lblInterBranch.Visible = !IsNormalTransfer();
                LoadTransferFee();
            }
        }