Exemple #1
0
 protected void grv_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         ImageButton btnExcluir = (ImageButton)e.Row.FindControl("btnExcluir");
         if (btnExcluir != null)
         {
             btnExcluir.CommandArgument = e.Row.RowIndex.ToString();
             CFG_DeficienciaDetalhe ent = (e.Row.DataItem as CFG_DeficienciaDetalhe) ?? new CFG_DeficienciaDetalhe {
                 PermiteExcluir = true
             };
             btnExcluir.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_excluir
                                  &&
                                  (ent.IsNew || ent.PermiteExcluir);
         }
     }
 }
Exemple #2
0
        public static string RetornaValorDetalhado(REL_GraficoAtendimentoFiltrosFixos tipoFiltro, string valor)
        {
            string[] codDetalhe = valor.Split(',');
            string   retorno    = string.Empty;

            switch (tipoFiltro)
            {
            case REL_GraficoAtendimentoFiltrosFixos.DetalheDeficiencia:
                List <string> valoresDetalhados = new List <string>();
                foreach (var item in codDetalhe)
                {
                    CFG_DeficienciaDetalhe def = new CFG_DeficienciaDetalhe {
                        dfd_id = Convert.ToInt32(item)
                    };
                    def = CFG_DeficienciaDetalheBO.GetDetalhamento(def);
                    valoresDetalhados.Add(def.dfd_nome);
                }
                codDetalhe = valoresDetalhados.ToArray();

                if (codDetalhe.Length == 1)
                {
                    retorno = codDetalhe[0];
                }
                else if (codDetalhe.Length == 2)
                {
                    retorno = codDetalhe[0] + " e " + codDetalhe[1];
                }
                else if (codDetalhe.Length >= 3)
                {
                    string[] concat = new string[codDetalhe.Length - 1];
                    Array.Copy(codDetalhe, 0, concat, 0, codDetalhe.Length - 1);

                    retorno  = string.Join(", ", concat);
                    retorno += " e " + codDetalhe[codDetalhe.Length - 1];
                }
                else
                {
                    retorno = string.Empty;
                }
                break;

            case REL_GraficoAtendimentoFiltrosFixos.FaixaIdade:
                retorno = codDetalhe.Length >= 2 ? codDetalhe[0] + " até " + codDetalhe[1] + " anos" : string.Empty;
                break;

            case REL_GraficoAtendimentoFiltrosFixos.Sexo:
                retorno = codDetalhe.Length >= 1 ? MetodosExtensao.SexoFormatado(Convert.ToInt32(codDetalhe[0])) : string.Empty;
                break;

            case REL_GraficoAtendimentoFiltrosFixos.PeriodoPreenchimento:
                retorno = codDetalhe.Length >= 2 ? codDetalhe[0] + " até " + codDetalhe[1] : string.Empty;
                break;

            case REL_GraficoAtendimentoFiltrosFixos.RacaCor:
                retorno = codDetalhe.Length >= 1 ? MetodosExtensao.RacaCorFormatado(Convert.ToInt32(codDetalhe[0])) : string.Empty;
                break;

            default:
                break;
            }
            return(retorno);
        }