?? resume.cs
字號:
?using System;
using System.Data;
using System.Collections;
using HRManager.DataAccessLayer;
using HRManager.DataAccessHelper;
using HRManager.CommonComponent;
namespace HRManager.BusinessLogicLayer
{
/// <summary>
/// 簡歷類
/// </summary>
public class Resume
{
#region 私有成員
private int _resumeId; //簡歷Id
private string _jobName; //工作名稱
private string _secondJobName; //備選工作名稱
private string _name; //申請者姓名
private string _password; //密碼
private string _gender; //性別
private DateTime _birthday; //出生日期
private string _city; //所在城市
private string _degree; //學歷
private string _school; //學校
private string _major; //專業
private bool _isFreshGraduate; //是否應屆畢業生
private DateTime _graduateTime; //畢業時間
private int _workYears; //工作年數
private string _curCompany; //目前公司
private string _curJob; //目前工作
private string _foreignLanguageType; //外語種類
private string _foreignLanguageLevel;//外語級別
private string _phone; //電話
private string _mobile; //手機
private string _email; //電子郵件
private string _affixFile; //附件文件名
private bool _exist; //是否存在標志
#endregion 私有成員
#region 屬性
public int ResumeId
{ //簡歷Id
get
{
return this._resumeId;
}
set
{
this._resumeId = value;
}
}
public string JobName
{//工作名稱
get
{
return this._jobName;
}
set
{
this._jobName = value;
}
}
public string SecondJobName
{//備選工作名稱
get
{
return this._secondJobName;
}
set
{
this._secondJobName = value;
}
}
public string Name
{//申請者姓名
get
{
return this._name;
}
set
{
this._name = value;
}
}
public string Password
{//密碼
get
{
return this._password;
}
set
{
this._password = value;
}
}
public string Gender
{ //性別
get
{
return this._gender;
}
set
{
this._gender = value;
}
}
public DateTime Birthday
{//出生日期
get
{
return this._birthday;
}
set
{
this._birthday = value;
}
}
public string City
{//所在城市
get
{
return this._city;
}
set
{
this._city = value;
}
}
public string Degree
{//學歷
get
{
return this._degree;
}
set
{
this._degree = value;
}
}
public string School
{//學校
get
{
return this._school;
}
set
{
this._school = value;
}
}
public string Major
{//專業
get
{
return this._major;
}
set
{
this._major = value;
}
}
public bool IsFreshGraduate
{//是否應屆畢業生
get
{
return this._isFreshGraduate;
}
set
{
this._isFreshGraduate = value;
}
}
public DateTime GraduateTime
{//畢業時間
get
{
return this._graduateTime;
}
set
{
this._graduateTime = value;
}
}
public int WorkYears
{//工作年數
get
{
return this._workYears;
}
set
{
this._workYears = value;
}
}
public string CurCompany
{//目前公司
get
{
return this._curCompany;
}
set
{
this._curCompany = value;
}
}
public string CurJob
{//目前工作
get
{
return this._curJob;
}
set
{
this._curJob = value;
}
}
public string ForeignLanguageType
{//外語種類
get
{
return this._foreignLanguageType;
}
set
{
this._foreignLanguageType = value;
}
}
public string ForeignLanguageLevel
{//外語級別
get
{
return this._foreignLanguageLevel;
}
set
{
this._foreignLanguageLevel = value;
}
}
public string Phone
{//電話
get
{
return this._phone;
}
set
{
this._phone = value;
}
}
public string Mobile
{//手機
get
{
return this._mobile;
}
set
{
this._mobile = value;
}
}
public string Email
{//電子郵件
get
{
return this._email;
}
set
{
this._email = value;
}
}
public string AffixFile
{ //附件文件名
get
{
return this._affixFile;
}
set
{
this._affixFile = value;
}
}
public bool Exist
{//是否存在
get
{
return this._exist;
}
}
#endregion 屬性
#region 方法
/// <summary>
/// 根據參數name和password,獲取簡歷詳細信息
/// </summary>
/// <param name="resumeId">簡歷ID</param>
public void LoadData(int resumeId)
{
Database db = new Database(); //實例化一個Database類
string sql = "";
sql = "Select * from [Resume] where [ResumeId] = " + resumeId;
DataRow dr = db.GetDataRow(sql); //利用Database類的GetDataRow方法查詢簡歷數據
//根據查詢得到的數據,對成員賦值
if (dr != null)
{
this._resumeId = GetSafeData.ValidateDataRow_N(dr, "ResumeId");//簡歷Id
this._jobName = GetSafeData.ValidateDataRow_S(dr, "JobName");//工作名稱
this._secondJobName = GetSafeData.ValidateDataRow_S(dr, "SecondJobName");//備選工作名稱
this._name = GetSafeData.ValidateDataRow_S(dr, "Name");//申請者姓名
this._password = myEncrypt.DecryptString(GetSafeData.ValidateDataRow_S(dr, "Password"));//解密后的密碼
this._gender = GetSafeData.ValidateDataRow_S(dr, "Gender");//性別
this._birthday = GetSafeData.ValidateDataRow_T(dr, "Birthday");//出生日期
this._city = GetSafeData.ValidateDataRow_S(dr, "City");//所在城市
this._degree = GetSafeData.ValidateDataRow_S(dr, "Degree");//學歷
this._school = GetSafeData.ValidateDataRow_S(dr, "School");//學校
this._major = GetSafeData.ValidateDataRow_S(dr, "Major");//專業
this._isFreshGraduate = Convert.ToBoolean(GetSafeData.ValidateDataRow_N(dr, "IsFreshGraduate"));//是否應屆畢業生
this._graduateTime = GetSafeData.ValidateDataRow_T(dr, "GraduateTime");//畢業時間
this._workYears = GetSafeData.ValidateDataRow_N(dr, "WorkYears");//工作年數
this._curCompany = GetSafeData.ValidateDataRow_S(dr, "CurCompany");//目前公司
this._curJob = GetSafeData.ValidateDataRow_S(dr, "CurJob");//目前工作
this._foreignLanguageType = GetSafeData.ValidateDataRow_S(dr, "ForeignLanguageType");//外語種類
this._foreignLanguageLevel = GetSafeData.ValidateDataRow_S(dr, "ForeignLanguageLevel");//外語級別
this._phone = GetSafeData.ValidateDataRow_S(dr, "Phone");//電話
this._mobile = GetSafeData.ValidateDataRow_S(dr, "Mobile");//手機
this._email = GetSafeData.ValidateDataRow_S(dr, "Email");//電子郵件
this._affixFile = GetSafeData.ValidateDataRow_S(dr, "AffixFile");//附件文件名
this._exist = true;
}
else
{
this._exist = false;
}
}
/// <summary>
/// 向數據庫添加一個簡歷
/// </summary>
/// <param name="htUserInfo">簡歷信息哈希表</param>
public static void Add(Hashtable resumeInfo)
{
Database db = new Database(); //實例化一個Database類
db.Insert("[Resume]", resumeInfo); //利用Database類的Insert方法添加簡歷數據
}
/// <summary>
/// 查詢簡歷
/// </summary>
/// <param name="queryItems">“AND”子句查詢條件哈希表</param>
/// <param name="moreCond">更多查詢條件</param>
/// <returns>以DataTable形式返回查詢結果數據</returns>
public static DataTable Query(Hashtable queryItems, string moreCond)
{
string where = SqlStringConstructor.GetConditionClause(queryItems);
if (moreCond != "")
{
if (where != "")
where += " And " + moreCond;
else
where += " Where " + moreCond;
}
string sql = "Select * From [Resume]";
sql += where;
Database db = new Database();
return db.GetDataTable(sql);
}
#endregion 方法
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -