Exemplo n.º 1
0
 private void PopularPlanoProtecaoMorteAcidental()
 {
     ddlPlanoProtecaoFuneralMorteNovo.DataValueField = "Key";
     ddlPlanoProtecaoFuneralMorteNovo.DataTextField  = "Value";
     ddlPlanoProtecaoFuneralMorteNovo.DataSource     = ControllerPlanoProtecao.ListarTodosMorteAcidental(true, FaixaBase);
     ddlPlanoProtecaoFuneralMorteNovo.DataBind();
 }
Exemplo n.º 2
0
 private void PopularPlanoProtecaoInvalidezAcidente()
 {
     ddlPlanoProtecaoFuneralIPANovo.DataValueField = "Key";
     ddlPlanoProtecaoFuneralIPANovo.DataTextField  = "Value";
     ddlPlanoProtecaoFuneralIPANovo.DataSource     = ControllerPlanoProtecao.ListarTodosInvalidezAcidente(true, FaixaBase);
     ddlPlanoProtecaoFuneralIPANovo.DataBind();
 }
Exemplo n.º 3
0
 private void PopularPlanoProtecaoRendaValor()
 {
     ddlPlanoProtecaoRendaValorNovo.DataValueField = "Key";
     ddlPlanoProtecaoRendaValorNovo.DataTextField  = "Value";
     ddlPlanoProtecaoRendaValorNovo.DataSource     = ControllerPlanoProtecao.ListarTodosRendaValor(true, Convert.ToInt32(ddlPlanoProtecaoRendaPeriodoNovo.SelectedValue), FaixaBase);
     ddlPlanoProtecaoRendaValorNovo.DataBind();
 }
Exemplo n.º 4
0
 private void PopularPlanoProtecaoRendaMeses()
 {
     ddlPlanoProtecaoRendaPeriodoNovo.DataValueField = "Key";
     ddlPlanoProtecaoRendaPeriodoNovo.DataTextField  = "Value";
     ddlPlanoProtecaoRendaPeriodoNovo.DataSource     = ControllerPlanoProtecao.ListarTodosRendaPeriodo(true);
     ddlPlanoProtecaoRendaPeriodoNovo.DataBind();
 }
Exemplo n.º 5
0
        private void PreencherSimuladorAbaTabelasSubPlano()
        {
            if (Convert.ToInt32(cmbAba5Sub5Sub1Produto.SelectedValue) == (int)ProdutoPrincipal.PLANOPROTECAO &&
                cmbAba5Sub5Sub2Morte.SelectedIndex > 0 && cmbAba5Sub5Sub2Funeral.SelectedIndex > 0)
            {
                TPlanoProtecaoDOMINIO registro = ControllerPlanoProtecao.CalcularPremioFuneral(Convert.ToDecimal(cmbAba5Sub5Sub2Morte.SelectedValue), 0, 0, Convert.ToInt32(cmbAba5Sub5Sub2Funeral.SelectedValue), Convert.ToInt32(cmbAba5Sub5Sub1FaixaBase.SelectedValue));

                lblAba5Sub5Sub2AssistOUConjValor.Text = String.Format(new CultureInfo("pt-BR"), "{0:C}", registro.CoberturaAcidente);
                lblAba5Sub5Sub2IPAValor.Text          = String.Format(new CultureInfo("pt-BR"), "{0:C}", registro.CoberturaEmergencia);
                lblAba5Sub5Sub2PremioPlanoValor.Text  = String.Format(new CultureInfo("pt-BR"), "{0:C}", registro.ValorPremioIdadeBase.GetValueOrDefault());
            }

            if (Convert.ToInt32(cmbAba5Sub5Sub1Produto.SelectedValue) == (int)ProdutoPrincipal.PLANOSENIOR &&
                cmbAba5Sub5Sub2Morte.SelectedIndex > 0 && cmbAba5Sub5Sub2Funeral.SelectedIndex > 0)
            {
                TPlanoSeniorDOMINIO registro = ControllerPlanoSenior.CalcularPremioFuneral(Convert.ToDecimal(cmbAba5Sub5Sub2Morte.SelectedValue), Convert.ToInt32(cmbAba5Sub5Sub2Funeral.SelectedValue), Convert.ToInt32(cmbAba5Sub5Sub1FaixaBase.SelectedValue));

                lblAba5Sub5Sub2PremioPlanoValor.Text = String.Format(new CultureInfo("pt-BR"), "{0:C}", registro.ValorPremioIdadeBase.GetValueOrDefault());
            }

            if (Convert.ToInt32(cmbAba5Sub5Sub1Produto.SelectedValue) == (int)ProdutoPrincipal.PLANOCASAL &&
                cmbAba5Sub5Sub2Morte.SelectedIndex > 0 && cmbAba5Sub5Sub2Funeral.SelectedIndex > 0)
            {
                TPlanoCasalDOMINIO registro = ControllerPlanoCasal.CalcularPremioFuneral(Convert.ToDecimal(cmbAba5Sub5Sub2Morte.SelectedValue), 0, Convert.ToInt32(cmbAba5Sub5Sub2Funeral.SelectedValue), Convert.ToInt32(cmbAba5Sub5Sub1FaixaBase.SelectedValue));

                lblAba5Sub5Sub2AssistOUConjValor.Text = String.Format(new CultureInfo("pt-BR"), "{0:C}", registro.CoberturaConjuge);
                lblAba5Sub5Sub2PremioPlanoValor.Text  = String.Format(new CultureInfo("pt-BR"), "{0:C}", registro.ValorPremioIdadeBase.GetValueOrDefault());
            }
        }
        private void PreencherDominoAbaSimuladorSubRenda()
        {
            DataTable tableTRenda = ControllerSimuladorSubRenda.SelecioneSimuladorSubRenda(DadosTSimuladorProduto.IDSimuladorProduto);

            if (tableTRenda.Rows.Count > 0)
            {
                DadosTPlanoProtecao.RendaPeriodo = tableTRenda.Rows[0]["Periodo"].ToString();
                DadosTPlanoProtecao.RendaCoberturaRendaMensal  = Convert.ToDecimal(tableTRenda.Rows[0]["ValorRenda"]);
                DadosTPlanoProtecao.RendaCoberturaCapitalTotal = Convert.ToDecimal(tableTRenda.Rows[0]["Capital"]);
                DadosTPlanoProtecao.RendaValorPremioIdadeBase  = Convert.ToDecimal(tableTRenda.Rows[0]["PremioRenda"]);
                PremioRenda = DadosTPlanoProtecao.RendaValorPremioIdadeBase.GetValueOrDefault();
            }
            else
            {
                if (DadosTPlanoProtecao.IDPlanoProtecao > 0 || DadosTSimuladorProduto.Produto.Equals(ProdutoPrincipal.PLANOPROTECAO.GetStringValue()))
                {
                    decimal valorPlanoAP = PremioTotalMax - PremioPlano - PremioAgregado;
                    TPlanoProtecaoDOMINIO rendaCalculada = new TPlanoProtecaoDOMINIO();
                    rendaCalculada = ControllerPlanoProtecao.SelecionarPlanoProtecaoRendaInicial(FaixaBase, valorPlanoAP);
                    if (rendaCalculada.IDPlanoProtecaoRenda > 0)
                    {
                        DadosTPlanoProtecao.RendaPeriodo = rendaCalculada.RendaPeriodo;
                        DadosTPlanoProtecao.RendaCoberturaRendaMensal  = rendaCalculada.RendaCoberturaRendaMensal;
                        DadosTPlanoProtecao.RendaCoberturaCapitalTotal = rendaCalculada.RendaCoberturaCapitalTotal;
                        DadosTPlanoProtecao.RendaValorPremioIdadeBase  = rendaCalculada.RendaValorPremioIdadeBase;
                        PremioRenda = rendaCalculada.RendaValorPremioIdadeBase.GetValueOrDefault();
                    }
                }
            }
        }
