コード例 #1
0
        private void editarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string movimiento   = dataListadoIngresoGasto.CurrentRow.Cells["Movimiento"].Value.ToString();
            int    IdMovimiento = Convert.ToInt32(dataListadoIngresoGasto.CurrentRow.Cells["IdMovimiento"].Value);
            string descripcion  = dataListadoIngresoGasto.CurrentRow.Cells["Descripcion"].Value.ToString();
            string monto        = dataListadoIngresoGasto.CurrentRow.Cells["monto"].Value.ToString();
            string tipo         = dataListadoIngresoGasto.CurrentRow.Cells["tipo"].Value.ToString();
            string fecha        = dataListadoIngresoGasto.CurrentRow.Cells["fecha"].Value.ToString();

            if (movimiento.Equals("I"))
            {
                FIngresos ingresos = new FIngresos();
                ingresos.IdIngreso           = IdMovimiento;
                ingresos.txtDescripcion.Text = descripcion;
                ingresos.txtMonto.Text       = monto;
                ingresos.tipo           = tipo;
                ingresos.dtpFecha.Value = Convert.ToDateTime(fecha);
                ingresos.Editar         = true;
                ingresos.ShowDialog();
            }
            else
            {
                FGastos gastos = new FGastos();
                gastos.IdGasto             = IdMovimiento;
                gastos.txtDescripcion.Text = descripcion;
                gastos.txtMonto.Text       = monto;
                gastos.dtpFecha.Value      = Convert.ToDateTime(fecha);
                gastos.tipo   = tipo;
                gastos.Editar = true;
                gastos.ShowDialog();
            }

            ListarMovimiento();
        }
コード例 #2
0
        private void pcAgregar_Click(object sender, EventArgs e)
        {
            FIngresos tipoIngreso = new FIngresos();

            tipoIngreso.ShowDialog();

            ListarMovimiento();
        }