private void cargarClientes()
 {
     cmbClientes.DataSource    = GestionCliente.list();
     cmbClientes.DisplayMember = "CLI_DNI";
     cmbClientes.ValueMember   = "CLI_DNI";
     cmbClientes.SelectedIndex = -1;
 }
Beispiel #2
0
 public static GestionCliente GetInstance()
 {
     if (_instance == null)
     {
         _instance = new GestionCliente();
     }
     return(_instance);
 }
        private void cargarClientes()
        {
            cmbClientes.DataSource    = GestionCliente.list();
            cmbClientes.DisplayMember = "apellidoYnombre"; // valor a mostrar
            cmbClientes.ValueMember   = "CLI_DNI";
            cmbClientes.SelectedIndex = -1;

            cmbClientesFecha.DataSource    = GestionCliente.list();
            cmbClientesFecha.DisplayMember = "apellidoYnombre";
            cmbClientesFecha.ValueMember   = "CLI_DNI";
        }
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     if (txtBusqueda.Text != "")
     {
         dgwClientes.DataSource = GestionCliente.buscar_Cliente(txtBusqueda.Text);
     }
     else
     {
         cargar_Clientes();
     }
 }
 private void btnOrdenar_Click(object sender, EventArgs e)
 {
     if (orden)
     {
         dgwClientes.DataSource = GestionCliente.ordenar_Clientes().Tables[0];
         dgwClientes.Refresh();
     }
     else
     {
         cargar_Clientes();
     }
     orden = !orden;
 }
        private void button4_Click(object sender, EventArgs e)
        {
            DialogResult opcion;

            opcion = MessageBox.Show("¿Desea eliminar al cliente: " + this.cliente.Cli_Apellido + ", " + this.cliente.Cli_Nombre + " ?", "Eliminar cliente", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
            if (opcion.Equals(DialogResult.Yes))
            {
                if (GestionCliente.devolverTienePrestamo(Convert.ToInt32(this.cliente.Cli_Dni)) > 0)
                {
                    MessageBox.Show("No se puede eliminar el cliente porque tiene préstamo asignado", "Eliminar cliente", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    GestionCliente.delete_Cliente(cliente);
                    MessageBox.Show("Cliente eliminado con éxito", "Eliminar cliente", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    cargar_Clientes();
                }
            }
        }
 private void cargarClientes()
 {
     cmbClientes.DataSource    = GestionCliente.list();
     cmbClientes.DisplayMember = "detalle"; // valor a mostrar
     cmbClientes.ValueMember   = "CLI_DNI";
 }
 private void finish()
 {
     _ucGestionCliente = GestionCliente.GetInstance();
     _ucGestionCliente.LoadClientes();
     this.Close();
 }
 private void modificar_Cliente()
 {
     GestionCliente.update_Cliente(this.cliente);
     MessageBox.Show("Cliente modificado con éxito", "Modificar cliente", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }
 private void agregar_Cliente()
 {
     GestionCliente.insert_Cliente(this.cliente);
     MessageBox.Show("Cliente agregado con éxito", "Agregar cliente", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }
 private bool validar_Cliente()
 {
     return(GestionCliente.validar_Cliente(cliente).Rows.Count == 0);
 }
 public void cargar_Clientes()
 {
     dgwClientes.DataSource = GestionCliente.list_Clientes();
 }
        private void btnClientes_Click(object sender, RoutedEventArgs e)
        {
            GestionCliente gestionCliente = GestionCliente.GetInstance();

            OpenInPanel(gestionCliente);
        }