Ejemplo n.º 1
0
 protected void GRDFuenteFin_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         FuentesFin objFuenteFin = new FuentesFin();
         string     Verificador  = string.Empty;
         objFuenteFin.Id = Convert.ToString(GRDFuenteFin.SelectedRow.Cells[2].Text);
         Session["SessionIdFuenteFin"] = objFuenteFin;
         objFuenteFin.Ejercicio        = SesionUsu.Usu_Ejercicio;
         CN_FuenteFin.ObtenerDatosFuenteFin(ref objFuenteFin, ref Verificador);
         if (Verificador == "0")
         {
             txtFuente.Text             = objFuenteFin.Fuente;
             txtDescrip.Text            = objFuenteFin.Descrip;
             txtFuenteFinActual.Text    = objFuenteFin.DescripcionFuenteFin;
             Multiview1.ActiveViewIndex = 1;
             string fuente = objFuenteFin.Fuente.Substring(0, 3);
             CargarCombos(fuente);
             DDLFuenteFin.SelectedValue = objFuenteFin.IdFuenteFin;
         }
         else
         {
             ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, '" + Verificador + ".')", true);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, '" + ex.Message + ".')", true);
     }
 }
Ejemplo n.º 2
0
        public void ObtenerDatosFuenteFin(ref FuentesFin objFuenteFin, ref string Verificador)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand Cmd     = null;

            try
            {
                string[] ParametrosIn  = { "P_ID", "P_EJERCICIO" };
                object[] Valores       = { objFuenteFin.Id, objFuenteFin.Ejercicio };
                string[] ParametrosOut = { "P_FUENTE", "P_DESCRIPCION", "P_DESCRIPCION_FUENTE", "P_ID_FUENTE", "P_BANDERA" };

                Cmd = CDDatos.GenerarOracleCommand("OBT_SAF_FUENTES", ref Verificador, ParametrosIn, Valores, ParametrosOut);
                if (Verificador == "0")
                {
                    objFuenteFin                      = new FuentesFin();
                    objFuenteFin.Fuente               = Convert.ToString(Cmd.Parameters["P_FUENTE"].Value);
                    objFuenteFin.Descrip              = Convert.ToString(Cmd.Parameters["P_DESCRIPCION"].Value);
                    objFuenteFin.Id                   = Convert.ToString(Cmd.Parameters["P_ID"].Value);
                    objFuenteFin.Ejercicio            = Convert.ToString(Cmd.Parameters["P_EJERCICIO"].Value);
                    objFuenteFin.IdFuenteFin          = Convert.ToString(Cmd.Parameters["P_ID_FUENTE"].Value);
                    objFuenteFin.DescripcionFuenteFin = Convert.ToString(Cmd.Parameters["P_DESCRIPCION_FUENTE"].Value);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref Cmd);
            }
        }
Ejemplo n.º 3
0
 protected void GRDFuenteFin_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     try
     {
         FuentesFin objFuenteFin = new FuentesFin();
         string     Verificador  = string.Empty;
         int        fila         = e.RowIndex;
         objFuenteFin.Id = Convert.ToString(GRDFuenteFin.Rows[fila].Cells[2].Text);
         if (SesionUsu.Usu_TipoUsu == "SU")
         {
             CN_FuenteFin.EliminarFuenteFin(objFuenteFin, ref Verificador);
             if (Verificador == "0")
             {
                 ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(1, 'Se ha eliminado correctamente.')", true);
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, '" + Verificador + ".')", true);
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, '" + Verificador + ".')", true);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, '" + ex.Message + ".')", true);
     }
 }
Ejemplo n.º 4
0
 protected void BTNEditarFuenteFin_Click(object sender, EventArgs e)
 {
     try
     {
         if (SesionUsu.Usu_TipoUsu == "SA")
         {
             FuentesFin objFuenteFin = new FuentesFin();
             string     Verificador  = string.Empty;
             objFuenteFin = (FuentesFin)Session["SessionIdFuenteFin"];
             //objFuenteFin.Ejercicio = SesionUsu.Usu_Ejercicio;
             objFuenteFin.Fuente    = txtFuente.Text;
             objFuenteFin.Descrip   = txtDescrip.Text;
             objFuenteFin.TipoFinan = DDLFuenteFin.SelectedValue;
             CN_FuenteFin.EditarFuenteFin(ref objFuenteFin, ref Verificador);
             if (Verificador == "0")
             {
                 ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(1, 'Se han realizado los cambios correctamente.')", true);
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, '" + Verificador + ".')", true);
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, 'No tiene los privilegios para realizar esta acción.')", true);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, '" + ex.Message + ".')", true);
     }
 }
Ejemplo n.º 5
0
 protected void BTNGuardarFuenteFin_Click(object sender, EventArgs e)
 {
     try
     {
         FuentesFin objFuentesFin = new FuentesFin();
         if (SesionUsu.Usu_TipoUsu == "SA")
         {
             objFuentesFin.Fuente    = txtFuente.Text;
             objFuentesFin.TipoFinan = DDLFuenteFin.SelectedValue;
             objFuentesFin.TipoFondo = DDLTipofondo.SelectedValue;
             objFuentesFin.Descrip   = txtDescrip.Text;
             string Verificador = string.Empty;
             CN_FuenteFin.InsertarFuente(ref objFuentesFin, ref Verificador);
             if (Verificador == "0")
             {
                 ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, 'Se ha guardado correctamente.')", true);
                 txtFuente.Text  = "";
                 txtDescrip.Text = "";
             }
             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 para realizar esta acción.')", true);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(1, '" + ex.Message + ".')", true);
     }
 }