Exemplo n.º 7
0
        private void PopularSimuladorAbaTabelasComboPlanoProtecao()
        {
            lblAba5Sub5Sub2Produto.Text = ProdutoPrincipal.PLANOPROTECAO.GetStringValue();
            lblAba5Sub5Sub3Produto.Text = ProdutoPrincipal.PLANOPROTECAO.GetStringValue();
            lblAba5Sub5Sub4Produto.Text = ProdutoPrincipal.PLANOPROTECAO.GetStringValue();

            cmbAba5Sub5Sub2Morte.DataSource    = new BindingSource(ControllerPlanoProtecao.ListarTodosMorteAcidental(true, Convert.ToInt32(cmbAba5Sub5Sub1FaixaBase.SelectedValue)), null);
            cmbAba5Sub5Sub2Morte.ValueMember   = "Key";
            cmbAba5Sub5Sub2Morte.DisplayMember = "Value";
            DadosCmbAba5Sub5Sub2Morte          = ControllerPlanoProtecao.ListarTodosMorteAcidental(true, Convert.ToInt32(cmbAba5Sub5Sub1FaixaBase.SelectedValue));
            TextoCmbAba5Sub5Sub2Morte          = string.Empty;

            DadosCmbAba5Sub5Sub2IPA = ControllerPlanoProtecao.ListarTodosInvalidezAcidente(true, Convert.ToInt32(cmbAba5Sub5Sub1FaixaBase.SelectedValue));
            TextoCmbAba5Sub5Sub2IPA = string.Empty;

            DadosCmbAba5Sub5Sub2AssistOUConj = ControllerPlanoProtecao.ListarTodosAssisteciaEmergencial(true);
            TextoCmbAba5Sub5Sub2AssistOUConj = string.Empty;

            cmbAba5Sub5Sub2Funeral.DataSource    = new BindingSource(ControllerPlanoProtecao.ListarTodosFuneralCategoria(true), null);
            cmbAba5Sub5Sub2Funeral.ValueMember   = "Key";
            cmbAba5Sub5Sub2Funeral.DisplayMember = "Value";
            DadosCmbAba5Sub5Sub2Funeral          = ControllerPlanoProtecao.ListarTodosFuneralCategoria(true);
            TextoCmbAba5Sub5Sub2Funeral          = string.Empty;

            lblAba5Sub5Sub2AssistOUConj.Visible      = true;
            lblAba5Sub5Sub2AssistOUConj.Text         = "Assist. Emerg :";
            lblAba5Sub5Sub2AssistOUConj.Width        = 200;
            lblAba5Sub5Sub2AssistOUConjValor.Visible = true;
            lblAba5Sub5Sub2AssistOUConjValor.Text    = String.Format(new CultureInfo("pt-BR"), "{0:C}", Decimal.Zero);

            lblAba5Sub5Sub2IPA.Visible      = true;
            lblAba5Sub5Sub2IPA.Text         = "Inv. Acidental :";
            lblAba5Sub5Sub2IPAValor.Visible = true;
            lblAba5Sub5Sub2IPAValor.Text    = String.Format(new CultureInfo("pt-BR"), "{0:C}", Decimal.Zero);
        }
Exemplo n.º 8
0
 private void PopularPlanoProtecaoFuneralCategoria()
 {
     ddlPlanoProtecaoFuneralCategoriaNovo.DataValueField = "Key";
     ddlPlanoProtecaoFuneralCategoriaNovo.DataTextField  = "Value";
     ddlPlanoProtecaoFuneralCategoriaNovo.DataSource     = ControllerPlanoProtecao.ListarTodosFuneralCategoria(true);
     ddlPlanoProtecaoFuneralCategoriaNovo.DataBind();
 }
