private void generaPresentancionesBase() { foreach (DataGridViewRow fila in tabla_presentacion_producto.Rows) { xm._AñadirPrese_prod("0", fila.Cells[1].Value.ToString(), fila.Cells[5].Value.ToString(), fila.Cells[3].Value.ToString(), fila.Cells[6].Value.ToString(), "2", txtCodigo.Text, Convert.ToInt16(sesion.DatosRegistro[0])); } }
private void btnGuardar_Click(object sender, EventArgs e) { utilitarios.maneja_fechas fe = new utilitarios.maneja_fechas(); if (!validar()) { pro = new conexiones_BD.clases.productos( txtCodigo.Text, txtnombreP.Text.ToUpper(), fe.fechaMysql(fecha), "60", "53"); sp = new conexiones_BD.clases.sucursales_productos( sesion.DatosRegistro[1], "0", "2", "4", "1", "1000", precio.Value.ToString(), "0.0", "0.0", "0.0", "1"); op = new conexiones_BD.operaciones(); if (op.transaccionProductos_Presentaciones_Proveedores(generaProveedores(), generaPresentaciones(), pro, sp) > 0) { MessageBox.Show("El producto se ingreso", "Exíto", MessageBoxButtons.OK, MessageBoxIcon.Information); ingresado = true; xm._AñadirProductos(txtCodigo.Text, txtnombreP.Text.ToUpper(), fe.fechaMysql(fecha), "60", "53", Convert.ToInt16(sesion.DatosRegistro[0])); xm._AñadirSucursal_productos(sesion.DatosRegistro[1], "0", "2", "4", "1", "1000", precio.Value.ToString(), "0.0", "0.0", "0.0", "1", txtCodigo.Text, Convert.ToInt16(sesion.DatosRegistro[0])); xm._AñadirProvedores_productos("2", "0", txtCodigo.Text, Convert.ToInt16(sesion.DatosRegistro[0])); xm._AñadirPrese_prod("0", "1", "1", precio.Value.ToString(), "2", "2", txtCodigo.Text, Convert.ToInt16(sesion.DatosRegistro[0])); this.Close(); } else { MessageBox.Show("El producto no se pudo ingresar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }