private void btn_imprimir_Click(object sender, EventArgs e) { try { var miForma = new Reportes.Frm_reportes(); miForma.ccencos = txtccosto.Text.Trim(); miForma.ccargo = txtdcargo.Text.Trim(); miForma.formulario = "Frm_Contrato"; miForma.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_imprimir_Click(object sender, EventArgs e) { try { if (Tabladetalleocompra.Rows.Count > 0) { String xproductid, xcantidad; xproductid = Convert.ToString(griddetalleocompra.CurrentRow.Cells["productid"].Value); xcantidad = Convert.ToString(griddetalleocompra.CurrentRow.Cells["cantidad"].Value); if (xproductid != string.Empty) { if (xcantidad != "0" && xcantidad != string.Empty) { var miForma = new Reportes.Frm_reportes(); miForma.Text = "Reporte Orden de Compra"; miForma.formulario = "Frm_requerimiento"; miForma.Table = Tabladetalleocompra; miForma.moduloid = modulo.ToString(); miForma.Show(); } else { MessageBox.Show("Ingrese Cantidad", "Mensaje del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Warning); griddetalleocompra.CurrentCell = griddetalleocompra.Rows[griddetalleocompra.RowCount - 1].Cells["cantidad"]; griddetalleocompra.BeginEdit(true); } } else { MessageBox.Show("Ingrese Producto", "Mensaje del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Ingrese Producto", "Mensaje del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }