protected void GRDCentrosContab_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     try
     {
         string        Verificador = string.Empty;
         CentrosContab objCContab  = new CentrosContab();
         int           fila        = e.RowIndex;
         objCContab.Id = Convert.ToString(GRDCentrosContab.Rows[fila].Cells[2].Text);
         if (SesionUsu.Usu_TipoUsu == "SA")
         {
             CN_CentrosContab.EliminarCContab(objCContab, 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, '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);
     }
 }
示例#2
0
        public void ObtenerDatosCContab(ref CentrosContab objCContab, ref string Verificador)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand Cmd     = null;

            try
            {
                string[] ParametrosIn  = { "P_ID", "P_EJERCICIO" };
                object[] Valores       = { objCContab.Id, objCContab.Ejercicio };
                string[] ParametrosOut = { "P_CLAVE", "P_DESCRIPCION", "P_DIRECTOR", "P_ADMINISTRADOR", "P_SALIENTE", "P_ENTRANTE", "P_BANDERA" };

                Cmd = CDDatos.GenerarOracleCommand("OBT_CAT_C_CONTAB", ref Verificador, ParametrosIn, Valores, ParametrosOut);
                if (Verificador == "0")
                {
                    objCContab               = new CentrosContab();
                    objCContab.Id            = Convert.ToString(Cmd.Parameters["P_ID"].Value);
                    objCContab.C_Contab      = Convert.ToString(Cmd.Parameters["P_CLAVE"].Value);
                    objCContab.Descrip       = Convert.ToString(Cmd.Parameters["P_DESCRIPCION"].Value);
                    objCContab.Director      = Convert.ToString(Cmd.Parameters["P_DIRECTOR"].Value);
                    objCContab.Administrador = Convert.ToString(Cmd.Parameters["P_ADMINISTRADOR"].Value);
                    objCContab.Saliente      = Convert.ToString(Cmd.Parameters["P_SALIENTE"].Value);
                    objCContab.Entrante      = Convert.ToString(Cmd.Parameters["P_ENTRANTE"].Value);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref Cmd);
            }
        }
示例#3
0
        //=========================CONTROL CIERRE DE LOS CENTROS CONTABLES=====================
        public void Control_CierreConsultaGrid(ref CentrosContab ObjControl_Cierre, ref List <CentrosContab> List)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand cmm     = null;

            try
            {
                OracleDataReader dr = null;

                string[] Parametros = { "p_ejercicio", "p_sistema" };
                object[] Valores    = { ObjControl_Cierre.Ejercicio, ObjControl_Cierre.sistema };

                cmm = CDDatos.GenerarOracleCommandCursor("pkg_presupuesto.Obt_Grid_Control_Cierre", ref dr, Parametros, Valores);
                while (dr.Read())
                {
                    ObjControl_Cierre = new CentrosContab();
                    ObjControl_Cierre.Id_Control_Cierre = Convert.ToInt32(dr.GetValue(0));
                    ObjControl_Cierre.C_Contab          = Convert.ToString(dr.GetValue(1));
                    ObjControl_Cierre.Mes_anio          = Convert.ToString(dr.GetValue(2));
                    ObjControl_Cierre.Cierre_Definitivo = Convert.ToString(dr.GetValue(8));
                    //ObjControl_Cierre.Status = "../../images/" + Convert.ToString(dr.GetValue(5)) + ".PNG";
                    List.Add(ObjControl_Cierre);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref cmm);
            }
        }
示例#4
0
        public void CContabGrid(ref CentrosContab objCentrosContab, ref List <CentrosContab> List)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand cmm     = null;

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

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

                while (dr.Read())
                {
                    objCentrosContab          = new CentrosContab();
                    objCentrosContab.C_Contab = Convert.ToString(dr.GetValue(0));
                    objCentrosContab.Descrip  = Convert.ToString(dr.GetValue(1));
                    objCentrosContab.Id       = Convert.ToString(dr.GetValue(2));
                    List.Add(objCentrosContab);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref cmm);
            }
        }
