예제 #1
0
        public Afiliacion ActualizarAfiliacion(Afiliacion afiliacion)
        {
            try
            {
                var afil = new Afiliacion()
                {
                    IdAfiliacion = -1
                };

                using (AfiliacionesSkEntities = new AfiliacionesSkandiaEntities())
                {
                    var afilAct = AfiliacionesSkEntities.Afiliacion.FirstOrDefault(x => x.IdAfiliacion == afiliacion.IdAfiliacion);
                    afilAct.EstadoAfiliacion = afiliacion.EstadoAfiliacion;
                    AfiliacionesSkEntities.SaveChanges();
                }

                afil = this.ObtenerAfiliacionPorIdAfiliacion(afiliacion.IdAfiliacion);

                return(afil);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
예제 #2
0
 public Evaluacion ObtenerClientePorIdEvaluacion(int idEvaluacion)
 {
     try
     {
         using (AfiliacionesSkEntities = new AfiliacionesSkandiaEntities())
         {
             return(AfiliacionesSkEntities.Evaluacion.FirstOrDefault(x => x.IdEvaluacion == idEvaluacion));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
예제 #3
0
 public Evaluacion ObtenerEvaluacion(string tipoDocumento, string numeroDocumento)
 {
     try
     {
         using (AfiliacionesSkEntities = new AfiliacionesSkandiaEntities())
         {
             return(AfiliacionesSkEntities.Evaluacion.FirstOrDefault(x => x.identificationType == tipoDocumento && x.identificationNumber == numeroDocumento));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
예제 #4
0
 public Cliente ObtenerClientePorIdCliente(int idCliente)
 {
     try
     {
         using (AfiliacionesSkEntities = new AfiliacionesSkandiaEntities())
         {
             return(AfiliacionesSkEntities.Cliente.FirstOrDefault(x => x.IdCliente == idCliente));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
예제 #5
0
 public Cliente ObtenerClientePorDocumento(string tipoDocumento, string numeroDocumento)
 {
     try
     {
         using (AfiliacionesSkEntities = new AfiliacionesSkandiaEntities())
         {
             return(AfiliacionesSkEntities.Cliente.FirstOrDefault(x => x.TipoDocumento == tipoDocumento && x.NumeroDocumento.ToUpper() == numeroDocumento.ToUpper()));
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
예제 #6
0
 public List <Afiliacion> ObtenerAfiliaciones()
 {
     try
     {
         using (AfiliacionesSkEntities = new AfiliacionesSkandiaEntities())
         {
             return(AfiliacionesSkEntities.Afiliacion.ToList());
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
예제 #7
0
        public Cliente CrearCliente(Cliente cliente)
        {
            try
            {
                using (AfiliacionesSkEntities = new AfiliacionesSkandiaEntities())
                {
                    AfiliacionesSkEntities.Cliente.Add(cliente);
                    AfiliacionesSkEntities.SaveChanges();
                }

                return(this.ObtenerClientePorDocumento(cliente.TipoDocumento, cliente.NumeroDocumento));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
예제 #8
0
        public Afiliacion CrearAfiliacion(Afiliacion afiliacion)
        {
            try
            {
                var afil = new Afiliacion()
                {
                    IdAfiliacion = -1
                };
                using (AfiliacionesSkEntities = new AfiliacionesSkandiaEntities())
                {
                    AfiliacionesSkEntities.Afiliacion.Add(afiliacion);
                    AfiliacionesSkEntities.SaveChanges();
                }

                return(this.ObtenerAfiliacionPorIdAfiliacion(afiliacion.IdAfiliacion));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
예제 #9
0
        public Cliente ActualizarCliente(Cliente cliente)
        {
            try
            {
                var cli = new Cliente()
                {
                    IdCliente = -1
                };

                using (AfiliacionesSkEntities = new AfiliacionesSkandiaEntities())
                {
                    cli = AfiliacionesSkEntities.Cliente.FirstOrDefault(x => x.IdCliente == cliente.IdCliente);
                    cli.ApellidosCliente       = cliente.ApellidosCliente;
                    cli.CiudadResidencia       = cliente.CiudadResidencia;
                    cli.DepartamentoResidencia = cliente.DepartamentoResidencia;
                    cli.DireccionResidencia    = cliente.DireccionResidencia;
                    cli.Discapacidad           = cliente.Discapacidad;
                    cli.Egresos         = cliente.Egresos;
                    cli.Email           = cliente.Email;
                    cli.EstadoCivil     = cliente.EstadoCivil;
                    cli.FechaNacimiento = cliente.FechaNacimiento;
                    cli.Genero          = cliente.Genero;
                    cli.Ingresos        = cliente.Ingresos;
                    cli.LugarNacimiento = cliente.LugarNacimiento;
                    cli.Movil           = cliente.Movil;
                    cli.NombresCliente  = cliente.NombresCliente;
                    cli.NumeroDocumento = cliente.NumeroDocumento;
                    cli.TipoDocumento   = cliente.TipoDocumento;

                    AfiliacionesSkEntities.SaveChanges();
                }

                return(this.ObtenerClientePorIdCliente(cliente.IdCliente));
            }
            catch (Exception ex)
            {
                throw;
            }
        }