Exemple #1
0
        void objetoGrid_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
        {
            DataGridView grid = (DataGridView)sender;

            if (grid.CurrentRow.Cells[e.ColumnIndex].IsInEditMode)
            {
                if (grid.CurrentCell.ColumnIndex == 3)
                {
                    cuentacontable objeto = null;
                    objeto = RegistroPorCodigo(grid.EditingControl.Text);
                    if (objeto == null)
                    {
                        grid.CurrentRow.Cells["colPadre"].Value = null;
                    }
                    else
                    {
                        grid.CurrentRow.Cells["colPadre"].Value = objeto;
                    }
                    if (objeto == null)
                    {
                        General.Mensaje(General.itemNoEncontrado);
                        e.Cancel = true;
                    }
                }
            }
        }
Exemple #2
0
        private cuentacontable CargarRelaciones(cuentacontable unObjeto)
        {
            int ix;

            ix = ListaPadres.FindIndex(x => x.id == unObjeto.idpadre);
            if (ix > -1)
            {
                unObjeto.Padre       = listaPadres[ix];
                unObjeto.codigopadre = ListaPadres[ix].codigo;
            }

            return(unObjeto);
        }
Exemple #3
0
 public int Borrar(cuentacontable item)
 {
     return(item.BorrarObjetoT());
 }
Exemple #4
0
 public int Grabar(cuentacontable item)
 {
     return(item.GrabarObjetoT(x => x.id));
 }