Example #1
0
    private void traer_PendientesAprobacion_Agrupada()
    {
        int      total  = 0;
        DateTime?fechaD = txt_Fecha_D.Text == "" ? (DateTime?)null : txt_Fecha_D.Value;
        DateTime?fechaH = txt_Fecha_H.Text == "" ? (DateTime?)null : txt_Fecha_H.Value;

        lblMjeListaPendientes.Text    = string.Empty;
        pnlListaNovPendientes.Visible = true;
        lbl_Total.Text = string.Empty;
        string MyLog = string.Empty;

        try
        {
            bool entregaDocumentacionEnFGS = true;
            MyLog              = "Parametros de busqueda son FechaDesde:  " + fechaD + " FechaHasta: " + fechaH;
            IdPrestador        = ddl_Prestador.SelectedValue == "-1" ? (long?)null : long.Parse(ddl_Prestador.SelectedValue);
            listaNovSinAprobar = Novedad.Novedades_Traer_PendientesAprobacion_Agrupada(IdPrestador, String.Empty, 0, fechaD, fechaH, entregaDocumentacionEnFGS, out total);

            if (listaNovSinAprobar != null)
            {
                if (listaNovSinAprobar.Count > 0)
                {
                    foreach (var item in listaNovSinAprobar)
                    {
                        item.Denominacion = item.Denominacion == "" ? "    Sin Informar   " : item.Denominacion;
                    }

                    gvNovPendientesApr.DataSource = listaNovSinAprobar;
                    gvNovPendientesApr.DataBind();
                    lbl_Total.Text = " " + total;
                }
                else
                {
                    MensajeOkEnLabel(lblMjeListaPendientes, "No se encontraron resultados para la busqueda.");
                }
            }
            else
            {
                MensajeErrorEnLabel(lblMjeListaPendientes, "Se produjo error interno en la busqueda de novedades pendientes de aprobacion.");
                MyLog += " Error por retornar NULL";
                log.Error(string.Format("Error:{0}", MyLog));
                log.Error(string.Format("Error:{0}->{1}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod()));
                lbl_Total.Text = string.Empty;
            }
        }
        catch (Exception ex)
        {
            MensajeErrorEnLabel(lblMjeListaPendientes, "Se produjo error interno en la busqueda de novedades pendientes de aprobacion.");
            log.Error(lblMjeListaPendientes.Text);
            log.Error(string.Format("Error:{0}", MyLog));
            log.Error(string.Format("Error:{0}->{1}->{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message));
        }
    }