public ActionResult Contratar(CotizacionModel cotizacionModel)
        {
            Persona Persona = PersonaNegocio.BuscarPorDNI(cotizacionModel.DNI);

            if (Persona == null)
            {
                Persona = new Persona();
                Persona.Nombres = cotizacionModel.Nombres;
                Persona.Apellidos = cotizacionModel.Apellidos;
                Persona.NumeroDocumento = cotizacionModel.DNI;
                Persona.FechaNacimiento = cotizacionModel.FechaNacimiento;
                Persona.UsuarioRegistro = new Usuario() { Id = Convert.ToInt32(User.Identity.Name) };
                Persona.FechaRegistro = DateTime.Now;
                Persona = PersonaNegocio.Insertar(Persona);
            }

            Cotizacion Cotizacion = new Cotizacion()
            {
                NumeroCotizacion = "123456",
                Persona = Persona,
                Producto = new Producto(),
                Plan = new Plan(),
                UsuarioCotiza = new Usuario(),
                UsuarioRegistro = new Usuario(),
                FechaCotiza = DateTime.Now,
                FechaRegistro = DateTime.Now
            };

            CotizacionNegocio.Insertar(Cotizacion);

            return View("Registrar", cotizacionModel);
        }
Exemple #2
0
 public bool Eliminar(Cotizacion entity)
 {
     throw new NotImplementedException();
 }
Exemple #3
0
 public Cotizacion Insertar(Cotizacion cotizacion)
 {
     return CotizacionRepo.Insertar(cotizacion);
 }
Exemple #4
0
 public Cotizacion Actualizar(Cotizacion entity)
 {
     throw new NotImplementedException();
 }