Ejemplo n.º 6
0
        public void FuentesGrid(ref FuentesFin objFuentes, ref List <FuentesFin> List)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand cmm     = null;

            try
            {
                OracleDataReader dr         = null;
                String[]         Parametros = { "p_ejercicio" };
                String[]         Valores    = { objFuentes.Ejercicio };

                cmm = CDDatos.GenerarOracleCommandCursor("PKG_PRESUPUESTO.Obt_Grid_TipoFinan", ref dr, Parametros, Valores);

                while (dr.Read())
                {
                    objFuentes         = new FuentesFin();
                    objFuentes.Fuente  = Convert.ToString(dr.GetValue(0));
                    objFuentes.Descrip = Convert.ToString(dr.GetValue(1));
                    objFuentes.Id      = Convert.ToString(dr.GetValue(2));
                    List.Add(objFuentes);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref cmm);
            }
        }
Ejemplo n.º 7
0
 public void EliminarFuenteFin(FuentesFin objFuentesFin, ref string Verificador)
 {
     try
     {
         CD_FuenteFin CD_FuenteFin = new CD_FuenteFin();
         CD_FuenteFin.EliminarFuenteFin(objFuentesFin, ref Verificador);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Ejemplo n.º 8
0
 public void ObtenerDatosFuenteFin(ref FuentesFin objFuentesFin, ref string Verificador)
 {
     try
     {
         CD_FuenteFin CD_FuenteFin = new CD_FuenteFin();
         CD_FuenteFin.ObtenerDatosFuenteFin(ref objFuentesFin, ref Verificador);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Ejemplo n.º 9
0
 public void InsertarFuente(ref FuentesFin objFuentesFin, ref string Verificador)
 {
     try
     {
         CD_FuenteFin CD_FuenteFin = new CD_FuenteFin();
         CD_FuenteFin.InsertarFuente(ref objFuentesFin, ref Verificador);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Ejemplo n.º 10
0
 public void FuentesGrid(ref FuentesFin objFuentesFin, ref List <FuentesFin> List)
 {
     try
     {
         CD_FuenteFin CD_FuenteFin = new CD_FuenteFin();
         CD_FuenteFin.FuentesGrid(ref objFuentesFin, ref List);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Ejemplo n.º 11
0
 protected void GRDFuenteFinan()
 {
     try
     {
         Multiview1.ActiveViewIndex = 0;
         FuentesFin        objFuenteFin = new FuentesFin();
         List <FuentesFin> list         = new List <FuentesFin>();
         objFuenteFin.Ejercicio = SesionUsu.Usu_Ejercicio;
         CN_FuenteFin.FuentesGrid(ref objFuenteFin, ref list);
         //SqlDataAdapter sda = new SqlDataAdapter(cmd);
         //DataSet ds = new DataSet();
         //sda.Fill(ds);//
         GRDFuenteFin.DataSource = list;
         GRDFuenteFin.DataBind();
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, '" + ex.Message + ".')", true);
     }
 }
Ejemplo n.º 12
0
        public void InsertarFuente(ref FuentesFin objFuentes, ref string Verificador)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand Cmd     = null;

            try
            {
                String[] Parametros    = { "P_FUENTE", "P_ID_TIPO_FINANCIAMIENTO", "P_ID_TIPO_FONDO", "P_DESCRIPCION", "P_EJERCICIO" };
                object[] Valores       = { objFuentes.Fuente, objFuentes.TipoFinan, objFuentes.TipoFondo, objFuentes.Descrip, objFuentes.Ejercicio };
                String[] ParametrosOut = { "p_Bandera" };

                Cmd = CDDatos.GenerarOracleCommand("INS_SAF_FUENTES", ref Verificador, Parametros, Valores, ParametrosOut);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref Cmd);
            }
        }
Ejemplo n.º 13
0
        public void EliminarFuenteFin(FuentesFin objFuenteFin, ref string Verificador)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand Cmd     = null;

            try
            {
                String[] Parametros    = { "P_ID" };
                object[] Valores       = { objFuenteFin.Id };
                String[] ParametrosOut = { "p_Bandera" };

                Cmd = CDDatos.GenerarOracleCommand("", ref Verificador, Parametros, Valores, ParametrosOut);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref Cmd);
            }
        }
Ejemplo n.º 14
0
        public void EditarFuenteFin(ref FuentesFin objFuenteFin, ref string Verificador)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand Cmd     = null;

            try
            {
                String[] Parametros    = { "P_FUENTE", "P_DESCRIP", "P_ID", "P_EJERCICIO", "P_ID_TIPO_FINAN" };
                object[] Valores       = { objFuenteFin.Fuente, objFuenteFin.Descrip, objFuenteFin.Id, objFuenteFin.Ejercicio, objFuenteFin.TipoFinan };
                String[] ParametrosOut = { "p_Bandera" };

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