Exemplo n.º 9
0
 private void PopularPlanoProtecaoAssisteciaEmergencial()
 {
     ddlPlanoProtecaoFuneralAssistenciaNovo.DataValueField = "Key";
     ddlPlanoProtecaoFuneralAssistenciaNovo.DataTextField  = "Value";
     ddlPlanoProtecaoFuneralAssistenciaNovo.DataSource     = ControllerPlanoProtecao.ListarTodosAssisteciaEmergencial(true);
     ddlPlanoProtecaoFuneralAssistenciaNovo.DataBind();
 }
Exemplo n.º 10
0
 private void PopularSimuladorAbaTabelasSubRendaValor()
 {
     cmbAba5Sub5Sub4Valor.DataSource    = new BindingSource(ControllerPlanoProtecao.ListarTodosRendaValor(true, Convert.ToInt32(cmbAba5Sub5Sub4Periodo.SelectedValue), Convert.ToInt32(cmbAba5Sub5Sub1FaixaBase.SelectedValue)), null);
     cmbAba5Sub5Sub4Valor.ValueMember   = "Key";
     cmbAba5Sub5Sub4Valor.DisplayMember = "Value";
     DadosCmbAba5Sub5Sub4Valor          = ControllerPlanoProtecao.ListarTodosRendaValor(true, Convert.ToInt32(cmbAba5Sub5Sub4Periodo.SelectedValue), Convert.ToInt32(cmbAba5Sub5Sub1FaixaBase.SelectedValue));
     TextoCmbAba5Sub5Sub4Valor          = string.Empty;
 }
Exemplo n.º 11
0
 private void VerificaPlanoProtecaoFuneral()
 {
     if (ddlPlanoProtecaoFuneralMorteNovo.SelectedIndex > 0 && ddlPlanoProtecaoFuneralIPANovo.SelectedIndex > 0 && ddlPlanoProtecaoFuneralAssistenciaNovo.SelectedIndex > 0 && ddlPlanoProtecaoFuneralCategoriaNovo.SelectedIndex > 0)
     {
         PlanoProtecaoFuneralNovoVO             = ControllerPlanoProtecao.CalcularPremioFuneral(Convert.ToDecimal(ddlPlanoProtecaoFuneralMorteNovo.SelectedValue), Convert.ToDecimal(ddlPlanoProtecaoFuneralIPANovo.SelectedValue), Convert.ToDecimal(ddlPlanoProtecaoFuneralAssistenciaNovo.SelectedValue), Convert.ToInt32(ddlPlanoProtecaoFuneralCategoriaNovo.SelectedValue), FaixaBase);
         txtPlanoProtecaoFuneralPremioNovo.Text = PlanoProtecaoFuneralNovoVO.ValorPremioIdadeBase.GetValueOrDefault().ToString();
     }
 }
 private void PopularComboRenda()
 {
     cmbAba5Sub3Periodo.DataSource    = new BindingSource(ControllerPlanoProtecao.ListarTodosRendaPeriodo(true), null);
     cmbAba5Sub3Periodo.ValueMember   = "Key";
     cmbAba5Sub3Periodo.DisplayMember = "Value";
     DadosCmbAba5Sub3Periodo          = ControllerPlanoProtecao.ListarTodosRendaPeriodo(true);
     TextoCmbAba5Sub3Periodo          = string.Empty;
     lblAba5Sub3CapitalValor.Text     = String.Format(new CultureInfo("pt-BR"), "{0:C}", Decimal.Zero);
 }
Exemplo n.º 13
0
 private void VerificaPlanoProtecaoRenda()
 {
     if (ddlPlanoProtecaoRendaValorNovo.SelectedIndex > 0 && ddlPlanoProtecaoRendaPeriodoNovo.SelectedIndex > 0)
     {
         PlanoProtecaoRendaNovoVO              = ControllerPlanoProtecao.CalcularPremioRenda(ddlPlanoProtecaoRendaPeriodoNovo.SelectedItem.Text, Convert.ToDecimal(ddlPlanoProtecaoRendaValorNovo.SelectedValue), FaixaBase);
         txtPlanoProtecaoRendaPremioNovo.Text  = PlanoProtecaoRendaNovoVO.RendaValorPremioIdadeBase.GetValueOrDefault().ToString();
         txtPlanoProtecaoRendaCapitalNovo.Text = PlanoProtecaoRendaNovoVO.RendaCoberturaCapitalTotal.ToString();
     }
 }
Exemplo n.º 14
0
        private void PreencherSimuladorAbaTabelasSubRenda()
        {
            if (cmbAba5Sub5Sub4Periodo.SelectedIndex > 0 && cmbAba5Sub5Sub4Valor.SelectedIndex > 0)
            {
                TPlanoProtecaoDOMINIO registro = ControllerPlanoProtecao.CalcularPremioRenda(cmbAba5Sub5Sub4Periodo.Text, Convert.ToDecimal(cmbAba5Sub5Sub4Valor.SelectedValue), Convert.ToInt32(cmbAba5Sub5Sub1FaixaBase.SelectedValue));

                lblAba5Sub5Sub4CapitalValor.Text = String.Format(new CultureInfo("pt-BR"), "{0:C}", registro.RendaCoberturaCapitalTotal);

                lblAba5Sub5Sub4PremioRendaValor.Text = String.Format(new CultureInfo("pt-BR"), "{0:C}", registro.RendaValorPremioIdadeBase.GetValueOrDefault());;
            }
        }
