private void grw_facturas_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { int idCaja = Convert.ToInt32(this.grw_cajas.Rows[e.RowIndex].Cells["id"].Value); if (this.Owner.GetType() == typeof(frm_abrir_cerrar)) { frm_abrir_cerrar formularioCaja = (frm_abrir_cerrar)this.Owner; formularioCaja.setIdCaja(idCaja); } else { DateTime fechaInicio = Convert.ToDateTime(this.grw_cajas.Rows[e.RowIndex].Cells["Fecha Apertura"].Value, new System.Globalization.CultureInfo("en-AU", false)); DateTime fechaFin = Convert.ToDateTime(this.grw_cajas.Rows[e.RowIndex].Cells["Fecha Cierre"].Value, new System.Globalization.CultureInfo("en-AU", false)); //reporte.setCaja(idCaja, idCaja.ToString() + ", " + this.grw_cajas.Rows[e.RowIndex].Cells["vendedor"].Value.ToString(),fechaInicio,fechaFin); if (this.Owner.GetType() == typeof(Pos.App.Reportes.frm_reporteProducto)) { ((Pos.App.Reportes.frm_reporteProducto) this.Owner).setCaja(idCaja, idCaja.ToString() + ", " + this.grw_cajas.Rows[e.RowIndex].Cells["vendedor"].Value.ToString(), fechaInicio, fechaFin); } else { ((Pos.App.Reportes.frm_reporteVentas) this.Owner).setCaja(idCaja, idCaja.ToString() + ", " + this.grw_cajas.Rows[e.RowIndex].Cells["vendedor"].Value.ToString(), fechaInicio, fechaFin); } } this.Close(); } }
private void btn_caja_Click(object sender, EventArgs e) { int idConf = -1; if ((idConf = ConfiguracionPosTR.idConfPredeterminada()) == -1) { Mensaje.advertencia("Debe configurar el Punto de venta para abrir caja."); } else { frm_abrir_cerrar aperturar = new frm_abrir_cerrar(idConf, "abrir"); aperturar.ShowDialog(this); } }
private void btn_cerrar_Click_1(object sender, EventArgs e) { string msn = ""; int idConf = -1; if ((idConf = ConfiguracionPosTR.idConfPredeterminada()) == -1) { if (String.IsNullOrEmpty(msn)) { Mensaje.advertencia("No ha configurado un punto de venta."); } else { Mensaje.error(msn); } } else { CajaTR tranCaja = new CajaTR(); if (tranCaja.existeCajaActiva(idConf, ref msn)) { frm_abrir_cerrar aperturar = new frm_abrir_cerrar(idConf, "cerrar"); aperturar.ShowDialog(); } else { if (String.IsNullOrEmpty(msn)) { Mensaje.advertencia("No ha abierto caja."); } else { Mensaje.error(msn); } } } }