public AsientoCVoucher(Voucher obj) { InitializeComponent(); this.ControlBox = false; this.Text = "Asientos Contables"; this.StartPosition = FormStartPosition.Manual; this.Location = new Point(50, 20); objVoucher = obj; objAsiento = new Asiento(); objAsientoDao = new AsientoDAO(); /*CHEQUES*/ if (objVoucher.TipVoucher.ToString() == "C") { txt_TipoAsiento.Text = "23"; } /*CARGOS*/ else if (objVoucher.TipVoucher.ToString() == "CA") { txt_TipoAsiento.Text = "22"; } /*ABONOS*/ else if (objVoucher.TipVoucher.ToString() == "A") { txt_TipoAsiento.Text = "21"; } txt_Correlativo.Text = objAsientoDao.getCorrelativoAsientoVenta(objVoucher.FechaEmision.ToString("dd/MM/yyyy"), txt_TipoAsiento.Text); gridParams(); cmbCuenta(); cmbDocumento(); txt_Fecha.Text = objVoucher.FechaPago.ToString("dd/MM/yyyy"); txt_Moneda.Text = objVoucher.Moneda; if (objVoucher.TipVoucher.ToString() == "C") { objListaAsientoDetalle = objAsientoDao.getGenerarDetalleVoucher(objVoucher.NroVoucher); } else if (objVoucher.TipVoucher.ToString() == "A") { objListaAsientoDetalle = objAsientoDao.getGenerarDetalleVoucherAbono(objVoucher.NroVoucher); } else if (objVoucher.TipVoucher.ToString() == "CA") { objListaAsientoDetalle = objAsientoDao.getGenerarDetalleVoucherCargo(objVoucher.NroVoucher); } grd_Facturas.DataSource = objListaAsientoDetalle; grd_Facturas.Refresh(); grd_Facturas.CellClick += Grd_Facturas_CellClick; }