Exemplo n.º 15
0
        protected void imgPlanoProtecaoAgregadosNovo_Click(object sender, ImageClickEventArgs e)
        {
            if (ddlPlanoProtecaoAgregadosGrauNovo.SelectedIndex > 0 && !string.IsNullOrEmpty(txtPlanoProtecaoAgregadosIdadeNovo.Text))
            {
                if (Convert.ToInt32(txtPlanoProtecaoAgregadosIdadeNovo.Text) <= 80)
                {
                    if ((FaixaBase >= 7) && (txtProdutoDefinido.Text.Equals(ProdutoPrincipal.PLANOSENIOR.GetStringValue())) && (Convert.ToInt32(ddlPlanoProtecaoAgregadosGrauNovo.SelectedValue) == (int)GrauParentesco.CONJUGE) && (Convert.ToInt32(txtPlanoProtecaoAgregadosIdadeNovo.Text) <= 61))
                    {
                        RequiredFieldValidator required = new RequiredFieldValidator();
                        required.ValidationGroup   = "PlanoProtecaoAgregadosNovo";
                        required.ErrorMessage      = "O titular não poderá informar o cônjuge como agregado.";
                        required.IsValid           = false;
                        required.ControlToValidate = ddlPlanoProtecaoAgregadosGrauNovo.ID;
                        ValidationSummary2.Controls.Add(required);
                    }
                    else
                    {
                        List <TAgregadoVO> ListaTemp  = ListaAgregadoVOTemp;
                        TAgregadoVO        temporario = new TAgregadoVO();
                        temporario.Identificador  = ListaTemp.Count() + 1;
                        temporario.GrauParentesco = ddlPlanoProtecaoAgregadosGrauNovo.SelectedItem.Text;
                        temporario.Idade          = Convert.ToInt32(txtPlanoProtecaoAgregadosIdadeNovo.Text);

                        if (PlanoProtecaoVO.IDPlanoProtecao > 0)
                        {
                            temporario.Premio = ControllerPlanoProtecao.CalcularPremioAgregado(Convert.ToInt32(ddlPlanoProtecaoAgregadosGrauNovo.SelectedValue), temporario.Idade, PlanoProtecaoVO.NomePlano);
                        }

                        if (PlanoCasalVO.IDPlanoCasal > 0)
                        {
                            temporario.Premio = ControllerPlanoCasal.CalcularPremioAgregado(Convert.ToInt32(ddlPlanoProtecaoAgregadosGrauNovo.SelectedValue), temporario.Idade, PlanoCasalVO.NomePlano);
                        }

                        if (PlanoSeniorVO.IDPlanoSenior > 0)
                        {
                            temporario.Premio = ControllerPlanoSenior.CalcularPremioAgregado(Convert.ToInt32(ddlPlanoProtecaoAgregadosGrauNovo.SelectedValue), temporario.Idade, PlanoSeniorVO.NomePlano);
                        }

                        ListaTemp.Add(temporario);
                        ListaAgregadoVOTemp = ListaTemp;
                        grdPlanoProtecaoAgregadosNovo.DataSource = ListaAgregadoVOTemp;
                        grdPlanoProtecaoAgregadosNovo.DataBind();

                        txtPlanoProtecaoAgregadosPremioNovo.Text        = ListaAgregadoVOTemp.Sum(registro => registro.Premio).ToString();
                        ddlPlanoProtecaoAgregadosGrauNovo.SelectedIndex = 0;
                        txtPlanoProtecaoAgregadosIdadeNovo.Text         = string.Empty;
                    }
                }
            }

            ModalPopupExtender1.Show();
        }
        private void VerificarPlanoProtecaoRenda()
        {
            if (cmbAba5Sub3Periodo.SelectedIndex > 0 && cmbAba5Sub3Valor.SelectedIndex > 0)
            {
                DadosTPlanoProtecaoRendaNovo = ControllerPlanoProtecao.CalcularPremioRenda(cmbAba5Sub3Periodo.Text, Convert.ToDecimal(cmbAba5Sub3Valor.SelectedValue), FaixaBase);
                PremioRenda                  = DadosTPlanoProtecaoRendaNovo.RendaValorPremioIdadeBase.GetValueOrDefault();
                PremioRendaCapital           = DadosTPlanoProtecaoRendaNovo.RendaCoberturaCapitalTotal;
                lblAba5Sub3CapitalValor.Text = String.Format(new CultureInfo("pt-BR"), "{0:C}", PremioRendaCapital);
            }
            else
            {
                PremioRenda                  = Decimal.Zero;
                PremioRendaCapital           = Decimal.Zero;
                lblAba5Sub3CapitalValor.Text = String.Format(new CultureInfo("pt-BR"), "{0:C}", Decimal.Zero);
            }

            PreencherCamposTotais();
        }
        private void VerificaPlanoProtecaoFuneral()
        {
            try
            {
                Decimal morte   = Convert.ToDecimal(cmbAba5Sub1APMorte.SelectedValue);
                Int32   funeral = Convert.ToInt32(cmbAba5Sub1APFuneral.SelectedValue);

                lblAba5Sub1APIPAValor.Text = String.Format(new CultureInfo("pt-BR"), "{0:C}", cmbAba5Sub1APMorte.SelectedValue);

                DadosTPlanoProtecaoNovo             = ControllerPlanoProtecao.CalcularPremioFuneral(morte, 0, 0, funeral, FaixaBase);
                PremioPlano                         = DadosTPlanoProtecaoNovo.ValorPremioIdadeBase.GetValueOrDefault();
                lblAba5Sub1PremioPlanoValor.Text    = String.Format(new CultureInfo("pt-BR"), "{0:C}", DadosTPlanoProtecaoNovo.ValorPremioIdadeBase.GetValueOrDefault());
                lblAba5Sub1PremioAgregadoValor.Text = String.Format(new CultureInfo("pt-BR"), "{0:C}", PremioAgregado);
                lblAba5Sub1PremioRendaValor.Text    = String.Format(new CultureInfo("pt-BR"), "{0:C}", PremioRenda);
                lblAba5Sub1PremioTotalValor.Text    = String.Format(new CultureInfo("pt-BR"), "{0:C}", DadosTPlanoProtecaoNovo.ValorPremioIdadeBase.GetValueOrDefault() + PremioAgregado + PremioRenda);
            }
            catch
            {
            }
        }
        private void PopularComboPlanoProtecao()
        {
            cmbAba5Sub1APMorte.DataSource    = new BindingSource(ControllerPlanoProtecao.ListarTodosMorteAcidental(false, FaixaBase), null);
            cmbAba5Sub1APMorte.ValueMember   = "Key";
            cmbAba5Sub1APMorte.DisplayMember = "Value";
            DadosCmbAba5Sub1APMorte          = ControllerPlanoProtecao.ListarTodosMorteAcidental(false, FaixaBase);
            TextoCmbAba5Sub1APMorte          = string.Empty;

            DadosCmbAba5Sub1APIPA = ControllerPlanoProtecao.ListarTodosInvalidezAcidente(false, FaixaBase);
            TextoCmbAba5Sub1APIPA = string.Empty;

            DadosCmbAba5Sub1APAssistencia = ControllerPlanoProtecao.ListarTodosAssisteciaEmergencial(false);
            TextoCmbAba5Sub1APAssistencia = string.Empty;

            cmbAba5Sub1APFuneral.DataSource    = new BindingSource(ControllerPlanoProtecao.ListarTodosFuneralCategoria(false), null);
            cmbAba5Sub1APFuneral.ValueMember   = "Key";
            cmbAba5Sub1APFuneral.DisplayMember = "Value";
            DadosCmbAba5Sub1APFuneral          = ControllerPlanoProtecao.ListarTodosFuneralCategoria(false);
            TextoCmbAba5Sub1APFuneral          = string.Empty;
        }
