예제 #1
0
        public void UpdateTSegCliente(TSeg_Clientes tSegCliente)
        {
            TSeg_Clientes clientes = _context.TSeg_Clientes.Where(x => x.id == tSegCliente.id).FirstOrDefault();

            clientes.nombres   = tSegCliente.nombres;
            clientes.apellidos = tSegCliente.apellidos;
            clientes.direccion = tSegCliente.direccion;
            clientes.telefono  = tSegCliente.telefono;
            _context.SaveChanges();
        }
예제 #2
0
        public static List <CustomerPolicyResponse> getPolicies(TSeg_Clientes cliente)
        {
            List <CustomerPolicyResponse> list = new List <CustomerPolicyResponse>();

            foreach (TSeg_Clientes_Polizas p in cliente.TSeg_Clientes_Polizas)
            {
                list.Add(CustomerPolicyMapper.TransformTSegClientePolizaToCustomerPolicyResponse(p));
            }
            return(list);
        }
 public long DeleteCustomer(long customerId)
 {
     try {
         TSeg_Clientes tSegCustomer = CustomerDomainService.ReadCustomerById(customerId);
         return(CustomerDomainService.DeleteCustomer(tSegCustomer));
     }
     catch
     {
         return(-1);
     }
 }
 public CustomerResponse CreateCustomer(CustomerRequest customerRequest)
 {
     try
     {
         TSeg_Clientes customer    = CustomerMapper.TransformCustomerRequestToTSegCliente(customerRequest);
         TSeg_Clientes customerOut = CustomerDomainService.CreateCustomer(customer);
         return(customerOut != null?CustomerMapper.TransformTSegClienteToCustomerResponse(customerOut) : null);
     }
     catch
     {
         return(new CustomerResponse());
     }
 }
예제 #5
0
 public TSeg_Clientes CreateTSegCliente(TSeg_Clientes tSegCliente)
 {
     try
     {
         _context.TSeg_Clientes.Add(tSegCliente);
         _context.SaveChanges();
         return(tSegCliente);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #6
0
 public static CustomerResponse TransformTSegClienteToCustomerResponse(TSeg_Clientes customer)
 {
     return(new CustomerResponse
     {
         nombres = customer.nombres,
         apellidos = customer.apellidos,
         telefono = customer.telefono,
         direccion = customer.direccion,
         tipo_identificacion = customer.tipo_identificacion,
         identificacion = customer.identificacion,
         id = customer.id,
         policiesDetails = getPolicies(customer)
     });
 }
        public List <TSeg_Clientes> getTSegClienteList()
        {
            List <TSeg_Clientes> list = new List <TSeg_Clientes>();
            TSeg_Clientes        p    = new TSeg_Clientes
            {
                id                  = 1,
                nombres             = "Juan David",
                apellidos           = "Rengifo",
                telefono            = "1234546",
                direccion           = "Carrera 1",
                tipo_identificacion = "CC",
                identificacion      = "12335454"
            };

            list.Add(p);
            return(list);
        }
예제 #8
0
 public long DeleteCustomer(TSeg_Clientes customer)
 {
     CustomerRepository.DeleteTSegCliente(customer);
     return(customer.id);
 }
예제 #9
0
 public TSeg_Clientes CreateCustomer(TSeg_Clientes customer)
 {
     return(CustomerRepository.CreateTSegCliente(customer));
 }
        public CustomerResponse ReadCustomerById(long id)
        {
            TSeg_Clientes customer = CustomerDomainService.ReadCustomerById(id);

            return(customer != null?CustomerMapper.TransformTSegClienteToCustomerResponse(customer) : null);
        }
예제 #11
0
        public TSeg_Clientes ReadTSegClienteById(long id)
        {
            TSeg_Clientes cliente = _context.TSeg_Clientes.Where(x => x.id == id).FirstOrDefault();

            return(cliente);
        }
예제 #12
0
 public void DeleteTSegCliente(TSeg_Clientes tSegCliente)
 {
     _context.TSeg_Clientes.Remove(tSegCliente);
     _context.SaveChanges();
 }