private void txtBarCodeArticulo_TextChanged(object sender, EventArgs e) { String barcode = txtBarCodeArticulo.Text; //ClienteNEG bl = new ClienteNEG(); Articulo a = ArticuloNEG.Instancia().ObtenerArticulo(barcode); txtNombreArticulo.Text = a.Nombre; codigoArticuloSeleccionado = a.idArticulo; //DetalleIngresoAlmacen d = new DetalleIngresoAlmacen(); //int stockFinal = IngresoAlmacenNEG.ObtenerStockActual(Convert.ToInt32(row.Cells["idArticulo"].Value)); //DetalleStockTienda dStockFinal = StockTiendaNEG.Instancia().ObtenerStockActual(codigoArticuloSeleccionado); //txtStockActual.Text = dStockFinal.StockFinal.ToString(); DetalleIngresoAlmacen dStockFinal = IngresoAlmacenNEG.Instancia().ObtenerStockActual(codigoArticuloSeleccionado); txtStockActual.Text = dStockFinal.CantidadFinal.ToString(); DetalleIngresoAlmacen dPrecioActual = DetalleIngresoNEG.Instancia().obtenerPrecioVenta(codigoArticuloSeleccionado); txtPrecio.Text = dPrecioActual.PrecioVenta.ToString(); //Cerrando el formulario }
private void btnBuscar_Click(object sender, EventArgs e) { IngresoAlmacen c = new IngresoAlmacen(); //c.Correlativo = txtCorrelativo_buscar.Text; //c.NroDocumento = txtNro_busqueda.Text; dgvIngresosAlmacen.DataSource = IngresoAlmacenNEG.Instancia().listarIngresos(); }
private void btnBuscar_Click(object sender, EventArgs e) { dgvReporteStockAlmacen.DataSource = IngresoAlmacenNEG.Instancia().reporteStockAlmacen(); }
private void btnRegistrar_Click(object sender, EventArgs e) { if (this.codigoProveedorSeleccionado == -1) { this.mError("No ha seleccionado aún ningun Proveedor"); } else { IngresoAlmacen c = new IngresoAlmacen(); c.idTipoComprobante = cboTipoComprobante.SelectedIndex + 1; c.FechaIngreso = dtpIngresoAlmacen.Value; c.idProveedor = codigoProveedorSeleccionado; c.Serie = txtSerie.Text; c.NroDocumento = txtCorrelativo.Text; c.TotalPagado = totalInvertido; c.igv = igv; c.idUsuario = idUsuario; //c.numero = Convert.ToInt32(txtNumero.Text); c.subTotal = sub; if (radActivo.Enabled == true) { c.Estado = true; } else if (radInactivo.Enabled == true) { c.Estado = false; } foreach (DataGridViewRow row in dgvDetalle.Rows) { DetalleIngresoAlmacen d = new DetalleIngresoAlmacen(); //int stockFinal = IngresoAlmacenNEG.ObtenerStockActual(Convert.ToInt32(row.Cells["idArticulo"].Value)); DetalleIngresoAlmacen dStockFinal = IngresoAlmacenNEG.Instancia().ObtenerStockActual(Convert.ToInt32(row.Cells["idArticulo"].Value)); d.idArticulo = Convert.ToInt32(row.Cells["idArticulo"].Value); d.PrecioCompra = Convert.ToDecimal(row.Cells["PUCompra"].Value); d.PrecioVenta = Convert.ToDecimal(row.Cells["PUVenta"].Value); d.Cantidad = Convert.ToInt32(row.Cells["Cantidad"].Value); d.CantidadFinal = Convert.ToInt32(row.Cells["Cantidad"].Value) + dStockFinal.CantidadFinal; c.Lineas.Add(d); } IngresoAlmacenNEG.RegistrarIngreso(c); MessageBox.Show("El Ingreso se registro correctamente."); DialogResult result = MessageBox.Show("Desea realizar un nuevo ingreso?", "Ingreso", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { txtCodigoArticulo.Clear(); txtCodigo.Clear(); txtCorrelativo.Clear(); txtNombreArticulo.Clear(); txtNombreProveedor.Clear(); txtPrecioCompra.Clear(); txtPrecioVenta.Clear(); txtSerie.Clear(); nudCantidad.Value = 1; foreach (DataGridViewRow row in dgvDetalle.Rows) { //Indice dila actualmente seleccionado y que vamos a eliminar int indiceFila = this.dgvDetalle.CurrentCell.RowIndex; //Fila que vamos a eliminar DataRow row2 = this.dtDetalle.Rows[indiceFila]; //Disminuimos el total a pagar this.totalInvertido = this.totalInvertido - Convert.ToDecimal(row2["subTotal"].ToString()); this.lblTotalInvertido.Text = "Total Pagar: S/." + totalInvertido.ToString("#0.00#"); //Removemos la fila this.dtDetalle.Rows.Remove(row2); } this.lblTotalInvertido.Text = "Total Invertido: S/. 0.00"; } else { this.Dispose(); } } }