private void dgrid_Debitos_MouseDoubleClick(object sender, MouseEventArgs e) { try { if (dgrid_Debitos.SelectedRows.Count > 0 && proveedor) { int cal = (dgrid_Debitos.Rows[0].Height * (dgrid_Debitos.Rows.Count)) + 28; if (cal > e.Location.Y && e.Location.Y > 28) { Crecibo_debito orecibo = (Crecibo_debito)dgrid_Debitos.CurrentRow.DataBoundItem; Ccompra oCompra = orecibo.Compra(); if (oCompra != null) { if (oCompra.Lista() == null) { Ctrl_compras adm = Ctrl_compras.ClaseActiva(); adm.CargarItems(oCompra); } string argumento = "Forma de pago : " + oCompra.Forma_Pago + "\nDesc/Rec : $" + oCompra.Descuento + "\nImporte : $ " + oCompra.Total; Frm_Items frm = new Frm_Items(argumento, oCompra); frm.ShowDialog(); } } } } catch (Exception ex) { Frm_confirmacion frm = new Frm_confirmacion(ex.Message, "Bueno, esto es embarazoso. Pero lo solucionaremos :)", "Aceptar"); frm.ShowDialog(); } }
private void dgrid_compras_SelectionChanged(object sender, EventArgs e) { if (dgrid_compras.CurrentRow != null) { oCompra = (Ccompra)dgrid_compras.CurrentRow.DataBoundItem; if (oCompra.Lista().Count == 0) { adm.CargarItems(oCompra); } ActualizarItems(); lbl_Subtotal.Text = oCompra.Subtotal.ToString(); txt_descuento.Text = oCompra.Descuento.ToString(); cb_formaPago.Text = oCompra.FormaPagoDevolver().Descripcion; dtp_fecha.Value = oCompra.Fecha; if (oCompra.Proveedor == null) { cb_ConProveedor.Checked = false; } else { cb_ConProveedor.Checked = true; cb_proveedor.Text = oCompra.Proveedor.ToString(); } } }