⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resume.cs

📁 精通SQL Server2005项目开发
💻 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 + -