Ejemplo n.º 1
0
    protected void Buscar()
    {
        Ocultar();
        fondoPensiones _fondoPensiones = new fondoPensiones(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        DataTable _dataTable = new DataTable();

        switch (this.DropDownList_BUSCAR.SelectedValue)
        {
        case "NOMBRE":
            _dataTable = _fondoPensiones.ObtenerPorNombre(this.TextBox_BUSCAR.Text);
            break;
        }

        if (_dataTable.Rows.Count > 0)
        {
            GridView_RESULTADOS_BUSQUEDA.DataSource = _dataTable;
            GridView_RESULTADOS_BUSQUEDA.DataBind();
            Mostrar(Acciones.BusquedaEncontro);
        }
        else
        {
            if (!String.IsNullOrEmpty(_fondoPensiones.MensajeError))
            {
                Informar(Label_MENSAJE, "Error: Consulte con el Administrador: " + _fondoPensiones.MensajeError, Proceso.Error);
            }
            else
            {
                Informar(Label_MENSAJE, "ADVERTENCIA: No se encontró información para " + this.DropDownList_BUSCAR.SelectedItem + " : " + this.TextBox_BUSCAR.Text, Proceso.Correcto);
            }
            Mostrar(Acciones.BusquedaNoEncontro);
        }
        _dataTable.Dispose();
    }
Ejemplo n.º 2
0
 protected void GridView_RESULTADOS_BUSQUEDA_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(this.GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["id"].ToString()))
     {
         fondoPensiones _fondoPensiones = new fondoPensiones(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
         Cargar(_fondoPensiones.ObtenerPorIdAFP(Convert.ToDecimal(this.GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["id"].ToString())));
     }
     Ocultar();
     Mostrar(Acciones.Visualiza);
     Bloquear(Acciones.Visualiza);
 }
Ejemplo n.º 3
0
    private void Modificar()
    {
        fondoPensiones _fondoPensiones = new fondoPensiones(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        if (_fondoPensiones.Actualizar(Convert.ToDecimal(this.TextBox_ID.Text), TextBox_NIT.Text, TextBox_DV.Text, this.TextBox_COD_ENTIDAD.Text, TextBox_NOM_ENTIDAD.Text, TextBox_DIR_ENTIDAD.Text, TextBox_TEL_ENTIDAD.Text, TextBox_CONTACTO.Text, TextBox_CARGO.Text, CheckBox_ESTADO.Checked))
        {
            if (!String.IsNullOrEmpty(_fondoPensiones.MensajeError))
            {
                Informar(Label_MENSAJE, "Error: Consulte con el Administrador: " + _fondoPensiones.MensajeError, Proceso.Error);
            }
        }
        else
        {
            Informar(Label_MENSAJE, "La entidad fue actualizada correctamente.", Proceso.Correcto);
            TextBox_ID.Text = ID.ToString();
        }
        Ocultar();
        Mostrar(Acciones.Modifica);
        Bloquear(Acciones.Modifica);
    }
Ejemplo n.º 4
0
    private void Guardar()
    {
        fondoPensiones _fondoPensiones = new fondoPensiones(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        Decimal        ID = _fondoPensiones.Adicionar(TextBox_NIT.Text, TextBox_DV.Text, this.TextBox_COD_ENTIDAD.Text, TextBox_NOM_ENTIDAD.Text, TextBox_DIR_ENTIDAD.Text,
                                                      TextBox_TEL_ENTIDAD.Text, TextBox_CONTACTO.Text, TextBox_CARGO.Text);

        if (ID == 0)
        {
            if (!String.IsNullOrEmpty(_fondoPensiones.MensajeError))
            {
                Informar(Label_MENSAJE, "Error: Consulte con el Administrador: " + _fondoPensiones.MensajeError, Proceso.Error);
            }
        }
        else
        {
            Informar(Label_MENSAJE, "La entidad fue creada correctamente y se le asignó el ID: " + ID.ToString() + ".", Proceso.Correcto);
            TextBox_ID.Text = ID.ToString();
        }
        Ocultar();
        Mostrar(Acciones.Guarda);
        Bloquear(Acciones.Guarda);
    }