Exemplo n.º 19
0
        private void PopularSimuladorAbaTabelasSubAgregado()
        {
            cmbAba5Sub5Sub3Parentesco.DisplayMember = "Value";
            cmbAba5Sub5Sub3Parentesco.ValueMember   = "Key";
            bool plano = Convert.ToInt32(cmbAba5Sub5Sub1Produto.SelectedValue) == (int)ProdutoPrincipal.PLANOSENIOR;

            cmbAba5Sub5Sub3Parentesco.DataSource = ControllerEnum.ListaDeParentesco(plano, true);
            DadosCmbAba5Sub5Sub3Parentesco       = ControllerEnum.ListaDeParentesco(plano, true);
            TextoCmbAba5Sub5Sub3Parentesco       = string.Empty;

            cmbAba5Sub5Sub3Funeral.DataSource    = new BindingSource(ControllerPlanoProtecao.ListarTodosFuneralCategoria(true), null);
            cmbAba5Sub5Sub3Funeral.ValueMember   = "Key";
            cmbAba5Sub5Sub3Funeral.DisplayMember = "Value";
            DadosCmbAba5Sub5Sub3Funeral          = ControllerPlanoProtecao.ListarTodosFuneralCategoria(true);
            TextoCmbAba5Sub5Sub3Funeral          = string.Empty;

            lblAba5Sub5Sub3PremioAgregadoValor.Text = String.Format(new CultureInfo("pt-BR"), "{0:C}", Decimal.Zero);
            lstAba5Sub5Sub3Agregado.Items.Clear();
            lblAba5Sub5Sub3QuantidadeValor.Text = "0";

            txtAba5Sub5Sub3Idade.Text = string.Empty;
        }