示例#5
0
 public void InsertarCentroContable(ref CentrosContab objCentrosContab, ref string Verificador)
 {
     try
     {
         CD_CentrosContab CD_CentrosContab = new CD_CentrosContab();
         CD_CentrosContab.InsertarCentroContable(ref objCentrosContab, ref Verificador);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
示例#6
0
//=========================CONTROL CIERRE DE LOS CENTROS CONTABLES=====================

        public void Control_CierreConsultaGrid(ref CentrosContab ObjControl_Cierre, ref List <CentrosContab> List)
        {
            try
            {
                CD_CentrosContab CDCentros_Contables = new CD_CentrosContab();
                CDCentros_Contables.Control_CierreConsultaGrid(ref ObjControl_Cierre, ref List);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
示例#7
0
 public void ObtenerDatosCContab(ref CentrosContab objCContab, ref string Verificador)
 {
     try
     {
         CD_CentrosContab CD_CentrosContab = new CD_CentrosContab();
         CD_CentrosContab.ObtenerDatosCContab(ref objCContab, ref Verificador);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
示例#8
0
 public void EliminarCContab(CentrosContab objCContab, ref string Verificador)
 {
     try
     {
         CD_CentrosContab CD_CentrosContab = new CD_CentrosContab();
         CD_CentrosContab.EliminarCContab(objCContab, ref Verificador);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
示例#9
0
 public void CContabGrid(ref CentrosContab objCentrosContab, ref List <CentrosContab> List)
 {
     try
     {
         CD_CentrosContab CD_CentrosContab = new CD_CentrosContab();
         CD_CentrosContab.CContabGrid(ref objCentrosContab, ref List);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
示例#10
0
 protected void BTNGuardarCatCContab_Click(object sender, EventArgs e)
 {
     try
     {
         if (SesionUsu.Usu_TipoUsu == "SA")
         {
             CentrosContab objCContab  = new CentrosContab();
             string        Verificador = string.Empty;
             objCContab.C_Contab      = txtCentroContab.Text.ToUpper();
             objCContab.Descrip       = txtDependencia.Text.ToUpper();
             objCContab.Director      = txtDirector.Text;
             objCContab.Administrador = txtAdministrador.Text;
             objCContab.Saliente      = txtSaliente.Text;
             objCContab.Entrante      = txtEntrante.Text;
             objCContab.Ejercicio     = SesionUsu.Usu_Ejercicio;
             CN_CentrosContab.InsertarCentroContable(ref objCContab, ref Verificador);
             if (Verificador == "0")
             {
                 ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(1, 'Se ha guardado correctamente.')", true);
                 txtCentroContab.Text  = "";
                 txtDependencia.Text   = "";
                 txtDirector.Text      = "";
                 txtAdministrador.Text = "";
                 txtSaliente.Text      = "";
                 txtEntrante.Text      = "";
             }
             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);
     }
 }
 protected void GRDCargarDatosCentrosContab()
 {
     try
     {
         Multiview1.ActiveViewIndex = 0;
         CentrosContab objCentroContab = new CentrosContab();
         objCentroContab.Ejercicio = SesionUsu.Usu_Ejercicio;
         List <CentrosContab> list = new List <CentrosContab>();
         CN_CentrosContab.CContabGrid(ref objCentroContab, ref list);
         //SqlDataAdapter sda = new SqlDataAdapter(cmd);
         //DataSet ds = new DataSet();
         //sda.Fill(ds);//
         GRDCentrosContab.DataSource = list;
         GRDCentrosContab.DataBind();
         LBLncc.Text = "Total de centros contables: " + Convert.ToString(list.Count);
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, '" + ex.Message + ".')", true);
     }
 }
示例#12
0
        public void EliminarCContab(CentrosContab objCContab, ref string Verificador)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand Cmd     = null;

            try
            {
                String[] Parametros    = { "P_ID" };
                object[] Valores       = { objCContab.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);
            }
        }
示例#13
0
        public void InsertarCentroContable(ref CentrosContab objCentrosContab, ref string Verificador)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand Cmd     = null;

            try
            {
                String[] Parametros    = { "P_CLAVE", "P_DESCRIPCION", "P_DIRECTOR", "P_ADMINISTRADOR", "P_SALIENTE", "P_ENTRANTE", "P_EJERCICIO" };
                object[] Valores       = { objCentrosContab.C_Contab, objCentrosContab.Descrip, objCentrosContab.Director, objCentrosContab.Administrador, objCentrosContab.Saliente, objCentrosContab.Entrante, objCentrosContab.Ejercicio };
                String[] ParametrosOut = { "p_Bandera" };

                Cmd = CDDatos.GenerarOracleCommand("INS_CAT_C_CONTAB", ref Verificador, Parametros, Valores, ParametrosOut);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref Cmd);
            }
        }
示例#14
0
        public void Control_CierreEditar(ref CentrosContab ObjCentros_Contables, ref string Verificador)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand cmm     = null;

            try
            {
                string[] ParametrosIn  = { "P_ID_CONTROL_CIERRE", "P_MES_ANIO", "P_CIERRE_DEFINITIVO" };
                object[] Valores       = { ObjCentros_Contables.Id_Control_Cierre, ObjCentros_Contables.Mes_anio, ObjCentros_Contables.Cierre_Definitivo };
                string[] ParametrosOut =
                {
                    "p_Bandera"
                };

                OracleCommand Cmd = CDDatos.GenerarOracleCommand("UPD_SAF_CONTROL_CIERRE", ref Verificador, ParametrosIn, Valores, ParametrosOut);

                CDDatos.LimpiarOracleCommand(ref Cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
示例#15
0
        public void Control_CierreGral(ref CentrosContab ObjControl_Cierre, string Tipo, ref string Verificador)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand cmm     = null;

            try
            {
                string[] ParametrosIn  = { "P_MES_ANIO", "P_SISTEMA", "P_EJERCICIO", "P_TIPO" };
                object[] Valores       = { ObjControl_Cierre.Mes_anio, "PRESUPUESTO", ObjControl_Cierre.Ejercicio, Tipo };
                string[] ParametrosOut =
                {
                    "p_Bandera"
                };

                OracleCommand Cmd = CDDatos.GenerarOracleCommand("UPD_SAF_CONTROL_CIERRE_GRAL", ref Verificador, ParametrosIn, Valores, ParametrosOut);

                CDDatos.LimpiarOracleCommand(ref Cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
 protected void GRDCentrosContab_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (SesionUsu.Usu_TipoUsu == "SA")
         {
             Multiview1.ActiveViewIndex = 1;
             string        Verificador = string.Empty;
             CentrosContab objCContab  = new CentrosContab();
             objCContab.Id        = Convert.ToString(GRDCentrosContab.SelectedRow.Cells[2].Text);
             objCContab.Ejercicio = SesionUsu.Usu_Ejercicio;
             CN_CentrosContab.ObtenerDatosCContab(ref objCContab, ref Verificador);
             if (Verificador == "0")
             {
                 Session["SessionIdCContab"] = objCContab.Id;
                 txtCentroContab.Text        = objCContab.C_Contab;
                 txtDependencia.Text         = objCContab.Descrip;
                 txtDirector.Text            = objCContab.Director;
                 txtAdministrador.Text       = objCContab.Administrador;
                 txtEntrante.Text            = objCContab.Saliente;
                 txtSaliente.Text            = objCContab.Entrante;
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(1, '" + 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);
     }
 }
示例#17
0
        public void Control_CierreGral(ref CentrosContab ObjControl_Cierre, string Tipo, ref string Verificador)
        {
            CD_CentrosContab CDControl_Cierre = new CD_CentrosContab();

            CDControl_Cierre.Control_CierreGral(ref ObjControl_Cierre, Tipo, ref Verificador);
        }
示例#18
0
        public void Control_CierreEditar(ref CentrosContab ObjCentros_Contables, ref string Verificador)
        {
            CD_CentrosContab CDCentros_Contables = new CD_CentrosContab();

            CDCentros_Contables.Control_CierreEditar(ref ObjCentros_Contables, ref Verificador);
        }