private void RecalcularDigitosCliente() { //RECALCULO DVH Y DVV DE LA TABLA CLIENTE BLL.Cliente cliente_BLL = new BLL.Cliente(); BE.Cliente cliente_BE = new BE.Cliente(); List <BE.Cliente> lista_cliente = new List <BE.Cliente>(); lista_cliente = cliente_BLL.SelectAll(); string cadena = ""; foreach (BE.Cliente item in lista_cliente) { cadena = item.activo.ToString() + item.nombre.ToString() + item.apellido.ToString() + item.documento.ToString() + item.telefono.ToString() + item.email.ToString(); int valorDVH = UTILITIES.DigitoVerificador.ObtenerDVH(cadena); cliente_BLL.UpdateDVH(valorDVH, item.id_cliente); } BLL.DigitoVerificador.CalcularDVV("Cliente"); }
public void ActualizarGrilla() { dataGridView1.DataSource = null; dataGridView1.DataSource = cliente_BLL.SelectAll(); }
private void ObtenerDatos() { //CARGA DE FECHAS dtpIngreso.Text = this.reserva_seleccionada.Cells[7].Value.ToString(); dtpSalida.Text = this.reserva_seleccionada.Cells[8].Value.ToString(); //CARGA DE CLIENTES List <BE.Cliente> clientes = new List <BE.Cliente>(); clientes = cliente_BLL.SelectAll(); cmb_Cliente.Items.Add("Seleccionar"); string clienteDeLaReserva = ""; foreach (BE.Cliente cliente in clientes) { cmb_Cliente.Items.Add(cliente.id_cliente + " " + cliente.nombre + " " + cliente.apellido); if (cliente.id_cliente == (int)this.reserva_seleccionada.Cells[2].Value) { clienteDeLaReserva = cliente.id_cliente + " " + cliente.nombre + " " + cliente.apellido; } } cmb_Cliente.Text = clienteDeLaReserva; //CARGA DE HABITACIONES clb_habitaciones.Enabled = true; List <BE.Habitacion> habitaciones = new List <BE.Habitacion>(); habitaciones = habitacion_BLL.SelectAll(); foreach (BE.Habitacion habitacion in habitaciones) { clb_habitaciones.Items.Add(habitacion.id_habitacion + " " + habitacion.tipo_habitacion + " " + habitacion.descripcion); if (habitacion.id_habitacion == (int)this.reserva_seleccionada.Cells[3].Value) { clb_habitaciones.SetItemCheckState(clb_habitaciones.Items.Count - 1, CheckState.Checked); } } clb_habitaciones.CheckOnClick = true; //CARGA DE SERVICIOS ADICIONALES servicios = servicio_BLL.SelectAll(); serviciosReserva_lista = ServicioReserva_BLL.GetServicioReserva((int)this.reserva_seleccionada.Cells[0].Value); foreach (BE.ServAdicional servicio in servicios) { clb_servicios.Items.Add(servicio.id_servicio + " " + servicio.descripcion); foreach (BE.ServAdicional servicioReserva in serviciosReserva_lista) { if (servicio.id_servicio == servicioReserva.id_servicio) { clb_servicios.SetItemCheckState(clb_servicios.Items.Count - 1, CheckState.Checked); } } } clb_servicios.CheckOnClick = true; //CARGA DE HUESPEDES huespedes = huesped_BLL.GetHuespedReserva((int)this.reserva_seleccionada.Cells[0].Value); foreach (BE.Huesped huesped in huespedes) { dataGridView1.Rows.Add(huesped.id_huesped, huesped.id_reserva, huesped.nombre, huesped.apellido, huesped.documento, huesped.telefono, huesped.email); } }