Exemplo n.º 20
0
        protected void imgUploadPF_Click(object sender, ImageClickEventArgs e)
        {
            if (fupUploadPF.HasFile)
            {
                lblMSGUploadPF.Text = "Inicio do Processo.";

                try
                {
                    Util.Util.VerificarTamanhoArquivo(fupUploadPF.PostedFile.ContentLength);

                    if (string.IsNullOrEmpty(WebConfigurationManager.AppSettings["ExcelUPLOAD"]))
                    {
                        throw new CABTECException("O valor para chave ExcelUPLOAD não foi infomado no web.config");
                    }

                    string caminhoArquivosExcel = WebConfigurationManager.AppSettings["ExcelUPLOAD"];
                    caminhoArquivosExcel = HttpContext.Current.Server.MapPath(caminhoArquivosExcel + "\\" + fupUploadPF.FileName);

                    Util.Util.SalvarArquivo("ExcelUPLOAD", fupUploadPF);

                    ControllerPlanoProtecao.ImportarArquivo("ExcelUPLOAD", fupUploadPF.FileName);

                    lblMSGUploadPF.Text = "Processo realizado com sucesso.";
                }
                catch (CABTECException exception)
                {
                    MostrarMensagem(exception.Message);
                }
                catch (Exception ex)
                {
                    MostrarMensagem(ex.Message);
                }
                finally
                {
                    Util.Util.ExcluirArquivo("ExcelUPLOAD", fupUploadPF.FileName);
                }
            }
        }
        private void btnAba5Sub2Adicionar_Click(object sender, EventArgs e)
        {
            if (cmbAba5Sub2Parentesco.SelectedIndex > 0 && !string.IsNullOrEmpty(txtAba5Sub2Idade.Text))
            {
                if ((ProdutoCalculo == (int)ProdutoPrincipal.PLANOSENIOR) &&
                    (Convert.ToInt32(cmbAba5Sub2Parentesco.SelectedValue) == (int)GrauParentesco.CONJUGE) &&
                    (Convert.ToInt32(txtAba5Sub2Idade.Text) >= 61))
                {
                    lstAba5Sub2Dependente.Items.Add(cmbAba5Sub2Parentesco.Text + " - " + txtAba5Sub2Idade.Text);
                    lblAba5Sub2QtdDepValor.Text = lstAba5Sub2Dependente.Items.Count.ToString();
                    return;
                }
                else if ((ProdutoCalculo == (int)ProdutoPrincipal.PLANOPROTECAO) &&
                         (cmbAba5Sub2Parentesco.Text.Equals(GrauParentesco.FILHO.GetStringValue()) || cmbAba5Sub2Parentesco.Text.Equals(GrauParentesco.ENTEADO.GetStringValue())) &&
                         (Convert.ToInt32(txtAba5Sub2Idade.Text) <= 24))
                {
                    lstAba5Sub2Dependente.Items.Add(cmbAba5Sub2Parentesco.Text + " - " + txtAba5Sub2Idade.Text);
                    lblAba5Sub2QtdDepValor.Text = lstAba5Sub2Dependente.Items.Count.ToString();
                    return;
                }
                else if (Convert.ToInt32(txtAba5Sub2Idade.Text) > 80)
                {
                    Util.CaixaMensagem.ExibirOk("O titular não poderá informar um agregado maior que 80 anos.");
                    return;
                }
                else
                {
                    TAgregadoDOMINIO temporario = new TAgregadoDOMINIO();
                    temporario.GrauParentesco = cmbAba5Sub2Parentesco.Text;
                    temporario.Idade          = Convert.ToInt32(txtAba5Sub2Idade.Text);

                    switch (ProdutoCalculo)
                    {
                    case (int)ProdutoPrincipal.PLANOPROTECAO:
                        temporario.Funeral = DadosTPlanoProtecao.NomePlano;
                        temporario.Premio  = ControllerPlanoProtecao.CalcularPremioAgregado(Convert.ToInt32(cmbAba5Sub2Parentesco.SelectedValue), temporario.Idade, temporario.Funeral);
                        break;

                    case (int)ProdutoPrincipal.PLANOSENIOR:
                        temporario.Funeral = DadosTPlanoSenior.NomePlano;
                        temporario.Premio  = ControllerPlanoSenior.CalcularPremioAgregado(Convert.ToInt32(cmbAba5Sub2Parentesco.SelectedValue), temporario.Idade, temporario.Funeral);
                        break;

                    case (int)ProdutoPrincipal.PLANOCASAL:
                        temporario.Funeral = DadosTPlanoCasal.NomePlano;
                        temporario.Premio  = ControllerPlanoCasal.CalcularPremioAgregado(Convert.ToInt32(cmbAba5Sub2Parentesco.SelectedValue), temporario.Idade, temporario.Funeral);
                        break;

                    default:
                        break;
                    }

                    lstAba5Sub2Agregado.Items.Add(temporario.GrauParentesco.Trim() + " - " + temporario.Idade + " - " + String.Format(new CultureInfo("pt-BR"), "{0:C}", temporario.Premio));
                    PremioAgregadoTemp.Add(temporario.Premio);
                    PremioAgregado += temporario.Premio;
                    cmbAba5Sub2Parentesco.SelectedIndex = 0;
                    txtAba5Sub2Idade.Text = string.Empty;

                    PreencherCamposTotais();

                    lblAba5Sub2QuantidadeValor.Text = lstAba5Sub2Agregado.Items.Count.ToString();
                }
            }
        }
