private void button1_Click(object sender, EventArgs e) { conectionDataBase con = new conectionDataBase(); DataTable dt = null; try { int valueLegajo = -1, tipo = -1, sucursal = -1, nroSucursal = -1; int[] value = { 1, 13, 3, 50, 54, 110, 200, 350, 370, 380, 390 }; if (!this.txtLegajo.Text.Equals("")) { valueLegajo = int.Parse(txtLegajo.Text); } tipo = comboBox1.SelectedIndex; sucursal = cmbSucursales.SelectedIndex; for (int i = 0; i < value.Length; i++) { if (sucursal == i) { nroSucursal = value[i]; } } dt = con.UserDataConnections(this.txtNombreApellido.Text, valueLegajo, tipo, nroSucursal); } catch (Exception) { MessageBox.Show("Ha ingresado un legajo no valido!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); this.txtLegajo.Text = ""; this.txtLegajo.Focus(); return; } if (dt == null) { MessageBox.Show("Error, no se encuentra nada de lo solicitado!"); this.dataGridView1.DataSource = null; } else { this.dataGridView1.DataSource = dt; } this.txtLegajo.Text = ""; this.txtNombreApellido.Text = ""; this.comboBox1.SelectedIndex = -1; this.cmbSucursales.SelectedIndex = -1; this.txtNombreApellido.Focus(); }
private void btnBuscar_Click(object sender, EventArgs e) { int legajoCashier, nroPV, nroTicket; legajoCashier = nroPV = nroTicket = 0; conectionDataBase conecDB = new conectionDataBase(); try { if (!this.txtNroTicket.Text.Equals("")) { nroTicket = int.Parse(this.txtNroTicket.Text); } if (!this.txtNroPV.Text.Equals("")) { nroPV = int.Parse(this.txtNroPV.Text); } } catch (System.FormatException) { nroTicket = -1; nroPV = -1; } DataTable dt = new DataTable(); dt = conecDB.ReportsCashierDataConnections(nroPV, nroTicket); DataTable dt2 = new DataTable(); dt2 = conecDB.ReportCashierCreditDataConnections(int.Parse(this.txtNroPV.Text)); dgvReportVenta.DataSource = dt; dgvFormaPago.DataSource = dt2; }
private void button2_Click(object sender, EventArgs e) { conectionDataBase conection = new conectionDataBase(); MessageBox.Show("" + conection.getDataBaseCliente(int.Parse(txtDNI.Text))); }