private void GrdDocumento_CellClick(object sender, DataGridViewCellEventArgs e) { if (objListaLetraDet.Count != 0) { objLetraDet = new LetraDet(); index = grdDocumento.SelectedCells[0].RowIndex; objLetraDet = objListaLetraDet[index]; txt_DetraccionFactura.Text = objLetraDet.LetraDetDetraccion.ToString(); txt_Porcentaje.Text = objLetraDet.LetraDetDetraccionPorcentaje.ToString(); txt_SerieDcto.Text = objLetraDet.LetraDetSerieRef; txt_NumeroDcto.Text = objLetraDet.LetraDetNroRef; txt_TotalFactura.Text = objLetraDet.LetraDetTotal.ToString(); txt_FacturaCanjeado.Text = objLetraDet.LetraDetAbono.ToString(); // dpick_Fecha.Value = objLetraDet.LetraDetFechaEmisionRef; // dpck_Fechavcto.Value = objLetraDet.LetraDetFechaVctoRef; if (objLetraDet.LetraDetDetraccion > 0) { chk_Detraccion.Checked = true; } else { chk_Detraccion.Checked = false; } } }
private void btn_Guardar_Click(object sender, EventArgs e) { objLetraDet = new LetraDet(); objLetraDet.LetraDetAbono = Math.Round(convertToDouble(txt_FacturaCanjeado.Text), 2, MidpointRounding.AwayFromZero); objLetraDet.LetraDetDetraccion = Math.Round(convertToDouble(txt_DetraccionFactura.Text), 2, MidpointRounding.AwayFromZero); objLetraDet.LetraDetDetraccionPorcentaje = convertToDouble(txt_Porcentaje.Text); // objLetraDet.LetraDetFechaEmisionRef = Convert.ToDateTime(txt_fechaemidcto.Text); // objLetraDet.LetraDetFechaVctoRef = Convert.ToDateTime(txt_fechavctodcto.Text); objLetraDet.LetraDetNro = txt_Numero.Text; objLetraDet.LetraDetNroRef = txt_NumeroDcto.Text; objLetraDet.LetraDetSaldo = objDocumentoCab.DocumentoCabTotal - Math.Round(objDocumentoCab.DocumentoCabAbono + objDocumentoCab.DocumentoCabDetraccion, 2, MidpointRounding.AwayFromZero); objLetraDet.LetraDetSerie = txt_Serie.Text; objLetraDet.LetraDetSerieRef = txt_SerieDcto.Text; objLetraDet.LetraDetTotal = convertToDouble(txt_TotalFactura.Text); objLetraDet.LetraDetCodMoneda = txt_CodMoneda.Text; if (Operacion == "S") { objListaLetraDet.Add(objLetraDet); } else if (Operacion == "M") { objListaLetraDet[index] = objLetraDet; } grdDocumento.DataSource = null; grdDocumento.DataSource = objListaLetraDet; grdDocumento.Refresh(); llenarSumatorias(); btn_Buscar.Enabled = false; btn_BuscarDocu.Enabled = true; btn_Add.Enabled = true; btn_Guardar.Enabled = false; btn_Editar.Enabled = true; btn_BuscarDocu.Enabled = false; dpck_Fechavcto.Enabled = false; txt_SerieDcto.Text = ""; txt_NumeroDcto.Text = ""; txt_TotalFactura.Text = ""; txt_FacturaCanjeado.Text = ""; txt_DetraccionFactura.Text = ""; chk_Detraccion.Checked = false; }
private void GrdDocumento_CellClick(object sender, EventArgs e) { if (objListaLetraDet.Count != 0) { objLetraDet = new LetraDet(); index = grdDocumento.SelectedCells[0].RowIndex; objLetraDet = objListaLetraDet[index]; txt_TotalFactura.Text = objLetraDet.LetraDetAbonoSuma.ToString(); txt_SerieDcto.Text = objLetraDet.LetraDetSerieRef; txt_NumeroDcto.Text = objLetraDet.LetraDetNroRef; if (objLetraDet.LetraDetCodMoneda == "USD") { txt_Moneda.Text = "$"; } else { txt_Moneda.Text = "S/"; } } }