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

1Using directives 10
11
namespace JobSiteStarterKit.BOL 12
{ 13
public class EducationLevel 14
{ 15
private int intEduLevelID; 16
private string strEduLevelName; 17
18
public int EducationLevelID 19
{ 20
get 21
{ 22
return intEduLevelID; 23
} 24
set 25
{ 26
intEduLevelID=value; 27
} 28
} 29
30
public string EducationLevelName 31
{ 32
get 33
{ 34
return strEduLevelName; 35
} 36
set 37
{ 38
strEduLevelName=value; 39
} 40
} 41
42
43
public static DataSet GetEducationLevels() 44
{ 45
DBAccess db = new DBAccess(); 46
return db.ExecuteDataSet("JobsDb_EducationLevels_SelectAll"); 47
} 48
49
public static string GetEducationLevelName(int id) 50
{ 51
DBAccess db = new DBAccess(); 52
db.AddParameter("@iEducationLevelID", id); 53
return db.ExecuteScalar("JobsDb_EducationLevels_GetLevelName").ToString(); 54
} 55
56
public static int Insert(EducationLevel l) 57
{ 58
DBAccess db = new DBAccess(); 59
db.AddParameter("@sEducationLevelName", l.EducationLevelName); 60
SqlParameter p = new SqlParameter("@iEducationLevelID", SqlDbType.Int); 61
p.Direction = ParameterDirection.Output; 62
db.AddParameter(p); 63
64
int retval = db.ExecuteNonQuery("JobsDb_EducationLevels_Insert"); 65
if (retval == 1) 66
{ 67
return int.Parse(p.Value.ToString()); 68
} 69
else 70
{ 71
return -1; 72
} 73
} 74
75
public static int Update(EducationLevel l) 76
{ 77
DBAccess db = new DBAccess(); 78
db.AddParameter("@iEducationLevelID", l.EducationLevelID); 79
db.AddParameter("@sEducationLevelName", l.EducationLevelName); 80
return db.ExecuteNonQuery("JobsDb_EducationLevels_Update"); 81
} 82
83
public static int Delete(EducationLevel e) 84
{ 85
DBAccess db = new DBAccess(); 86
db.AddParameter("@iEducationLevelID",e.EducationLevelID); 87
return db.ExecuteNonQuery("JobsDb_EducationLevels_Delete"); 88
} 89
90
91
} 92
} 93





}