private void consultarToolStripMenuItem_Click(object sender, EventArgs e) { FormularioNueva_FacturaVenta nuevo = new FormularioNueva_FacturaVenta(); nuevo.Show(); this.Hide(); }
private void btnInsertar_Click(object sender, EventArgs e) { if (this.txtCodigo.Text == String.Empty || this.txtDescuento.Text == String.Empty || this.txtCantidadVender.Text == String.Empty) { MessageBox.Show("Falta ingresar algunos campos", "Ingresar Producto", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (Convert.ToInt32(this.lblCantidad.Text) < Convert.ToInt32(this.txtCantidadVender.Text)) { MessageBox.Show("Producto Insuficiente", "Ingresar Producto", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { FormularioNueva_FacturaVenta factura = new FormularioNueva_FacturaVenta(); NegocioProducto.consultarProductoTabla(this.txtCodigo.Text); if (this.tablaProducto.Rows.Count != 0) { DataRow row = FormularioNueva_FacturaVenta.tablaDetalle.NewRow(); row["IDFACTURA"] = Int32.Parse((factura.lblNumeroFacturaVenta.Text)); row["IDPRODUCTO"] = Int32.Parse(Convert.ToString(this.tablaProducto.CurrentRow.Cells["IDPRODUCTO"].Value)); row["IDMANTENIMIENTO"] = 1; row["CÓDIGO"] = this.txtCodigo.Text; row["CANTIDAD"] = Convert.ToInt32(this.txtCantidadVender.Text); row["DETALLE"] = this.lblDescripcion.Text; row["VALOR UNITARIO"] = Convert.ToSingle(this.lblPrecioVenta.Text); row["DESCUENTO"] = Convert.ToSingle(this.lblPrecioVenta.Text) * Convert.ToInt32(this.txtCantidadVender.Text) * (float.Parse(this.txtDescuento.Text) / 100); row["VALOR TOTAL"] = (Convert.ToSingle(row["VALOR UNITARIO"].ToString()) * (Convert.ToSingle(row["CANTIDAD"].ToString())) - (Convert.ToSingle(row["DESCUENTO"].ToString()))); FormularioNueva_FacturaVenta.tablaDetalle.Rows.Add(row); this.Hide(); } } } }
private void btnInsertar_Click(object sender, EventArgs e) { if (this.txtCodigoMantenimiento.Text == String.Empty) { MessageBox.Show("Falta ingresar algunos campos", "Ingresar Mantenimiento", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { FormularioNueva_FacturaVenta factura = new FormularioNueva_FacturaVenta(); DataRow row = FormularioNueva_FacturaVenta.tablaDetalle.NewRow(); row["IDFACTURA"] = Convert.ToInt32(factura.lblNumeroFacturaVenta.Text); row["IDPRODUCTO"] = 1; row["IDMANTENIMIENTO"] = Convert.ToInt32(this.txtCodigoMantenimiento.Text); row["CÓDIGO"] = this.txtCodigoMantenimiento.Text; row["CANTIDAD"] = 1; row["DETALLE"] = this.lblObservacionMantenimientoMostrar.Text; row["VALOR UNITARIO"] = float.Parse(this.lblPrecioMantenimientoMostrar.Text); row["DESCUENTO"] = 0; row["VALOR TOTAL"] = float.Parse(this.lblPrecioMantenimientoMostrar.Text) * float.Parse(row["CANTIDAD"].ToString()); FormularioNueva_FacturaVenta.tablaDetalle.Rows.Add(row); this.Hide(); } }