diff --git a/wojilu.Installer/InstallerController.cs b/wojilu.Installer/InstallerController.cs index b8c80ccc..e025d3be 100755 --- a/wojilu.Installer/InstallerController.cs +++ b/wojilu.Installer/InstallerController.cs @@ -142,7 +142,7 @@ public class InstallerController : ControllerBase { updateSiteName( siteName ); // 5)安装app - int siteType = ctx.PostLong( "siteType" ); + int siteType = ctx.PostInt( "siteType" ); initSiteApp( siteType, user ); echoAjaxOk(); @@ -410,7 +410,7 @@ public class InstallerController : ControllerBase { return str; } catch (Exception ex) { - errors.Add( ex.Message ); + errors.Add( ex.Message + " 请检查用户名或密码是否正确。" ); return null; } } diff --git a/wojilu.Installer/Installers/HtmlInstallerHelper.cs b/wojilu.Installer/Installers/HtmlInstallerHelper.cs index 5e50f009..3dfee0f6 100755 --- a/wojilu.Installer/Installers/HtmlInstallerHelper.cs +++ b/wojilu.Installer/Installers/HtmlInstallerHelper.cs @@ -69,7 +69,7 @@ public class HtmlInstallerHelper { // 初始化当前app private ContentApp initApp( MvcContext ctx, IMemberApp mapp ) { IAppContext context = new AppContext(); - int appId = mapp.AppOid; + long appId = mapp.AppOid; context.Id = appId; ContentApp app = ContentApp.findById( appId ); diff --git a/wojilu.Test/Common/TreeTest.cs b/wojilu.Test/Common/TreeTest.cs index 51873e23..c1d6b10d 100755 --- a/wojilu.Test/Common/TreeTest.cs +++ b/wojilu.Test/Common/TreeTest.cs @@ -150,9 +150,9 @@ public class TreeTest { public class Node : INode { - public int Id { get; set; } + public long Id { get; set; } public string Name { get; set; } - public int ParentId { get; set; } + public long ParentId { get; set; } public string Title { get { return this.Name + this.Id + "....."; } diff --git a/wojilu.Test/Common/cvtTest.cs b/wojilu.Test/Common/cvtTest.cs index d6031fb4..7a3bf16b 100755 --- a/wojilu.Test/Common/cvtTest.cs +++ b/wojilu.Test/Common/cvtTest.cs @@ -98,6 +98,29 @@ public class cvtTest { } + [Test] + public void testLong() + { + // Int64.MaxValue=9223 37203 68547 75807 + + Assert.IsTrue( cvt.IsLong( "235" ) ); + Assert.IsTrue( cvt.IsLong( "0" ) ); + Assert.IsTrue( cvt.IsLong( "-235" ) ); + Assert.IsFalse( cvt.IsLong( "fdd" ) ); + + Assert.IsTrue( cvt.IsLong( "354656982" ) ); + Assert.IsTrue( cvt.IsLong( "-1354656982" ) ); + + Int64 maxValue = 9223372036854775807; + Assert.IsTrue( cvt.IsLong( maxValue.ToString() ) ); + Assert.IsFalse( cvt.IsLong( "19223372036854775807" ) ); + + String idStr = "66677854129116241"; + long[] ids = cvt.ToLongArray( idStr ); + Assert.AreEqual( 1, ids.Length ); + Assert.AreEqual( 66677854129116241, ids[0] ); + } + [Test] public void testToString() { diff --git a/wojilu.Test/Data/Entities.cs b/wojilu.Test/Data/Entities.cs index 1e21bcc1..5dc045fd 100755 --- a/wojilu.Test/Data/Entities.cs +++ b/wojilu.Test/Data/Entities.cs @@ -97,4 +97,65 @@ public class TProperty : CacheObject { } + + //-------------------------------------------------------- + + public class Book : CacheObject { + public string Weather { get; set; } + } + + + public class MenuMock : CacheObject, IComparable, INode { + + //public User Creator { get; set; } + public String Creator { get; set; } + + public int OrderId { get; set; } + + [NotSave] + public int OwnerId { + get { return 0; } + set { } + } + + [NotSave] + public String OwnerUrl { + get { return ""; } + set { } + } + + [NotSave] + public String OwnerType { + get { return "site"; } + set { } + } + + public long ParentId { get; set; } + public String RawUrl { get; set; } + public String Url { get; set; } + + public String Style { get; set; } + + public DateTime Created { get; set; } + public int OpenNewWindow { get; set; } + + + public int CompareTo( object obj ) { + + MenuMock menu = obj as MenuMock; + + if (OrderId > menu.OrderId) return -1; + if (OrderId < menu.OrderId) return 1; + if (base.Id > menu.Id) return 1; + if (base.Id < menu.Id) return -1; + return 0; + } + + public void updateOrderId() { + this.update(); + } + + } + + } diff --git a/wojilu.Test/Data/MemoryDBGeneric.cs b/wojilu.Test/Data/MemoryDBGeneric.cs new file mode 100755 index 00000000..e3649a3e --- /dev/null +++ b/wojilu.Test/Data/MemoryDBGeneric.cs @@ -0,0 +1,213 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; + +namespace wojilu.Test.Data { + + + [TestFixture] + public class MemoryDBGeneric { + + + + + + [Test] + public void testFindById() { + Book book = cdb.findById( 5 ); + Assert.IsNotNull( book ); + Assert.AreEqual( "zhangsan5", book.Name ); + + Book nullBook = cdb.findById( 999999999 ); + Assert.IsNull( nullBook ); + } + + [Test] + public void testFindAll() { + + IList list = cdb.findAll(); + Assert.AreEqual( 10, list.Count ); + } + + // 每次FindAll 得到的,都是缓存的副本, + // 并且 book.Delete() 只是移除缓存中的数据,对当前的副本(集合)并无影响 + [Test] + public void testDeleteAll() { + + IList all = cdb.findAll(); + + foreach (Book book in all) { + cdb.delete( book ); + } + + int result = cdb.findAll().Count; + + Assert.AreEqual( result, 0 ); + } + + // 随机删除 + [Test] + public void testDelete() { + Random rd = new Random(); + + for (int i = 0; i < 20; i++) { + int id = rd.Next( 1, 11 ); + Console.WriteLine( "随机ID:" + id ); + Book book = cdb.findById( id ); + if (book != null) { + cdb.delete( book ); + Console.WriteLine( "删除:" + id ); + } + } + + } + + [Test] + public void testDelete3() { + + IList all = cdb.findAll(); + Assert.AreEqual( 10, all.Count ); + + int deleteCount = 0; + int bookCount = all.Count; + for (int i = 0; i < bookCount; i++) { + cdb.delete( all[i] ); + deleteCount++; + } + + Assert.AreEqual( bookCount, deleteCount ); + + IList results = cdb.findAll(); + Assert.AreEqual( 0, results.Count ); + } + + + // findBy (index test) + //---------------------------------------------------------------------------------------------- + + [Test] + public void testFindBy() { + + IList books = cdb.findBy( "Name", "zhangsan5" ); + Assert.AreEqual( 1, books.Count ); + Book book = books[0]; + Assert.AreEqual( "hao10", book.Weather ); + + IList books2 = cdb.findBy( "Weather", "hao10" ); + Assert.AreEqual( 1, books2.Count ); + Book book2 = books2[0]; + Assert.AreEqual( "zhangsan5", book2.Name ); + } + + [Test] + public void testFindBy_Insert() { + + Book newBook = new Book { + Name = "zhangsan5", + Weather = "hao6" + }; + cdb.insert( newBook ); + + IList newBooks = cdb.findBy( "Name", "zhangsan5" ); + Assert.AreEqual( 2, newBooks.Count ); + Assert.AreEqual( "hao6", newBooks[1].Weather ); + + IList newBooks2 = cdb.findBy( "Weather", "hao6" ); + Assert.AreEqual( 2, newBooks2.Count ); + Assert.AreEqual( "zhangsan5", newBooks2[1].Name ); + + } + + [Test] + public void testFindBy_Update() { + + IList books = cdb.findBy( "Name", "zhangsan5" ); + Assert.AreEqual( 1, books.Count ); + Book book = books[0]; + + book.Name = "zhangsan8"; + cdb.update( book ); + + IList newBooks = cdb.findBy( "Name", "zhangsan5" ); + Assert.AreEqual( 0, newBooks.Count ); + + IList newBooks2 = cdb.findBy( "Name", "zhangsan8" ); + Assert.AreEqual( 2, newBooks2.Count ); + } + + [Test] + public void testFindBy_Delete() { + + IList books = cdb.findBy( "Name", "zhangsan5" ); + Assert.AreEqual( 1, books.Count ); + Book book = books[0]; + + cdb.delete( book ); + + IList newBooks = cdb.findBy( "Name", "zhangsan5" ); + Assert.AreEqual( 0, newBooks.Count ); + + int allCount = cdb.findAll().Count; + Assert.AreEqual( 9, allCount ); + + } + + [SetUp] + public void initData() { + Console.WriteLine( "------------------------------init data-------------------------------" ); + for (int i = 0; i < 10; i++) { + Book book = new Book(); + book.Name = "zhangsan" + (i + 1); + book.Weather = "hao" + ((i + 1) * 2); + cdb.insert( book ); + } + } + + [TearDown] + public void deleteAll() { + IList all = cdb.findAll(); + + foreach (Book book in all) { + cdb.delete( book ); + } + + } + + + [Test] + public void testMenuParentId() { + + List oldList = cdb.findAll(); + foreach (MenuMock menuMock in oldList) { + menuMock.delete(); + } + + for (int i = 0; i < 20; i++) { + MenuMock menu = new MenuMock(); + menu.Name = "menu" + i; + menu.insert(); + } + + + for (int i = 0; i < 20; i++) { + MenuMock menu = new MenuMock(); + menu.Name = "menu" + i; + menu.ParentId = i + 1; + menu.insert(); + } + + + List list = cdb.findAll(); + Assert.AreEqual( 40, list.Count ); + + Tree _tree = new Tree( list ); + var children = _tree.FindChildren( 3 ); + Assert.AreEqual( 1, children.Count ); + Assert.AreEqual( 23, children[0].getNode().Id ); + + } + + } +} diff --git a/wojilu.Test/Data/MemoryDBTest.cs b/wojilu.Test/Data/MemoryDBTest.cs new file mode 100755 index 00000000..f5300006 --- /dev/null +++ b/wojilu.Test/Data/MemoryDBTest.cs @@ -0,0 +1,183 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; + +namespace wojilu.Test.Data { + + + [TestFixture] + public class MemoryDBTest { + + + + [Test] + public void testFindById() { + Book book = new Book().findById( 5 ) as Book; + Assert.IsNotNull( book ); + Assert.AreEqual( "zhangsan5", book.Name ); + + Book nullBook = new Book().findById( 999999 ) as Book; + Assert.IsNull( nullBook ); + } + + [Test] + public void testFindAll() { + + IList list = new Book().findAll(); + Assert.AreEqual( 10, list.Count ); + } + + // 每次FindAll 得到的,都是缓存的副本, + // 并且 book.Delete() 只是移除缓存中的数据,对当前的副本(集合)并无影响 + [Test] + public void testDeleteAll() { + + IList all = new Book().findAll(); + + foreach (Book book in all) { + book.delete(); + } + + int result = new Book().findAll().Count; + + Assert.AreEqual( result, 0 ); + } + + // 随机删除 + [Test] + public void testDelete() { + Random rd = new Random(); + + for (int i = 0; i < 20; i++) { + int id = rd.Next( 1, 11 ); + Console.WriteLine( "随机ID:" + id ); + Book book = new Book().findById( id ) as Book; + if (book != null) { + book.delete(); + Console.WriteLine( "删除:" + id ); + } + } + + } + + [Test] + public void testDelete3() { + + Book mybook = new Book(); + IList all = mybook.findAll(); + Assert.AreEqual( 10, all.Count ); + + int deleteCount = 0; + int bookCount = all.Count; + for (int i = 0; i < bookCount; i++) { + Book book = all[i] as Book; + book.delete(); + deleteCount++; + } + + Assert.AreEqual( bookCount, deleteCount ); + + IList results = mybook.findAll(); + Assert.AreEqual( 0, results.Count ); + } + + + // findBy (index test) + //---------------------------------------------------------------------------------------------- + + [Test] + public void testFindBy() { + + List books = cdb.findBy( "Name", "zhangsan5" ); + Assert.AreEqual( 1, books.Count ); + Book book = books[0]; + Assert.AreEqual( "hao10", book.Weather ); + + List books2 = cdb.findBy( "Weather", "hao10" ); + Assert.AreEqual( 1, books2.Count ); + Book book2 = books2[0]; + Assert.AreEqual( "zhangsan5", book2.Name ); + + } + + [Test] + public void testFindBy_Insert() { + + Book newBook = new Book { + Name = "zhangsan5", + Weather = "hao6" + }; + newBook.insert(); + + IList newBooks = new Book().findBy( "Name", "zhangsan5" ); + Assert.AreEqual( 2, newBooks.Count ); + Assert.AreEqual( "hao6", ((Book)newBooks[1]).Weather ); + + IList newBooks2 = new Book().findBy( "Weather", "hao6" ); + Assert.AreEqual( 2, newBooks2.Count ); + Assert.AreEqual( "zhangsan5", ((Book)newBooks2[1]).Name ); + + } + + [Test] + public void testFindBy_Update() { + + IList books = new Book().findBy( "Name", "zhangsan5" ); + Assert.AreEqual( 1, books.Count ); + Book book = books[0] as Book; + + book.Name = "zhangsan8"; + book.update(); + + IList newBooks = new Book().findBy( "Name", "zhangsan5" ); + Assert.AreEqual( 0, newBooks.Count ); + + IList newBooks2 = new Book().findBy( "Name", "zhangsan8" ); + Assert.AreEqual( 2, newBooks2.Count ); + } + + [Test] + public void testFindBy_Delete() { + + IList books = new Book().findBy( "Name", "zhangsan5" ); + Assert.AreEqual( 1, books.Count ); + Book book = books[0] as Book; + + book.delete(); + + IList newBooks = new Book().findBy( "Name", "zhangsan5" ); + Assert.AreEqual( 0, newBooks.Count ); + + int allCount = new Book().findAll().Count; + Assert.AreEqual( 9, allCount ); + + } + + [SetUp] + public void initData() { + Console.WriteLine( "------------------------------init data-------------------------------" ); + for (int i = 0; i < 10; i++) { + Book book = new Book(); + book.Name = "zhangsan" + (i + 1); + book.Weather = "hao" + ((i + 1) * 2); + book.insert(); + } + } + + [TearDown] + public void deleteAll() { + IList all = new Book().findAll(); + + foreach (Book book in all) { + book.delete(); + } + + } + + + + } +} diff --git a/wojilu.Test/Jsons/Entities.cs b/wojilu.Test/Jsons/Entities.cs index bbb66966..86c9707d 100755 --- a/wojilu.Test/Jsons/Entities.cs +++ b/wojilu.Test/Jsons/Entities.cs @@ -90,4 +90,10 @@ public class Account { public List Roles { get; set; } } + public class MyComputer { + public long Id { get; set; } + public long ParentId { get; set; } + public string Name { get; set; } + } + } diff --git a/wojilu.Test/Jsons/JsonSerializeTest.cs b/wojilu.Test/Jsons/JsonSerializeTest.cs index 1d57c533..5f5ef4e7 100755 --- a/wojilu.Test/Jsons/JsonSerializeTest.cs +++ b/wojilu.Test/Jsons/JsonSerializeTest.cs @@ -406,6 +406,34 @@ public class JsonSerializeTest { Console.WriteLine( str ); } + + [Test] + public void testInt64() { + + var c = new MyComputer(); + c.Id = 1; + c.ParentId = 12; + c.Name = "hahahaha"; + + string strJson = JsonString.ConvertObject( c ); + + Console.WriteLine( strJson ); + + Assert.AreEqual( "{ \"Id\":1, \"Name\":\"hahahaha\", \"ParentId\":12 }", strJson ); + + c = new MyComputer(); + c.Id = 26677854129116241; + c.ParentId = 36677854129116241; + c.Name = "hahahaha"; + + strJson = JsonString.ConvertObject( c ); + + Console.WriteLine( strJson ); + + Assert.AreEqual( "{ \"Id\":26677854129116241, \"Name\":\"hahahaha\", \"ParentId\":36677854129116241 }", strJson ); + + } + } public class AdminMenuGroup { diff --git a/wojilu.Test/Orm/CRUD.Base.cs b/wojilu.Test/Orm/CRUD.Base.cs index 0fa29ee6..e6ef6871 100755 --- a/wojilu.Test/Orm/CRUD.Base.cs +++ b/wojilu.Test/Orm/CRUD.Base.cs @@ -621,7 +621,7 @@ public class CRUDBase { art.IsDelete = 0; art.OrderId = 5; art.insert(); - int id = art.Id; + long id = art.Id; art.Member = TMember.findById( 2 ); art.Cat = TCat.findById( 10 ); diff --git a/wojilu.Test/Orm/CRUD.Generic.cs b/wojilu.Test/Orm/CRUD.Generic.cs index bb5dd07e..d8591d7c 100755 --- a/wojilu.Test/Orm/CRUD.Generic.cs +++ b/wojilu.Test/Orm/CRUD.Generic.cs @@ -673,7 +673,7 @@ public class CRUDGeneric { art.IsDelete = 0; art.OrderId = 5; art.insert(); - int id = art.Id; + long id = art.Id; art.Member = TMember.findById( 2 ); art.Cat = TCat.findById( 10 ); diff --git a/wojilu.Test/Web/Mvc/LinkTest.cs b/wojilu.Test/Web/Mvc/LinkTest.cs index a7790e82..a16e349e 100755 --- a/wojilu.Test/Web/Mvc/LinkTest.cs +++ b/wojilu.Test/Web/Mvc/LinkTest.cs @@ -391,8 +391,8 @@ public class TestPostController : ControllerBase { public void Index() { } public void List() { } - public void Show( int id ) { } - public void Product( int id ) { } + public void Show( long id ) { } + public void Product( long id ) { } public void Add() { } } @@ -401,8 +401,8 @@ public class TestArticleController : ControllerBase { public void Index() { } public void List() { } - public void Show( int id ) { } - public void Product( int id ) { } + public void Show( long id ) { } + public void Product( long id ) { } } @@ -423,8 +423,8 @@ public class BlogController : ControllerBase { public void Index() { } public void List() { } - public void Show( int id ) { } - public void Product( int id ) { } + public void Show( long id ) { } + public void Product( long id ) { } public void Add() { } } @@ -438,8 +438,8 @@ public class TestCommentController : ControllerBase { public void Index() { } public void List() { } - public void Show( int id ) { } - public void Product( int id ) { } + public void Show( long id ) { } + public void Product( long id ) { } public void Add() { } } @@ -452,8 +452,8 @@ public class TestUserController : ControllerBase { public void Index() { } public void List() { } - public void Show( int id ) { } - public void Address( int id ) { } + public void Show( long id ) { } + public void Address( long id ) { } public void Add() { } } diff --git a/wojilu.Test/Web/Mvc/RouteTest.cs b/wojilu.Test/Web/Mvc/RouteTest.cs index 450f762a..4d42d417 100755 --- a/wojilu.Test/Web/Mvc/RouteTest.cs +++ b/wojilu.Test/Web/Mvc/RouteTest.cs @@ -731,6 +731,25 @@ public class RouteTest { //Assert.AreEqual( "lisi", rt2.getItem( "userName" ) ); } + [Test] + public void testLong() { + + string routecfg = @" +~/{controller}/{id}/{action}; +"; + + RouteTable.GetRoutes().Clear(); + RouteTable.Init( routecfg ); + + + Route result = RouteTool.RecognizePath( "blog/163304481793130496/show" ); + + Assert.AreEqual( "blog", result.controller ); + Assert.AreEqual( "show", result.action ); + Assert.AreEqual( 163304481793130496, result.id ); + Assert.AreEqual( 1, result.page ); + } + } @@ -772,4 +791,6 @@ public class RouteTest { // public wojilu.Common.Security.IRole GetUserRole( IMember user ) { return null; } //} + + } diff --git a/wojilu.Test/Web/Mvc/aActionTest.cs b/wojilu.Test/Web/Mvc/aActionTest.cs index 9e5f8383..7b3cf3ad 100755 --- a/wojilu.Test/Web/Mvc/aActionTest.cs +++ b/wojilu.Test/Web/Mvc/aActionTest.cs @@ -13,7 +13,7 @@ public class aActionTest { Console.WriteLine( "myAction" ); } - public void myActionWithId( int id ) { + public void myActionWithId( long id ) { Console.WriteLine( "myActionWithId+"+id ); } @@ -33,7 +33,7 @@ public class aActionTest { } - private void testAction( object obj, int id ) { + private void testAction( object obj, long id ) { aAction action = obj as aAction; if (action != null) { diff --git a/wojilu.Test/wojilu.Test.csproj b/wojilu.Test/wojilu.Test.csproj index fc4af52a..0cfa16ce 100755 --- a/wojilu.Test/wojilu.Test.csproj +++ b/wojilu.Test/wojilu.Test.csproj @@ -58,6 +58,8 @@ + + diff --git a/wojilu/ORM/Utils/FillUtil.cs b/wojilu/ORM/Utils/FillUtil.cs index e10b2ddc..53101762 100755 --- a/wojilu/ORM/Utils/FillUtil.cs +++ b/wojilu/ORM/Utils/FillUtil.cs @@ -43,7 +43,7 @@ internal class FillUtil { try { if (ep.IsEntity || ep.IsAbstractEntity) { - setEntityPropertyValueById( obj, state, ep, rd.GetInt32( i ) ); + setEntityPropertyValueById( obj, state, ep, rd.GetInt64( i ) ); } else { ep.SetValue( obj, getReaderValue( rd, i, fdvalue, ep.Type ) ); @@ -61,7 +61,7 @@ internal class FillUtil { return obj; } - private static void setEntityPropertyValueById( IEntity obj, ObjectInfo state, EntityPropertyInfo property, int pid ) { + private static void setEntityPropertyValueById( IEntity obj, ObjectInfo state, EntityPropertyInfo property, long pid ) { if (!property.IsAbstractEntity) { IEntity objValue = Entity.New( property.Type.FullName ); diff --git a/wojilu/Serialization/JsonString.cs b/wojilu/Serialization/JsonString.cs index 5ef032d9..d0504258 100755 --- a/wojilu/Serialization/JsonString.cs +++ b/wojilu/Serialization/JsonString.cs @@ -62,6 +62,7 @@ public class JsonString { if (rft.IsInterface( t, typeof( IDictionary ) )) return ConvertDictionary( (IDictionary)obj, isBreakline ); if (t == typeof( int ) || + t == typeof( long ) || t == typeof( decimal ) || t == typeof( double )) { return obj.ToString(); @@ -365,6 +366,7 @@ public class JsonString { private static bool shouldPass( EntityPropertyInfo info ) { if (info.Type == typeof( int )) return false; + if (info.Type == typeof( long )) return false; if (info.Type == typeof( string )) return false; if (info.Type == typeof( decimal )) return false; if (info.Type == typeof( DateTime )) return false; diff --git a/wojilu/Serialization/SimpleJsonString.cs b/wojilu/Serialization/SimpleJsonString.cs index ae0c9ee8..6b15ddbd 100755 --- a/wojilu/Serialization/SimpleJsonString.cs +++ b/wojilu/Serialization/SimpleJsonString.cs @@ -80,7 +80,7 @@ public class SimpleJsonString { Object propertyValue = ReflectionUtil.GetPropertyValue( obj, info.Name ); if (propertyValue == null) continue; - if (info.PropertyType == typeof( int ) || info.PropertyType == typeof( decimal )) { + if (info.PropertyType == typeof( int ) || info.PropertyType == typeof( long ) || info.PropertyType == typeof( decimal )) { builder.AppendFormat( "{0}:{1}", info.Name, propertyValue ); } else if (info.PropertyType == typeof( Boolean )) { diff --git a/wojilu/Web/Mvc/Routes/RouteTool.cs b/wojilu/Web/Mvc/Routes/RouteTool.cs index 7be06ab7..eb3da8bb 100755 --- a/wojilu/Web/Mvc/Routes/RouteTool.cs +++ b/wojilu/Web/Mvc/Routes/RouteTool.cs @@ -252,8 +252,8 @@ public class RouteTool { if (result.getItem( "query" ) != null) result.setQuery( result.getItem( "query" ) ); if (result.getItem( "owner" ) != null) result.setOwner( result.getItem( "owner" ) ); if (result.getItem( "ownertype" ) != null) result.setOwnerType( result.getItem( "ownertype" ) ); - if (result.getItem( "id" ) != null) result.setId( cvt.ToInt( result.getItem( "id" ) ) ); - if (result.getItem( "appid" ) != null) result.setAppId( cvt.ToInt( result.getItem( "appid" ) ) ); + if (result.getItem( "id" ) != null) result.setId( cvt.ToLong( result.getItem( "id" ) ) ); + if (result.getItem( "appid" ) != null) result.setAppId( cvt.ToLong( result.getItem( "appid" ) ) ); int page = 1; if (result.getItem( "page" ) != null) {