Exemplo n.º 1
0
        public virtual int GetRecordsCount()
        {
            string condition = " 1 = 1 ";
            string statement = SqlStatememtGenerator.Select_ReadSomeColumnsByCondition(tableName, new string[] { "count(*)" }, condition);

            return Convert.ToInt32(executer.ExecuteScalarSelectStatement(statement, null));
        }
Exemplo n.º 2
0
        public int GetAssociationsCountOfSecondTable(T2 secondTableVO)
        {
            string condition = string.Format("{0}=@{0}", secondTableIdColumnName);
            string statement = SqlStatememtGenerator.Select_ReadSomeColumnsByCondition(tableName, new string[] { "count(*)" }, condition);

            SqlCeParameter[] parameters = new SqlCeParameter[1];
            parameters[0] = MakeSqlParameter(secondTableIdColumnName, secondTableVO.Id);

            int count = Convert.ToInt32(executer.ExecuteScalarSelectStatement(statement, parameters).ToString());

            return(count);
        }
Exemplo n.º 3
0
        public int GetMaxId()
        {
            string[] temp = new string[]{
                string.Format("max({0})", idColumnName)
            };
            string statement = SqlStatememtGenerator.Select_ReadSomeColumnsByCondition(tableName, temp, "1=1");

            try
            {
                int result = Convert.ToInt32(executer.ExecuteScalarSelectStatement(statement, null));
                return result;
            }
            catch
            {
                return -1;
            }

        }