public IList <Citacao> GetCitacoesByIdFila(int idFila)
        {
            string strQuery = @"SELECT
                                    R.Id
                                   ,R.Client_id AS IdCliente
                                   ,R.Username AS Autor
                                   ,R.Date AS Data
                                   ,R.Text AS Texto
                                   ,R.Site AS Fonte
                                   ,R.Image AS UrlProfile
                                   ,R.Url AS LinkExterno
                                   ,R.Status
                                   ,R.Type
                                   ,R.Date_Capture AS DataCaptura
                                   ,R.Date_Classification AS DataClassificacao
                                FROM Results R
                                JOIN Clients C WITH (NOLOCK)
                                    ON R.Client_id = C.Id
                                JOIN Filas_clientes FC WITH (NOLOCK)
                                    ON C.Id = FC.idCliente
                                WHERE C.status <> 3
                                AND R.Status = 0
                                AND R.Type = 0
                                AND FC.idFila = @IdFila
                                ORDER BY R.Date DESC";

            return(DataBaseClassificacao.Query <Citacao>(strQuery, new { IdFila = idFila }, null, true, 500, CommandType.Text).ToArray());
        }
        public IList <Cliente> ListAll()
        {
            string strQuery = @"SELECT
                                    Id
                                   ,Name
                                   ,Status
                                   ,group_id AS GroupId
                                   ,Guid
                                   ,UF
                                   ,Cidade
                                   ,Macrorregiao
                                FROM Clients";

            return(DataBaseClassificacao.Query <Cliente>(strQuery, null, null, true, 500, CommandType.Text).ToArray());
        }
        public IList <Citacao> ListAll()
        {
            string strQuery = @"SELECT
                                    Id
                                   ,Client_id AS IdCliente
                                   ,Username AS Autor
                                   ,Date AS Data
                                   ,Text AS Texto
                                   ,Site AS Fonte
                                   ,Image AS UrlProfile
                                   ,Url AS LiknExterno
                                   ,Status
                                   ,Type
                                   ,Date_Capture AS DataCaptura
                                   ,Date_Classification AS DataClassificacao
                                FROM Results WHERE Client_id = 781 AND Date > '2016-01-01'";

            return(DataBaseClassificacao.Query <Citacao>(strQuery, null, null, true, 500, CommandType.Text).ToArray());
        }
        public void Update(Fila obj)
        {
            string strQuery = @"UPDATE Fila SET Nome = @NomeFila WHERE Id = @IdFila";

            DataBaseClassificacao.Execute(strQuery, new { IdFila = obj.Id, NomeFila = obj.Nome }, null, 500, CommandType.Text);
        }
        public IList <Fila> ListAll()
        {
            string strQuery = @"SELECT IdFila AS Id, Nome FROM Fila";

            return(DataBaseClassificacao.Query <Fila>(strQuery, null, null, true, 500, CommandType.Text).ToArray());
        }
        public Fila Insert(Fila obj)
        {
            string strQuery = @"INSERT INTO Fila (Nome) VALUES (@NomeFila)";

            return(DataBaseClassificacao.QueryFirstOrDefault <Fila>(strQuery, new { NomeFila = obj.Nome }, null, 500, CommandType.Text));
        }
        public Fila GetById(int id)
        {
            string strQuery = @"SELECT * FROM Fila WHERE Id = @IdFila";

            return(DataBaseClassificacao.QueryFirstOrDefault <Fila>(strQuery, new { IdFila = id }, null, 500, CommandType.Text));
        }
        public void Delete(Fila obj)
        {
            string strQuery = @"DELETE FROM Fila WHERE Id = @IdFila";

            DataBaseClassificacao.Execute(strQuery, new { IdFila = obj.Id }, null, 500, CommandType.Text);
        }