示例#1
0
        /// <summary>
        /// Retorna as tabelas para um determinado filtro.
        /// </summary>
        /// <param name="tipo"></param>
        /// <param name="dataIni"></param>
        /// <param name="dataFim"></param>
        /// <returns></returns>
        public KeyValuePair <int, string>[] GetTabelas(string tipo, string dataIni, string dataFim, string campo, uint idFunc)
        {
            if (String.IsNullOrEmpty(tipo))
            {
                return new KeyValuePair <int, string>[] { new KeyValuePair <int, string>(0, "Todos (selecione um Tipo)") }
            }
            ;

            DadosFiltro <int, string>[] filtros = GetFiltro <int, string>("l.tabela", null, tipo, dataIni, dataFim, 0,
                                                                          campo, idFunc, true, true);

            List <KeyValuePair <int, string> > retorno = new List <KeyValuePair <int, string> >();

            foreach (DadosFiltro <int, string> f in filtros)
            {
                retorno.Add(new KeyValuePair <int, string>(f.Valor, f.Valor == 0 ? "Todos" :
                                                           f.Tipo == "Alt" ? LogAlteracao.GetDescrTabela(f.Valor) : LogCancelamento.GetDescrTabela(f.Valor)));
            }

            retorno.Sort(new Comparison <KeyValuePair <int, string> >(
                             delegate(KeyValuePair <int, string> x, KeyValuePair <int, string> y)
            {
                return(x.Key > 0 ? x.Value.CompareTo(y.Value) : x.Key.CompareTo(y.Key));
            }
                             ));

            return(retorno.ToArray());
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    int    tabela      = Glass.Conversoes.StrParaInt(Request["tabela"]);
                    string descrTabela = LogAlteracao.GetDescrTabela(tabela);
                    Page.Title += descrTabela;
                }
                catch { }
            }

            hdfExibirAdmin.Value = UserInfo.GetUserInfo.IsAdminSync.ToString();
        }