Пример #1
0
    protected void btn_CambiarEntidad_Click(object sender, EventArgs e)
    {
        lbl_Errores.Text    = string.Empty;
        lbl_Errores.Visible = false;

        txt_paramPrestador.Text = string.Empty;
        cmbo_CriterioBusq.ClearSelection();
        cmbo_CriterioBusq.SelectedIndex = 0;

        DG_TraePrestadores.DataSource = null;
        DG_TraePrestadores.DataBind();
        DG_TraePrestadores.CurrentPageIndex = 0;
        DG_TraePrestadores.Visible          = false;

        mpe_BuscoPrestador.Show();
        cmbo_CriterioBusq.Focus();
    }
Пример #2
0
    private void Mostrar_Prestadores()
    {
        if (HayErrores())
        {
            mpe_BuscoPrestador.Show();
            return;
        }

        DG_TraePrestadores.Visible = true;

        try
        {
            log.DebugFormat("Voy a buscar un nuevo prestador por {0} con el valor {1}", cmbo_CriterioBusq.SelectedItem.Text, txt_paramPrestador.Text);
            switch (int.Parse(cmbo_CriterioBusq.SelectedItem.Value))
            {
            case 1:
                oListPrestadores = ANSES.Microinformatica.DAT.Negocio.Prestador.TraerPrestadoresAdm(txt_paramPrestador.Text.ToString(), int.Parse(cmbo_CriterioBusq.SelectedItem.Value), string.Empty);
                break;

            case 2:
                oListPrestadores = ANSES.Microinformatica.DAT.Negocio.Prestador.TraerPrestadoresAdm(string.Empty, int.Parse(txt_paramPrestador.Text.ToString()), string.Empty);
                break;

            case 3:
                oListPrestadores = ANSES.Microinformatica.DAT.Negocio.Prestador.TraerPrestadoresAdm(string.Empty, 0, txt_paramPrestador.Text);
                break;
            }

            List <WSPrestador.Prestador> oListPrestadoresFiltrados = new List <WSPrestador.Prestador>();

            if (oListPrestadores.Count > 0)
            {
                if (VariableSession.esSoloEntidades)
                {
                    oListPrestadoresFiltrados = new List <WSPrestador.Prestador>(from s in oListPrestadores  where s.EntregaDocumentacionEnFGS == false select s).ToList();
                    oListPrestadores.Clear();
                    oListPrestadores = oListPrestadoresFiltrados;
                }
                else if (VariableSession.esSoloArgenta)
                {
                    oListPrestadoresFiltrados = new List <WSPrestador.Prestador>(from s in oListPrestadores where s.EntregaDocumentacionEnFGS select s).ToList();
                    oListPrestadores.Clear();
                    oListPrestadores = oListPrestadoresFiltrados;
                }

                DG_TraePrestadores.DataSource = oListPrestadores;
                DG_TraePrestadores.DataBind();

                if (oListPrestadores.Count == 1)
                {
                    DG_TraePrestadores.Visible       = false;
                    DG_TraePrestadores.SelectedIndex = 0;
                    GurdarDatosPrestadorEnSession();
                }
                else if (oListPrestadores.Count == 0)
                {
                    DG_TraePrestadores.Visible = false;
                    lbl_Errores.Text           = Util.FormatoError("No existen Entidades para el valor ingresado.");
                    lbl_Errores.Visible        = true;

                    mpe_BuscoPrestador.Show();
                }
                else
                {
                    mpe_BuscoPrestador.Show();
                }
            }
            else
            {
                log.Debug("No existen Entidades para el valor ingresado.");

                DG_TraePrestadores.Visible = false;
                lbl_Errores.Text           = Util.FormatoError("No existen Entidades para el valor ingresado.");
                lbl_Errores.Visible        = true;

                mpe_BuscoPrestador.Show();
            }
        }
        catch (Exception err)
        {
            if (log.IsErrorEnabled)
            {
                log.ErrorFormat("Se produjo el siguiente error >> {0}", err.Message);
            }

            DG_TraePrestadores.Visible = false;

            lbl_Errores.Text    = Util.FormatoError("No se pudo realizar la acción solicitada. Intentelo en otro momento.");
            lbl_Errores.Visible = true;
            mpe_BuscoPrestador.Show();
        }
    }