Exemplo n.º 1
0
        public object Execute(ISession session)
        {
            //try
            //{
            IDbCommand cmd = session.Connection.CreateCommand();

            cmd.CommandText = ActiveRecordHelp.GetFilgerCount(cmd, _start, _limit, _sort, _dir, _tableName, _primaryKey, _filters, _otherWhere, _otherParameter);
            return(cmd.ExecuteScalar());
            //}
            //catch (Exception ex)
            //{ return 0; }
        }
Exemplo n.º 2
0
        public object Execute(ISession session)
        {
            CommonDictionary dic   = ActiveRecordHelp.GetFilgerCount(_tableName, _filters, _otherWhere, _otherParameter);
            ISQLQuery        query = session.CreateSQLQuery(dic.ContentSql);

            if (dic.Parameters != null)
            {
                foreach (DictionaryEntry par in dic.Parameters)
                {
                    query.SetParameter(par.Key.ToString(), par.Value);
                }
            }

            return(query.List()[0]);
        }