public ActionResult CrearPropuesta()
        {
            var model = new PropuestaSolucionViewModel
            {
                Productos     = ObtenerProductos().OrderBy(x => x.Value),
                PlanProductos = ObtenerPlanProducto(0),
            };

            return(View(model));
        }
        public ActionResult CrearPropuesta(PropuestaSolucionViewModel model)
        {
            var propuesta = new PropuestaSolucion
            {
                Cod_Pros    = model.CodigoProspecto,
                Fec_Nac     = Convert.ToDateTime(model.FechaNacimiento),
                Cod_Prod    = model.CodigoProducto,
                Cod_Plan    = model.CodigoPlan,
                Ss_Mon_Aseg = model.MontoAsegurado.GetValueOrDefault(),
                Ss_Mon_Ret  = model.MontoRetorno.GetValueOrDefault(),
                Ss_Mon_Prim = model.MontoPrima.GetValueOrDefault(),
                Fec_Crea    = DateTime.Now,
                DetallePropuestaSolucion = model.Detalle
            };

            new PropuestaSolucionBusiness().RegistrarPropuestaSolucion(propuesta);
            return(Json(Url.Action("Index", "PropuestaSolucion")));
        }
        public ActionResult EditarPropuesta(int id)
        {
            var propuesta = new PropuestaSolucionBusiness().ObtenerPropuestaSolucion(id);

            var model = new PropuestaSolucionViewModel
            {
                Codigo            = id,
                DNIProspecto      = propuesta.Prospecto.Num_DNI,
                NombreProspecto   = propuesta.Prospecto.Txt_Pros,
                ApellidoProspecto = propuesta.Prospecto.Txt_Ape_Pat + " " + propuesta.Prospecto.Txt_Ape_Mat,
                FechaNacimiento   = propuesta.Fec_Nac.GetDate(),
                Productos         = BuscarProducto(propuesta.Cod_Prod),
                PlanProductos     = ObtenerPlanProducto(propuesta.Cod_Plan),
                MontoAsegurado    = propuesta.Ss_Mon_Aseg,
                MontoRetorno      = propuesta.Ss_Mon_Ret,
                MontoPrima        = propuesta.Ss_Mon_Prim,
                Detalle           = propuesta.DetallePropuestaSolucion.ToList()
            };

            return(View(model));
        }