private void btn_imprimir_Click(object sender, EventArgs e) { if (dgv_OTproductosPadres.Rows.Count > 0) { if (dgv_OTproductosPadres.Rows[dgv_OTproductosPadres.CurrentRow.Index].DefaultCellStyle.BackColor == Color.LightSalmon) { OrdenDeTrabajo orden = new OrdenDeTrabajo(); orden.producto = new Producto() { idProducto = (int)dgv_OTproductosPadres.Rows[dgv_OTproductosPadres.CurrentRow.Index].Cells["idProducto"].Value }; orden.fechaCreacion = Convert.ToDateTime(dgv_OTproductosPadres.Rows[dgv_OTproductosPadres.CurrentRow.Index].Cells["fechaCreacion"].Value); orden.idPlan = (int)dgv_OTproductosPadres.Rows[dgv_OTproductosPadres.CurrentRow.Index].Cells["idPlan"].Value; Emitir_Orden_De_Trabajo emitir = new Emitir_Orden_De_Trabajo(); emitir._orden = orden; emitir._reporte = reporteOT.intermedio; emitir.ShowDialog(); emitir = new Emitir_Orden_De_Trabajo(); emitir._orden = orden; emitir._reporte = reporteOT.final; emitir.ShowDialog(); } else { MessageBox.Show("Esta Orden de Trabajo ya fue Finalizada", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } else { MessageBox.Show("No Hay Ordenes a Imprimir", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } }