示例#1
0
        private void uiButtonValidar_Click(object sender, EventArgs e)
        {
            if (currentCustomerFisico != null)
            {
                if (uiTxtValidacao.Text == currentCustomerFisico.RG)
                {
                    uiPanelSecurity.Visible    = false;
                    flowPanelCustomerJ.Visible = false;

                    txtNomeF.Text  = string.Format("{0} {1}", currentCustomerFisico.FirstName, currentCustomerFisico.LastName);
                    txtDataF.Text  = UtilConvert.ToString(UtilConvert.ToDate(currentCustomerFisico.DateBirth).ToShortDateString());
                    txtSexoF.Text  = UtilConvert.ToString(currentCustomerFisico.Gender);
                    txtCPFF.Text   = UtilConvert.ToString(currentCustomerFisico.CPF);
                    txtRGF.Text    = UtilConvert.ToString(currentCustomerFisico.RG);
                    txtEmailF.Text = UtilConvert.ToString(currentCustomerFisico.Email);

                    flowPanelCustomerF.Controls.Add(uiFlowPanelMoedas);
                    flowPanelCustomerF.Controls.Add(panelCryptocurrency);
                    flowPanelCustomerF.Visible = true;
                }
                else
                {
                    new Alert("O RG fornecido não está de acordo com atual cliente.\nTente novamente mais tarde.", uiCSB.Toastr.Type.Warning);
                }
            }
            else if (currentCustomerJuridico != null)
            {
                if (uiTxtValidacao.Text == currentCustomerJuridico.RazaoSocial)
                {
                    uiPanelSecurity.Visible    = false;
                    flowPanelCustomerF.Visible = false;

                    txtRazaoSocialJ.Text = UtilConvert.ToString(currentCustomerJuridico.RazaoSocial);
                    txtCNPJJ.Text        = UtilConvert.ToString(currentCustomerJuridico.CNPJ);
                    txtEmailJ.Text       = UtilConvert.ToString(currentCustomerJuridico.Email);

                    flowPanelCustomerJ.Controls.Add(uiFlowPanelMoedas);
                    flowPanelCustomerJ.Controls.Add(panelCryptocurrencyJ);
                    flowPanelCustomerJ.Visible = true;
                }
                else
                {
                    new Alert("A razão social fornecida não está de acordo com atual cliente.\nTente novamente mais tarde.", uiCSB.Toastr.Type.Warning);
                }
            }
        }