Exemplo n.º 22
0
        //private void cmbAba5Sub5Sub3Funeral_KeyPress(object sender, KeyPressEventArgs e)
        //{
        //    if (e.KeyChar == 42 || e.KeyChar == 9  || e.KeyChar == 13)
        //    {
        //        TextoCmbAba5Sub5Sub3Funeral = string.Empty;
        //        e.Handled = true;
        //        return;
        //    }

        //    string atual = TextoCmbAba5Sub5Sub3Funeral;

        //    if (e.KeyChar != 13)
        //        TextoCmbAba5Sub5Sub3Funeral += e.KeyChar.ToString();
        //    else
        //    {
        //        e.Handled = true; return;
        //    }

        //    Dictionary<int, string> verificaCombo = DadosCmbAba5Sub5Sub3Funeral.Where(registro => registro.Value.Contains(TextoCmbAba5Sub5Sub3Funeral)).ToDictionary(registro => registro.Key, registro => registro.Value);
        //    if (verificaCombo.Count > 0)
        //    {
        //        ((ComboBox)sender).SelectedValue = verificaCombo.FirstOrDefault().Key;
        //    }
        //    else
        //    {
        //        TextoCmbAba5Sub5Sub3Funeral = atual;
        //    }

        //    e.Handled = true;
        //}

        private void btnAba5Sub5Sub3Adicionar_Click(object sender, EventArgs e)
        {
            if (cmbAba5Sub5Sub3Parentesco.SelectedIndex > 0 && cmbAba5Sub5Sub3Funeral.SelectedIndex > 0 && !string.IsNullOrEmpty(txtAba5Sub5Sub3Idade.Text))
            {
                if ((Convert.ToInt32(cmbAba5Sub5Sub1Produto.SelectedValue) == (int)ProdutoPrincipal.PLANOSENIOR) &&
                    (Convert.ToInt32(cmbAba5Sub5Sub3Parentesco.SelectedValue) == (int)GrauParentesco.CONJUGE) &&
                    (Convert.ToInt32(txtAba5Sub5Sub3Idade.Text) >= 61))
                {
                    Util.CaixaMensagem.ExibirOk("O titular não poderá informar o cônjuge maior de 61 anos como agregado.");
                    return;
                }
                else if ((Convert.ToInt32(cmbAba5Sub5Sub1Produto.SelectedValue) == (int)ProdutoPrincipal.PLANOPROTECAO) &&
                         ((Convert.ToInt32(cmbAba5Sub5Sub3Parentesco.SelectedValue) == (int)GrauParentesco.FILHO) || (Convert.ToInt32(cmbAba5Sub5Sub3Parentesco.SelectedValue) == (int)GrauParentesco.ENTEADO)) &&
                         (Convert.ToInt32(txtAba5Sub5Sub3Idade.Text) <= 24))
                {
                    Util.CaixaMensagem.ExibirOk("O titular não poderá informar o filho/enteado menor de 25 anos como agregado.");
                    return;
                }
                else if (Convert.ToInt32(txtAba5Sub5Sub3Idade.Text) > 80)
                {
                    Util.CaixaMensagem.ExibirOk("O titular não poderá informar um agregado maior que 80 anos.");
                    return;
                }
                else
                {
                    TAgregadoDOMINIO temporario = new TAgregadoDOMINIO();
                    //PremioAgregadoTabelas = new List<decimal>();
                    temporario.GrauParentesco = cmbAba5Sub5Sub3Parentesco.Text;
                    temporario.Idade          = Convert.ToInt32(txtAba5Sub5Sub3Idade.Text);
                    temporario.Funeral        = cmbAba5Sub5Sub3Funeral.Text;
                    switch (Convert.ToInt32(cmbAba5Sub5Sub1Produto.SelectedValue))
                    {
                    case (int)ProdutoPrincipal.PLANOPROTECAO:
                        temporario.Premio           = ControllerPlanoProtecao.CalcularPremioAgregado(Convert.ToInt32(cmbAba5Sub5Sub3Parentesco.SelectedValue), temporario.Idade, temporario.Funeral);
                        cmbAba5Sub5Sub3Funeral.Text = DadosTPlanoProtecao.NomePlano;
                        break;

                    case (int)ProdutoPrincipal.PLANOSENIOR:
                        temporario.Premio           = ControllerPlanoSenior.CalcularPremioAgregado(Convert.ToInt32(cmbAba5Sub5Sub3Parentesco.SelectedValue), temporario.Idade, temporario.Funeral);
                        cmbAba5Sub5Sub3Funeral.Text = DadosTPlanoSenior.NomePlano;
                        break;

                    case (int)ProdutoPrincipal.PLANOCASAL:
                        temporario.Premio           = ControllerPlanoCasal.CalcularPremioAgregado(Convert.ToInt32(cmbAba5Sub5Sub3Parentesco.SelectedValue), temporario.Idade, temporario.Funeral);
                        cmbAba5Sub5Sub3Funeral.Text = DadosTPlanoCasal.NomePlano;
                        break;

                    default:
                        break;
                    }

                    lstAba5Sub5Sub3Agregado.Items.Add(temporario.GrauParentesco.Trim() + " - " + temporario.Idade + " - " + String.Format(new CultureInfo("pt-BR"), "{0:C}", temporario.Premio) + " - " + temporario.Funeral);
                    PremioAgregadoTabelas.Add(temporario.Premio);

                    cmbAba5Sub5Sub3Parentesco.SelectedIndex = 0;
                    txtAba5Sub5Sub3Idade.Text = string.Empty;

                    decimal valorTotal = 0;
                    foreach (decimal item in PremioAgregadoTabelas)
                    {
                        valorTotal += item;
                    }
                    lblAba5Sub5Sub3PremioAgregadoValor.Text = String.Format(new CultureInfo("pt-BR"), "{0:C}", valorTotal);

                    lblAba5Sub5Sub3QuantidadeValor.Text = lstAba5Sub5Sub3Agregado.Items.Count.ToString();

                    cmbAba5Sub5Sub3Parentesco.Focus();
                }
            }
        }
        private void PreencherDominoAbaSimuladorSubAgregados(bool alterar)
        {
            lstAba5Sub2Agregado.Items.Clear();
            lstAba5Sub2Dependente.Items.Clear();

            PremioAgregadoTemp = new List <decimal>();
            PremioAgregado     = 0;

            PopularCombosAbaSimuladorSubAgregado();

            DataTable tableAgregados = ControllerSimuladorSubAgregado.SelecioneSimuladorSubAgregado(DadosTSimuladorProduto.IDSimuladorProduto);

            if (tableAgregados.Rows.Count > 0 && !alterar)
            {
                foreach (DataRow agregadoRow in tableAgregados.Rows)
                {
                    TAgregadoDOMINIO temporario = new TAgregadoDOMINIO();
                    temporario.GrauParentesco          = agregadoRow["GrauParentesco"].ToString();
                    temporario.Idade                   = Convert.ToInt32(agregadoRow["Idade"]);
                    cmbAba5Sub2Parentesco.SelectedText = temporario.GrauParentesco;
                    switch (ProdutoCalculo)
                    {
                    case (int)ProdutoPrincipal.PLANOPROTECAO:
                        temporario.Funeral = DadosTPlanoProtecao.NomePlano;
                        temporario.Premio  = ControllerPlanoProtecao.CalcularPremioAgregado(Convert.ToInt32(cmbAba5Sub2Parentesco.SelectedValue), temporario.Idade, temporario.Funeral);
                        break;

                    case (int)ProdutoPrincipal.PLANOSENIOR:
                        temporario.Funeral = DadosTPlanoSenior.NomePlano;
                        temporario.Premio  = ControllerPlanoSenior.CalcularPremioAgregado(Convert.ToInt32(cmbAba5Sub2Parentesco.SelectedValue), temporario.Idade, temporario.Funeral);
                        break;

                    case (int)ProdutoPrincipal.PLANOCASAL:
                        temporario.Funeral = DadosTPlanoCasal.NomePlano;
                        temporario.Premio  = ControllerPlanoCasal.CalcularPremioAgregado(Convert.ToInt32(cmbAba5Sub2Parentesco.SelectedValue), temporario.Idade, temporario.Funeral);
                        break;

                    default:
                        break;
                    }

                    if ((temporario.GrauParentesco.Contains(GrauParentesco.CONJUGE.GetStringValue()) && ProdutoCalculo == (int)ProdutoPrincipal.PLANOPROTECAO && temporario.Idade <= 65) ||
                        (temporario.GrauParentesco.Contains(GrauParentesco.CONJUGE.GetStringValue()) && ProdutoCalculo == (int)ProdutoPrincipal.PLANOCASAL) ||
                        ((temporario.GrauParentesco.Contains(GrauParentesco.FILHO.GetStringValue()) || temporario.GrauParentesco.Contains(GrauParentesco.ENTEADO.GetStringValue())) && ProdutoCalculo == (int)ProdutoPrincipal.PLANOPROTECAO && temporario.Idade <= 24))
                    {
                        lstAba5Sub2Dependente.Items.Add(temporario.GrauParentesco + " - " + temporario.Idade);
                    }
                    else
                    {
                        if (!(temporario.GrauParentesco.Contains(GrauParentesco.CONJUGE.GetStringValue()) && ProdutoCalculo == (int)ProdutoPrincipal.PLANOPROTECAO && temporario.Idade > 65) &&
                            !(temporario.GrauParentesco.Contains(GrauParentesco.CONJUGE.GetStringValue()) && ProdutoCalculo == (int)ProdutoPrincipal.PLANOSENIOR && temporario.Idade >= 61) &&
                            (temporario.Idade <= 80))
                        {
                            lstAba5Sub2Agregado.Items.Add(temporario.GrauParentesco + " - " + temporario.Idade + " - " + String.Format(new CultureInfo("pt-BR"), "{0:C}", temporario.Premio));
                            PremioAgregadoTemp.Add(temporario.Premio);
                            PremioAgregado += temporario.Premio;
                        }
                    }
                }
            }
            else
            {
                foreach (String agregadoPergunta in lstAba2Sub1Parentes.Items)
                {
                    String[] separacao = agregadoPergunta.Split('-');

                    if (separacao.Length > 2)
                    {
                        TAgregadoDOMINIO temporario = new TAgregadoDOMINIO();
                        temporario.GrauParentesco          = separacao[0];
                        temporario.Idade                   = Convert.ToInt32(separacao[1]);
                        cmbAba5Sub2Parentesco.SelectedText = temporario.GrauParentesco;

                        if (!temporario.GrauParentesco.Contains(GrauParentesco.AVOM.GetStringValue()) &&
                            !temporario.GrauParentesco.Contains(GrauParentesco.AVOF.GetStringValue()) &&
                            !temporario.GrauParentesco.Contains(GrauParentesco.OUTRO.GetStringValue()))
                        {
                            switch (ProdutoCalculo)
                            {
                            case (int)ProdutoPrincipal.PLANOPROTECAO:
                                temporario.Funeral = DadosTPlanoProtecao.NomePlano;
                                temporario.Premio  = ControllerPlanoProtecao.CalcularPremioAgregado(Convert.ToInt32(cmbAba5Sub2Parentesco.SelectedValue), temporario.Idade, DadosTPlanoProtecao.NomePlano);
                                break;

                            case (int)ProdutoPrincipal.PLANOSENIOR:
                                temporario.Funeral = DadosTPlanoSenior.NomePlano;
                                temporario.Premio  = ControllerPlanoSenior.CalcularPremioAgregado(Convert.ToInt32(cmbAba5Sub2Parentesco.SelectedValue), temporario.Idade, DadosTPlanoSenior.NomePlano);
                                break;

                            case (int)ProdutoPrincipal.PLANOCASAL:
                                temporario.Funeral = DadosTPlanoCasal.NomePlano;
                                temporario.Premio  = ControllerPlanoCasal.CalcularPremioAgregado(Convert.ToInt32(cmbAba5Sub2Parentesco.SelectedValue), temporario.Idade, DadosTPlanoCasal.NomePlano);
                                break;

                            default:
                                break;
                            }


                            if ((temporario.GrauParentesco.Contains(GrauParentesco.CONJUGE.GetStringValue()) && ProdutoCalculo == (int)ProdutoPrincipal.PLANOPROTECAO && temporario.Idade <= 65) ||
                                (temporario.GrauParentesco.Contains(GrauParentesco.CONJUGE.GetStringValue()) && ProdutoCalculo == (int)ProdutoPrincipal.PLANOCASAL) ||
                                ((temporario.GrauParentesco.Contains(GrauParentesco.FILHO.GetStringValue()) || temporario.GrauParentesco.Contains(GrauParentesco.ENTEADO.GetStringValue())) && ProdutoCalculo == (int)ProdutoPrincipal.PLANOPROTECAO && temporario.Idade <= 24))
                            {
                                lstAba5Sub2Dependente.Items.Add(temporario.GrauParentesco + " - " + temporario.Idade);
                            }
                            else
                            {
                                if (!(temporario.GrauParentesco.Contains(GrauParentesco.CONJUGE.GetStringValue()) && ProdutoCalculo == (int)ProdutoPrincipal.PLANOPROTECAO && temporario.Idade > 65) &&
                                    !(temporario.GrauParentesco.Contains(GrauParentesco.CONJUGE.GetStringValue()) && ProdutoCalculo == (int)ProdutoPrincipal.PLANOSENIOR && temporario.Idade >= 61) &&
                                    (temporario.Idade <= 80))
                                {
                                    lstAba5Sub2Agregado.Items.Add(temporario.GrauParentesco + " - " + temporario.Idade + " - " + String.Format(new CultureInfo("pt-BR"), "{0:C}", temporario.Premio));
                                    PremioAgregadoTemp.Add(temporario.Premio);
                                    PremioAgregado += temporario.Premio;
                                }
                            }
                        }
                    }
                }
            }

            lblAba5Sub2QuantidadeValor.Text = lstAba5Sub2Agregado.Items.Count.ToString();
            lblAba5Sub2QtdDepValor.Text     = lstAba5Sub2Dependente.Items.Count.ToString();
        }