温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:人才招聘系统(NIIT学生作品)
当前文件:
NiitJob/App_Code/classes/Resume.cs,打开代码结构图
NiitJob/App_Code/classes/Resume.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Data.SqlClient; 4
using My.Hr.DbBase; 5
using System.Collections ; 6
7
8
namespace My.Hr 9
...{ 10
/**//// <summary> 11
/// Summary description for TempStore. 12
/// </summary> 13
public class Resume:DbBase.Base 14
...{ 15
private int personID; 16
private int companyID; 17
18
public Resume() 19
...{ 20
// 21
// TODO: Add constructor logic here 22
// 23
} 24
25
Properties of temp store#region Properties of temp store 26
/**//// <summary> 27
/// Book ID 28
/// </summary> 29
public int PersonID 30
...{ 31
get 32
...{ 33
return personID; 34
} 35
set 36
...{ 37
personID = value; 38
} 39
} 40
41
42
/**//// <summary> 43
/// User ID 44
/// </summary> 45
public int CompanyID 46
...{ 47
get 48
...{ 49
return companyID; 50
} 51
set 52
...{ 53
companyID = value; 54
} 55
} 56
#endregion 57
58
59
Functions of temp store#region Functions of temp store 60
61
62
/**//// <summary> 63
/// Add new book in temp store. 64
/// </summary> 65
public static void Add(ArrayList tempary) 66
...{ 67
SqlConnection myCn=new SqlConnection(strConn); 68
SqlCommand myCm=new SqlCommand("AddResume",myCn); 69
myCm.CommandType =CommandType.StoredProcedure ; 70
71
myCm.Parameters.Add(new SqlParameter("@personID",SqlDbType.Int)); 72
myCm.Parameters["@personID"].Value =tempary[0]; 73
74
myCm.Parameters.Add(new SqlParameter("@companyID",SqlDbType.Int)); 75
myCm.Parameters["@companyID"].Value =tempary[1]; 76
77
myCm.Parameters.Add(new SqlParameter("@personName",SqlDbType.VarChar,50)); 78
myCm.Parameters["@personName"].Value =tempary[2]; 79
80
myCm.Parameters.Add(new SqlParameter("@companyName",SqlDbType.VarChar,50)); 81
myCm.Parameters["@companyName"].Value =tempary[3]; 82
83
myCm.Parameters.Add(new SqlParameter("@CWorkPosition",SqlDbType.VarChar,50)); 84
myCm.Parameters["@CWorkPosition"].Value =tempary[4]; 85
86
myCm.Parameters.Add(new SqlParameter("@PWorkPosition",SqlDbType.VarChar,50)); 87
myCm.Parameters["@PWorkPosition"].Value =tempary[5]; 88
89
try 90
...{ 91
myCn.Open() ; 92
myCm.ExecuteNonQuery() ; 93
} 94
catch(System.Data.SqlClient.SqlException er) 95
...{ 96
throw new Exception(er.Message); 97
} 98
finally 99
...{ 100
myCm.Dispose() ; 101
myCn.Close() ; 102
} 103
} 104
105
106
/**//// <summary> 107
/// Delete book from temp store 108
/// </summary> 109
/// <param name="bookId">Book ID(int)</param> 110
/// <param name="userId">User ID(int)</param> 111
public static void DeleteCompany(int companyId) 112
...{ 113
strSQL = "Delete From resume Where companyID="+companyId.ToString(); 114
115
try 116
...{ 117
ExecuteSql(strSQL); 118
} 119
catch 120
...{ 121
throw new Exception("Delete book FAILED!"); 122
} 123
} 124
125
126
/**//// <summary> 127
/// Delete book from temp store 128
/// </summary> 129
public void DeleteCompany() 130
...{ 131
strSQL = "Delete From resume Where companyID=" + this.CompanyID.ToString(); 132
133
try 134
...{ 135
ExecuteSql(strSQL); 136
} 137
catch 138
...{ 139
throw new Exception("Delete resume FAILED!"); 140
} 141
} 142
143
/**//// <summary> 144
/// Delete book from temp store 145
/// </summary> 146
/// <param name="bookId">Book ID(int)</param> 147
/// <param name="userId">User ID(int)</param> 148
public static void DeletePerson(int personId) 149
...{ 150
strSQL = "Delete From resume Where personID="+personId.ToString(); 151
152
try 153
...{ 154
ExecuteSql(strSQL); 155
} 156
catch 157
...{ 158
throw new Exception("Delete resume FAILED!"); 159
} 160
} 161
162
public static void DeleteGroup(string names) 163
...{ 164
strSQL = "Delete From resume Where personID in ('" + names + "')"; 165
166
try 167
...{ 168
ExecuteSql(strSQL); 169
} 170
catch 171
...{ 172
throw new Exception("Delete person FAILED!"); 173
} 174
} 175
/**//// <summary> 176
/// Delete book from temp store 177
/// </summary> 178
public void DeletePerson() 179
...{ 180
strSQL = "Delete From resume Where personID=" + this.PersonID.ToString(); 181
182
try 183
...{ 184
ExecuteSql(strSQL); 185
} 186
catch 187
...{ 188
throw new Exception("Delete resume FAILED!"); 189
} 190
} 191
192
193
/**//// <summary> 194
/// Delete book from temp store 195
/// </summary> 196
/// <param name="bookId">Book ID(int)</param> 197
/// <param name="userId">User ID(int)</param> 198
public static void DeleteResume(int companyId,int personId) 199
...{ 200
strSQL = "Delete From resume Where companyID="+companyId.ToString()+ 201
" And personID=" + personId.ToString(); 202
203
try 204
...{ 205
ExecuteSql(strSQL); 206
} 207
catch 208
...{ 209
throw new Exception("Delete resume FAILED!"); 210
} 211
} 212
213
214
/**//// <summary> 215
/// Delete book from temp store 216
/// </summary> 217
public void DeleteResume() 218
...{ 219
strSQL = "Delete From resume Where companyID="+this.CompanyID.ToString()+ 220
" And personID=" + this.PersonID.ToString(); 221
222
try 223
...{ 224
ExecuteSql(strSQL); 225
} 226
catch 227
...{ 228
throw new Exception("Delete resume FAILED!"); 229
} 230
} 231
232
233
/**//// <summary> 234
/// Get all the books in the temp store 235
/// </summary> 236
/// <param name="userId">User ID(int)</param> 237
/// <returns>return books(DataSet)</returns> 238
public static DataSet GetPerson(int companyId) 239
...{ 240
strSQL = "SELECT * FROM resume Where companyID=" + companyId.ToString(); 241
242
try 243
...{ 244
return ExecuteSql4Ds(strSQL); 245
} 246
catch 247
...{ 248
throw new Exception("Get all the persons FAILED!"); 249
} 250
} 251
252
253
/**//// <summary> 254
/// Get all the books in the temp store 255
/// </summary> 256
/// <param name="userId">User ID(int)</param> 257
/// <returns>return books(DataSet)</returns> 258
public static DataSet GetCompany(int personId) 259
...{ 260
strSQL = "SELECT * FROM resume Where personID=" + personId.ToString(); 261
262
try 263
...{ 264
return ExecuteSql4Ds(strSQL); 265
} 266
catch 267
...{ 268
throw new Exception("Get all the companies FAILED!"); 269
} 270
} 271
#endregion 272
} 273
} 274





}