Ejemplo n.º 1
0
 public bool CuentaRepetida(string strCuenta)
 {
     if (CuentaContableBusiness.ObtenerCuentaContablePorCuenta(strCuenta) != null)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
        public string EditarRegistro(string strCuenta, string strDescripcion, string strTipo, string strRama, string strEstatus)
        {
            //1. Armar objeto para actualizarlo
            CuentaContable oCuentaContable = new CuentaContable();

            oCuentaContable.Cuenta      = strCuenta;
            oCuentaContable.Descripcion = strDescripcion;
            oCuentaContable.Tipo        = strTipo;
            oCuentaContable.Rama        = strRama;
            oCuentaContable.Estatus     = strEstatus;

            //2. Actualizar Cuenta
            CuentaContableBusiness.Actualizar(oCuentaContable);

            return(oCuentaContable.Cuenta);
        }
Ejemplo n.º 3
0
        public string GenerarNodo(string strNodoID)
        {
            //1. Obtener las cuentas contables del siguiente nivel
            List <CuentaContable> lCuentasContables = CuentaContableBusiness.ObtenerCuentaContablePorRama(strNodoID);
            NodeCollection        ncNivel           = new NodeCollection();

            //2. Armar el arbol de hijos
            foreach (CuentaContable sd in lCuentasContables)
            {
                Node nNivel = new Node();
                nNivel.Text   = sd.Descripcion;
                nNivel.NodeID = sd.Cuenta;
                ncNivel.Add(nNivel);
            }

            //3. Regresar los nodos
            return(ncNivel.ToJson());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Evento que se lanza al cargar la página
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //1. Petición Ajax
            if (!X.IsAjaxRequest)
            {
                //2. Contruir nodo raiz
                Node nRoot = new Node();
                nRoot.Text     = "Cuentas Contables";
                nRoot.NodeID   = "CC";
                nRoot.Expanded = true;
                tpCuentasContables.Root.Add(nRoot);

                //3. Obtener Las ramas vacias y las ramas en "A"
                List <CuentaContable> lCuentasContables = CuentaContableBusiness.ObtenerCuentaContablePorRama(string.Empty);
                List <CuentaContable> lContabilidad     = CuentaContableBusiness.ObtenerCuentaContablePorRama("A");

                //4. Contruir el primer nuvel y segundo nivel de cuentas contables
                foreach (CuentaContable sd in lCuentasContables)
                {
                    Node nPrimerNivel = new Node();
                    nPrimerNivel.Text   = sd.Descripcion;
                    nPrimerNivel.NodeID = sd.Cuenta;
                    nRoot.Children.Add(nPrimerNivel);

                    //5. Si la rama es "A" = Contabilidad ingresar los nodos hijos y dejarlo expandido
                    if (sd.Cuenta.Equals("A"))
                    {
                        foreach (CuentaContable sd2 in lContabilidad)
                        {
                            Node nContabilidad = new Node();
                            nContabilidad.Text   = sd2.Descripcion;
                            nContabilidad.NodeID = sd2.Cuenta;
                            nPrimerNivel.Children.Add(nContabilidad);
                        }
                        nPrimerNivel.Expanded = true;
                    }
                }

                //6. Llenar el store de Rama
                sRama.DataSource = CuentaContableBusiness.ObtenerCuentasContables();
                sRama.DataBind();
            }
        }
Ejemplo n.º 5
0
 public void NodoHijos(string strNodoID)
 {
     //1. Obtener las cuentas hijas
     sCuentasContables.DataSource = CuentaContableBusiness.ObtenerCuentaContablePorRama(strNodoID);
     sCuentasContables.DataBind();
 }
Ejemplo n.º 6
0
 public void EliminarRegistro(string strCuenta)
 {
     CuentaContableBusiness.Borrar(strCuenta);
 }