温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:人才网初学者工具包源码
当前文件路径:JobSiteStarterKit/App_Code/BOL/Country.cs

1Using directives 11
//该源码下载自www.51aspx.com(51aspx.com) 12
13
namespace JobSiteStarterKit.BOL 14
{ 15
public class Country 16
{ 17
public Country() 18
{ 19
} 20
21
private string strCountryName; 22
private int intCountryID; 23
24
public string CountryName 25
{ 26
get 27
{ 28
return strCountryName; 29
} 30
set 31
{ 32
strCountryName = value; 33
} 34
} 35
36
public int CountryID 37
{ 38
get 39
{ 40
return intCountryID; 41
} 42
set 43
{ 44
intCountryID = value; 45
} 46
} 47
48
49
public int InsertCountry(Country c) 50
{ 51
DBAccess db = new DBAccess(); 52
SqlParameter p = new SqlParameter("@iCountryID", 0); 53
p.Direction = ParameterDirection.Output; 54
db.AddParameter("@sCountryName", c.CountryName); 55
db.AddParameter(p); 56
return db.ExecuteNonQuery("JobsDb_Countries_Insert"); 57
58
} 59
60
public int UpdateCountry(Country c) 61
{ 62
DBAccess db = new DBAccess(); 63
db.AddParameter("@iCountryID", c.CountryID); 64
db.AddParameter("@sCountryName", c.CountryName); 65
return db.ExecuteNonQuery("JobsDb_Countries_Update"); 66
} 67
68
public DataSet SelectCountries() 69
{ 70
DBAccess db = new DBAccess(); 71
return db.ExecuteDataSet("JobsDb_Countries_SelectAll"); 72
} 73
74
75
76
public static DataSet GetCountries() 77
{ 78
DBAccess db = new DBAccess(); 79
return db.ExecuteDataSet("JobsDb_Countries_SelectAll"); 80
} 81
82
83
public static string GetCountryName(int id) 84
{ 85
DBAccess db = new DBAccess(); 86
db.AddParameter("@iCountryID", id); 87
return db.ExecuteScalar("JobsDb_Countries_GetCountryName").ToString(); 88
} 89
90
} 91
} 92






}