Example #1
0
        public PropuestaSolucion RegistrarPropuestaSolucion(PropuestaSolucion propuesta)
        {
            try
            {
                var newPropuesta = _db.PropuestaSolucion.Add(propuesta);
                _db.SaveChanges();

                return(newPropuesta);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        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")));
        }