private void button2_Click(object sender, EventArgs e) { remitoNegocio negocio = new remitoNegocio(); negocio.modificarRemito((Remito)dgvRemitos.CurrentRow.DataBoundItem); cargarGrilla(); }
private void cargarGrilla() { remitoNegocio negocio = new remitoNegocio(); try { listaremitoslocal = negocio.listarRemitos(clientelocal); dgvRemitos.DataSource = listaremitoslocal; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void btnGuardar_Click(object sender, EventArgs e) { if (listaDetalles.Count == 0) { MessageBox.Show("Debes ingresar al menos un producto"); return; } if (txtnumeroRemito.Text.Trim() == "" || cboCliente.Text.Trim() == "") { MessageBox.Show("Debes completar todos los campos"); return; } remitoNegocio negocio = new remitoNegocio(); detalleNegocio negociodetalle = new detalleNegocio(); tratamientoNegocio negociotratamiento = new tratamientoNegocio(); try { if (remitoLocal == null) { remitoLocal = new Remito(); remitoLocal.fecha = dtpRemito.Value; remitoLocal.numeroRemito = txtnumeroRemito.Text; remitoLocal.cliente = (Cliente)cboCliente.SelectedItem; remitoLocal.estado = "No facturado"; remitoLocal.activo = true; } negocio.agregarRemito(remitoLocal); foreach (Detalle item in listaDetalles) { if (item.numeroCertificado == null) { negociodetalle.agregarDetalles(item, txtnumeroRemito.Text); } if (item.numeroCertificado != null) { negociodetalle.agregarDetalles(item, txtnumeroRemito.Text, item.numeroCertificado); negociotratamiento.modificarCertificado(item.numeroCertificado, item.cantidadVendida); } } this.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void cargarGrilla() { remitoNegocio negocio = new remitoNegocio(); try { listaRemitosLocal = negocio.listarRemitos(); dgvRemitos.DataSource = listaRemitosLocal; dgvRemitos.Columns[0].Visible = false; dgvRemitos.Columns[5].Visible = false; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void button1_Click(object sender, EventArgs e) { if (listaRemitos.Count == 0) { MessageBox.Show("Debes ingresar al menos un remito"); return; } facturaventaNegocio negocio = new facturaventaNegocio(); remitoNegocio negocio2 = new remitoNegocio(); try { if (facturaLocal == null) { facturaLocal = new facturaVenta(); facturaLocal.fechaFactura = dtpFactura.Value; facturaLocal.numeroFactura = txtnumeroFactura.Text; facturaLocal.cliente = (Cliente)cboCliente.SelectedItem; facturaLocal.importeBruto = decimal.Parse(txtimporteGravado.Text); facturaLocal.importeIVA = decimal.Parse(txtIVA21.Text); facturaLocal.importenoGravado = decimal.Parse(txtimportenoGravado.Text); facturaLocal.importeNeto = decimal.Parse(txttotalFactura.Text); facturaLocal.tipoComprobante = "Factura A"; facturaLocal.estado = "Impago"; facturaLocal.activo = true; facturaLocal.condicionPago = int.Parse(cboCondicion.Text); } negocio.agregarFactura(facturaLocal); //foreach(Remito item in listaRemitos) //{ negocio2.modificarRemitos(listaRemitos[0], facturaLocal.numeroFactura, "Facturado"); //} this.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }