温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:iBatisNet入门示例源码(操作GridView和DetailsView)
当前文件:
IBatisNet_GridView_DetailsView_QuikStart/IBatisNetDemo/Service/PersonService.cs[2K,2009-6-12 11:44:51],打开代码结构图
IBatisNet_GridView_DetailsView_QuikStart/IBatisNetDemo/Service/PersonService.cs[2K,2009-6-12 11:44:51],打开代码结构图1Apache Notice 24
using System; 25
using System.Collections.Generic; 26
using System.Text; 27
using IBatisNetDemo.Domain; 28
29
/// download from www.51aspx.com(51aspx.com) 30
31
namespace IBatisNetDemo.Service 32
{ 33
public class PersonService : BaseService 34
{ 35
36
public PersonService() 37
{ 38
39
} 40
41
public IList<Person> GetAllPerson() 42
{ 43
IList<Person> list = null; 44
list = SqlMap.QueryForList<Person>("SelectAllPerson", null); 45
return list; 46
} 47
48
public Person GetPerson(int Id) 49
{ 50
Person person = SqlMap.QueryForObject<Person>("", Id); 51
return person; 52
} 53
54
public int Create(Person person) 55
{ 56
int Id = (int)SqlMap.Insert("InsertPerson", person); 57
SqlMap.CommitTransaction(); 58
59
60
return Id; 61
} 62
63
public void Update(Person person) 64
{ 65
SqlMap.Update("UpdatePerson", person); 66
} 67
68
public void Delete(Person person) 69
{ 70
SqlMap.Delete("DeletePerson", person); 71
} 72
73
74
} 75
} 76






* $Header: $
*******************************************************************************

