private void btnBorrar_Click(object sender, EventArgs e) { CuentasXCobrar.Transacciones transaccion = entities.Transacciones.Find(nupID.Value); if (transaccion != null) { entities.Transacciones.Remove(transaccion); entities.SaveChanges(); MessageBox.Show("El Movimiento ha sido eliminado con exito"); } else { MessageBox.Show("El movimiento no existe"); } this.Close(); }
private void dgvTransacciones_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewRow row = dgvTransacciones.SelectedRows[0]; CuentasXCobrar.Transacciones transacciones = new CuentasXCobrar.Transacciones(); transacciones.IdTrans = Int32.Parse(row.Cells[0].Value.ToString()); transacciones.IdMovimiento = Int32.Parse(row.Cells[1].Value.ToString()); transacciones.IdDoc = Int32.Parse(row.Cells[2].Value.ToString()); transacciones.IdCliente = Int32.Parse(row.Cells[3].Value.ToString()); transacciones.NumeroDocumento = Int32.Parse(row.Cells[4].Value.ToString()); transacciones.Fecha = Convert.ToDateTime(row.Cells[5].Value.ToString()); transacciones.Monto = Convert.ToDecimal(row.Cells[6].Value.ToString()); FrmEditar_Transacciones fed = new FrmEditar_Transacciones(); fed.transaccion = transaccion; fed.ShowDialog(); }
private void dgvTrans_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewRow row = this.dgvTrans.CurrentRow; CuentasXCobrar.Transacciones transacciones = new CuentasXCobrar.Transacciones(); transacciones.IdTrans = Int32.Parse(row.Cells[0].Value.ToString()); transacciones.IdMovimiento = Int32.Parse(row.Cells[1].Value.ToString()); transacciones.IdDoc = Int32.Parse(row.Cells[2].Value.ToString()); transacciones.IdCliente = Int32.Parse(row.Cells[3].Value.ToString()); transacciones.NumeroDocumento = Int32.Parse(row.Cells[4].Value.ToString()); transacciones.Fecha = Convert.ToDateTime(row.Cells[5].Value.ToString()); transacciones.Monto = decimal.Parse(row.Cells[6].Value.ToString()); FrmEditar_Transacciones fet = new FrmEditar_Transacciones(); fet.transacciones = transacciones; fet.ShowDialog(); fet.Focus(); }