Ejemplo n.º 1
0
        public ActionResult Remover(AcrescimoMeioTransporte acrescimoMeioTransporte)
        {
            var dao = new AcrescimoMeioTransporteDAO();

            dao.Remover(acrescimoMeioTransporte);
            return(RedirectToAction("Listar"));
        }
Ejemplo n.º 2
0
        public ActionResult Remover(int id)
        {
            var dao = new AcrescimoMeioTransporteDAO();
            AcrescimoMeioTransporte acrescimo = dao.BuscarPorId(id);

            return(View(acrescimo));
        }
Ejemplo n.º 3
0
        public ActionResult Listar()
        {
            var dao       = new AcrescimoMeioTransporteDAO();
            var acrescimo = dao.Lista();

            return(View(acrescimo));
        }
Ejemplo n.º 4
0
        public void CalculaValorSeguradora(Seguradora seguradora, Cotacao cotacao)
        {
            var acrescimoTipoViagem = new AcrescimoTipoViagemDAO().ObterPorTipoViagem(seguradora.SegId, cotacao.TipoViagem); // passando como parâmetro os valores da tabela seguradora.SegId e tabela cotacao.TipoViagem

            double acrescimo1 = 0, acrescimo2 = 0, acrescimo3 = 0;

            var ValorDias   = seguradora.ValorPorDia * cotacao.QtdeDias;         // Valor por dia * qntide de dias que o usuário vai ficar
            var ValorPessoa = seguradora.ValorPorPessoa * cotacao.QtdeViajantes; // Valor por pessoa * qntde de Viajantes
            var Comissao    = (seguradora.Comissao / 100) + 1;
            var ValorFinal  = ValorDias + ValorPessoa;

            if (acrescimoTipoViagem != null)
            {
                acrescimo1 = ValorFinal * ((acrescimoTipoViagem.AcrescimoViagem / 100) + 1);  //
            }


            var acrescimoMeioTransporte = new AcrescimoMeioTransporteDAO().ObterPorMeioTransporte(seguradora.SegId, cotacao.MeioTransporte);

            if (acrescimoMeioTransporte != null)
            {
                acrescimo2 = ValorFinal * ((acrescimoMeioTransporte.AcrescimoTransporte / 100) + 1);
            }

            var acrescimoMotivoViagem = new AcrescimoMotivoViagemDAO().OberPorMotivoViagem(seguradora.SegId, cotacao.MotivoViagem);

            if (acrescimoMotivoViagem != null)
            {
                acrescimo3 = ValorFinal * ((acrescimoMotivoViagem.AcrescimoMotivo / 100) + 1);
            }

            seguradora.Valor  = (acrescimo1 + acrescimo2 + acrescimo3) * Comissao;
            seguradora.CotdId = cotacao.CotId;
        }
Ejemplo n.º 5
0
 public ActionResult Atualizar(AcrescimoMeioTransporte acrescimoMeioTransporte)
 {
     if (ModelState.IsValid)
     {
         var dao = new AcrescimoMeioTransporteDAO();
         dao.Atualizar(acrescimoMeioTransporte);
         return(RedirectToAction("Listar"));
     }
     return(View("Atualizar"));
 }