public void PresupuestoConsultaGrid(ref Presupues ObjPresupuesto, ref List <Presupues> List)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand cmm     = null;

            try
            {
                OracleDataReader dr = null;

                String[] Parametros = { "p_id" };
                String[] Valores    = { ObjPresupuesto.Id };

                cmm = CDDatos.GenerarOracleCommandCursor("pkg_contabilidad.Obt_Grid_Presupuesto", ref dr, Parametros, Valores);
                while (dr.Read())
                {
                    ObjPresupuesto             = new Presupues();
                    ObjPresupuesto.Descripcion = Convert.ToString(dr.GetValue(4));
                    ObjPresupuesto.Autorizado  = Convert.ToDouble(dr.GetValue(7));
                    ObjPresupuesto.Modificado  = Convert.ToDouble(dr.GetValue(8));
                    ObjPresupuesto.Ejercido    = Convert.ToDouble(dr.GetValue(9));
                    ObjPresupuesto.Avance      = Convert.ToInt32(dr.GetValue(10));
                    List.Add(ObjPresupuesto);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref cmm);
            }
        }
 protected void BTNGuardarCatPres_Click(object sender, EventArgs e)
 {
     try
     {
         Presupues objEstrucProg = new Presupues();
         if (SesionUsu.Usu_TipoUsu == "SA" || SesionUsu.Usu_Nombre == "HERNANDEZ" || SesionUsu.Usu_Nombre == "GORDILLO" || SesionUsu.Usu_Nombre == "JOSE.GORDILLO" || SesionUsu.Usu_Nombre == "PEREZ" || SesionUsu.Usu_Nombre == "ELIESER" || SesionUsu.Usu_Nombre == "OEL" || SesionUsu.Usu_Nombre == "SANDRA.SANCHEZ" || SesionUsu.Usu_Nombre == "FREDY712" || SesionUsu.Usu_Nombre == "CONDE" || SesionUsu.Usu_Nombre == "JORGE.CAMACHO" || SesionUsu.Usu_Nombre == "KAREMCTS")
         {
             string Verificador = string.Empty;
             objEstrucProg.Centro_Contable = DDLCentroContab.SelectedValue;
             objEstrucProg.Programa        = DDLPrograma.SelectedValue;
             objEstrucProg.SubPrograma     = DDLSubprog.SelectedValue;
             objEstrucProg.Dependencia     = DDLDepend.SelectedValue;
             objEstrucProg.Proyecto        = DDLProy.SelectedValue;
             objEstrucProg.Status          = "A";
             objEstrucProg.Ejercicio       = Convert.ToInt32(SesionUsu.Usu_Ejercicio);
             CN_Presupuesto.InsertarEstructuraProg(objEstrucProg, ref Verificador);
             if (Verificador == "0")
             {
                 ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, 'Se ha guardado correctamente.')", true);
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(1, '" + Verificador + ".')", true);
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(1, 'No tiene los privilegios necesarios para realizar esta acción.')", true);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(1, '" + ex.Message + ".')", true);
     }
 }
Exemple #3
0
        public void LlenarTree(ref TreeView Arbolito, Presupues objPresupuesto, List <Presupues> List)
        {
            try
            {
                #region <Variables>
                string valor       = string.Empty;
                string descripcion = string.Empty;
                #endregion

                OracleDataReader dr      = null;
                CD_Datos         CDDatos = new CD_Datos();

                string[] Parametros =
                {
                    "p_Ejercicio",
                };
                object[]      Valores = { objPresupuesto.Ejercicio, };
                OracleCommand Cmd     = CDDatos.GenerarOracleCommandCursor("PKG_CONTABILIDAD.Obt_Tree_Presupuesto", ref dr, Parametros, Valores);

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        objPresupuesto    = new Presupues();
                        objPresupuesto.Id = Convert.ToString(dr["id"].ToString());
                        if (Convert.ToString(dr["nivel"].ToString()) != "1")
                        {
                            objPresupuesto.Padre = Convert.ToString(dr["padre"].ToString());
                        }
                        else
                        {
                            objPresupuesto.Padre = "0";
                        }

                        objPresupuesto.Descripcion = dr["descripcion"].ToString();
                        objPresupuesto.Nivel       = Convert.ToInt32(dr["nivel"].ToString());
                        List.Add(objPresupuesto);
                        //TreeNode nodoPadre = new TreeNode();
                        //nodoPadre.Collapse();
                        //valor = dr["id"].ToString();
                        //descripcion = dr["TIPO"].ToString() + " - " + dr["descripcion"].ToString();
                        //importes = dr["IMPORTES"].ToString();
                    }
                    BindTree(List, null, Arbolito);
                    dr.Close();
                }

                CDDatos.LimpiarOracleCommand(ref Cmd);
            }

            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Exemple #4
0
 public void LlenarTree(ref TreeView Arbol, Presupues objPresupuesto, List <Presupues> List)
 {
     try
     {
         CD_Mnu CDMnu = new CD_Mnu();
         CDMnu.LlenarTree(ref Arbol, objPresupuesto, List);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #5
0
 public void InsertarEstructuraProg(Presupues ObjPresupuesto, ref string Verificador)
 {
     try
     {
         CD_Presupuesto DatosPresupuesto = new CD_Presupuesto();
         DatosPresupuesto.InsertarEstructuraProgramatica(ObjPresupuesto, ref Verificador);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #6
0
 public void PresupuestoConsultaGrid(ref Presupues ObjPresupuesto, ref List <Presupues> List)
 {
     try
     {
         CD_Presupuesto DatosPresupuesto = new CD_Presupuesto();
         DatosPresupuesto.PresupuestoConsultaGrid(ref ObjPresupuesto, ref List);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
        public void InsertarEstructuraProgramatica(Presupues objEstruct, ref string Verificador)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand Cmd     = null;

            try
            {
                String[] Parametros    = { "P_CENTRO_CONTABLE", "P_PROGRAMA", "P_SUBPROGRAMA", "P_DEPENDENCIA", "P_PROYECTO", "P_STATUS", "P_EJERCICIO" };
                object[] Valores       = { objEstruct.Centro_Contable, objEstruct.Programa, objEstruct.SubPrograma, objEstruct.Dependencia, objEstruct.Proyecto, objEstruct.Status, objEstruct.Ejercicio };
                String[] ParametrosOut = { "p_Bandera" };

                Cmd = CDDatos.GenerarOracleCommand("INS_CAT_ESTRUCT", ref Verificador, Parametros, Valores, ParametrosOut);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref Cmd);
            }
        }