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

1Using directives#region Using directives 2
3
using System; 4
using System.Collections.Generic; 5
using System.Text; 6
using System.Data; 7
using JobSiteStarterKit.DAL; 8
using System.Data.SqlClient; 9
using System.Web; 10
11
#endregion 12
//该源码下载自www.51aspx.com(51aspx.com) 13
14
namespace JobSiteStarterKit.BOL 15
...{ 16
public class JobPosting 17
...{ 18
19
Member Variables#region Member Variables 20
21
private int intJobPostingID; 22
private int intCompanyID; 23
private string strContactPerson; 24
private string strTitle; 25
private string strDepartment; 26
private string strJobCode; 27
private string strCity; 28
private int intStateID; 29
private int intCountryID; 30
private int intEducationLevelID; 31
private int intJobTypeID; 32
private decimal dblMinSalary; 33
private decimal dblMaxSalary; 34
private string strDescription; 35
private DateTime dtPostingDate=DateTime.Now; 36
private string strPostedBy=HttpContext.Current.Profile.UserName; 37
38
#endregion 39
40
Public Properties#region Public Properties 41
42
public int JobPostingID 43
...{ 44
get 45
...{ 46
return intJobPostingID; 47
} 48
set 49
...{ 50
intJobPostingID=value; 51
} 52
} 53
54
public int CompanyID 55
...{ 56
get 57
...{ 58
return intCompanyID; 59
} 60
set 61
...{ 62
intCompanyID = value; 63
} 64
} 65
66
public string ContactPerson 67
...{ 68
get 69
...{ 70
return strContactPerson; 71
} 72
set 73
...{ 74
strContactPerson = value; 75
} 76
} 77
78
public string Title 79
...{ 80
get 81
...{ 82
return strTitle; 83
} 84
set 85
...{ 86
strTitle = value; 87
} 88
} 89
90
public string Department 91
...{ 92
get 93
...{ 94
return strDepartment; 95
} 96
set 97
...{ 98
strDepartment = value; 99
} 100
} 101
102
public string JobCode 103
...{ 104
get 105
...{ 106
return strJobCode; 107
} 108
set 109
...{ 110
strJobCode = value; 111
} 112
} 113
114
public string City 115
...{ 116
get 117
...{ 118
return strCity; 119
} 120
set 121
...{ 122
strCity = value; 123
} 124
} 125
126
public int StateID 127
...{ 128
get 129
...{ 130
return intStateID; 131
} 132
set 133
...{ 134
intStateID = value; 135
} 136
} 137
138
public int CountryID 139
...{ 140
get 141
...{ 142
return intCountryID; 143
} 144
set 145
...{ 146
intCountryID = value; 147
} 148
} 149
150
public int EducationLevelID 151
...{ 152
get 153
...{ 154
return intEducationLevelID; 155
} 156
set 157
...{ 158
intEducationLevelID = value; 159
} 160
} 161
162
public int JobTypeID 163
...{ 164
get 165
...{ 166
return intJobTypeID; 167
} 168
set 169
...{ 170
intJobTypeID = value; 171
} 172
} 173
174
public decimal MinSalary 175
...{ 176
get 177
...{ 178
return dblMinSalary; 179
} 180
set 181
...{ 182
dblMinSalary = value; 183
} 184
} 185
186
public decimal MaxSalary 187
...{ 188
get 189
...{ 190
return dblMaxSalary; 191
} 192
set 193
...{ 194
dblMaxSalary = value; 195
} 196
} 197
198
public string Description 199
...{ 200
get 201
...{ 202
return strDescription; 203
} 204
set 205
...{ 206
strDescription = value; 207
} 208
} 209
210
public DateTime PostingDate 211
...{ 212
get 213
...{ 214
return dtPostingDate; 215
} 216
set 217
...{ 218
dtPostingDate = value; 219
} 220
} 221
222
public string PostedBy 223
...{ 224
get 225
...{ 226
return strPostedBy; 227
} 228
set 229
...{ 230
strPostedBy = value; 231
} 232
233
} 234
#endregion 235
236
Public Static Methods#region Public Static Methods 237
238
239
public static int Insert(JobPosting p) 240
...{ 241
DBAccess db = new DBAccess(); 242
243
SqlParameter objParam = new SqlParameter("@iPostingID", 0); 244
objParam.Direction = ParameterDirection.Output; 245
246
db.Parameters.Add(new SqlParameter("@iCompanyID", p.CompanyID)); 247
db.Parameters.Add(new SqlParameter("@sContactPerson", p.ContactPerson)); 248
db.Parameters.Add(new SqlParameter("@sTitle", p.Title)); 249
db.Parameters.Add(new SqlParameter("@sDepartment", p.Department)); 250
db.Parameters.Add(new SqlParameter("@sJobCode", p.JobCode)); 251
db.Parameters.Add(new SqlParameter("@sCity", p.City)); 252
db.Parameters.Add(new SqlParameter("@iStateID", p.StateID)); 253
db.Parameters.Add(new SqlParameter("@iCountryID", p.CountryID)); 254
db.Parameters.Add(new SqlParameter("@iEducationLevelID", p.EducationLevelID)); 255
db.Parameters.Add(new SqlParameter("@iJobTypeID", p.JobTypeID)); 256
db.Parameters.Add(new SqlParameter("@curMinSalary", p.MinSalary)); 257
db.Parameters.Add(new SqlParameter("@curMaxSalary", p.MaxSalary)); 258
db.Parameters.Add(new SqlParameter("@sJobDescription", p.Description)); 259
db.Parameters.Add(new SqlParameter("@daPostingDate", p.PostingDate)); 260
db.Parameters.Add(new SqlParameter("@sPostedBy", p.PostedBy)); 261
db.Parameters.Add(objParam); 262
263
int retval = db.ExecuteNonQuery("JobsDb_JobPostings_Insert"); 264
if (retval == 1) 265
...{ 266
return int.Parse(objParam.Value.ToString()); 267
} 268
else 269
...{ 270
return -1; 271
} 272
273
274
} 275
276
public static int Update(JobPosting p) 277
...{ 278
DBAccess db = new DBAccess(); 279
280
db.Parameters.Add(new SqlParameter("@iPostingID", p.JobPostingID)); 281
db.Parameters.Add(new SqlParameter("@iCompanyID", p.CompanyID)); 282
db.Parameters.Add(new SqlParameter("@sContactPerson", p.ContactPerson)); 283
db.Parameters.Add(new SqlParameter("@sTitle", p.Title)); 284
db.Parameters.Add(new SqlParameter("@sDepartment", p.Department)); 285
db.Parameters.Add(new SqlParameter("@sJobCode", p.JobCode)); 286
db.Parameters.Add(new SqlParameter("@sCity", p.City)); 287
db.Parameters.Add(new SqlParameter("@iStateID", p.StateID)); 288
db.Parameters.Add(new SqlParameter("@iCountryID", p.CountryID)); 289
db.Parameters.Add(new SqlParameter("@iEducationLevelID", p.EducationLevelID)); 290
db.Parameters.Add(new SqlParameter("@iJobTypeID", p.JobTypeID)); 291
db.Parameters.Add(new SqlParameter("@curMinSalary", p.MinSalary)); 292
db.Parameters.Add(new SqlParameter("@curMaxSalary", p.MaxSalary)); 293
db.Parameters.Add(new SqlParameter("@sJobDescription", p.Description)); 294
db.Parameters.Add(new SqlParameter("@daPostingDate", p.PostingDate)); 295





