示例#1
0
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["Type"] == "1")
            {
                //编辑保存
                zlzw.Model.CoreUserModel coreUserModel = new zlzw.Model.CoreUserModel();
                coreUserModel.UserName = txbAdminName.Text;
                coreUserModel.Password = txbAdminPassword.Text;
                coreUserModel.UserStatus = 1;
                coreUserModel.UserType = 64;
                coreUserModel.UserRegisterDate = DateTime.Parse(ViewState["PublishDate"].ToString());
                coreUserModel.UserGuid = new Guid(ViewState["AdminGUID"].ToString());
                zlzw.BLL.CoreUserBLL coreUserBLL = new zlzw.BLL.CoreUserBLL();
                coreUserModel.UserID = int.Parse(Get_ID(coreUserBLL,Request.QueryString["value"]));
                
                coreUserBLL.Update(coreUserModel);
            }
            else
            {
                //添加保存

                zlzw.Model.CoreUserModel coreUserModel = new zlzw.Model.CoreUserModel();
                coreUserModel.UserName = txbAdminName.Text;
                coreUserModel.Password = txbAdminPassword.Text;
                coreUserModel.UserStatus = 1;
                coreUserModel.UserType = 64;
                coreUserModel.UserRegisterDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
                coreUserModel.UserGuid = System.Guid.NewGuid();
                zlzw.BLL.CoreUserBLL coreUserBLL = new zlzw.BLL.CoreUserBLL();
                coreUserBLL.Add(coreUserModel);
            }

            // 2. Close this window and Refresh parent window
            PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
        }
示例#2
0
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public zlzw.Model.CoreUserModel DataRowToModel(DataRow row)
		{
			zlzw.Model.CoreUserModel model=new zlzw.Model.CoreUserModel();
			if (row != null)
			{
				if(row["UserID"]!=null && row["UserID"].ToString()!="")
				{
					model.UserID=int.Parse(row["UserID"].ToString());
				}
				if(row["UserGuid"]!=null && row["UserGuid"].ToString()!="")
				{
					model.UserGuid= new Guid(row["UserGuid"].ToString());
				}
				if(row["UserName"]!=null)
				{
					model.UserName=row["UserName"].ToString();
				}
				if(row["UserCode"]!=null)
				{
					model.UserCode=row["UserCode"].ToString();
				}
				if(row["Password"]!=null)
				{
					model.Password=row["Password"].ToString();
				}
				if(row["PasswordEncrytType"]!=null && row["PasswordEncrytType"].ToString()!="")
				{
					model.PasswordEncrytType=int.Parse(row["PasswordEncrytType"].ToString());
				}
				if(row["PasswordEncrytSalt"]!=null)
				{
					model.PasswordEncrytSalt=row["PasswordEncrytSalt"].ToString();
				}
				if(row["UserNameCN"]!=null)
				{
					model.UserNameCN=row["UserNameCN"].ToString();
				}
				if(row["UserNameEN"]!=null)
				{
					model.UserNameEN=row["UserNameEN"].ToString();
				}
				if(row["UserNameFirst"]!=null)
				{
					model.UserNameFirst=row["UserNameFirst"].ToString();
				}
				if(row["UserNameLast"]!=null)
				{
					model.UserNameLast=row["UserNameLast"].ToString();
				}
				if(row["UserNameMiddle"]!=null)
				{
					model.UserNameMiddle=row["UserNameMiddle"].ToString();
				}
				if(row["DepartmentID"]!=null && row["DepartmentID"].ToString()!="")
				{
					model.DepartmentID=int.Parse(row["DepartmentID"].ToString());
				}
				if(row["DepartmentGuid"]!=null && row["DepartmentGuid"].ToString()!="")
				{
					model.DepartmentGuid= new Guid(row["DepartmentGuid"].ToString());
				}
				if(row["DepartmentCode"]!=null)
				{
					model.DepartmentCode=row["DepartmentCode"].ToString();
				}
				if(row["DepartmentUserType"]!=null && row["DepartmentUserType"].ToString()!="")
				{
					model.DepartmentUserType=int.Parse(row["DepartmentUserType"].ToString());
				}
				if(row["UserFullPath"]!=null)
				{
					model.UserFullPath=row["UserFullPath"].ToString();
				}
				if(row["AreaCode"]!=null)
				{
					model.AreaCode=row["AreaCode"].ToString();
				}
				if(row["UserEmail"]!=null)
				{
					model.UserEmail=row["UserEmail"].ToString();
				}
				if(row["UserType"]!=null && row["UserType"].ToString()!="")
				{
					model.UserType=int.Parse(row["UserType"].ToString());
				}
				if(row["UserStatus"]!=null && row["UserStatus"].ToString()!="")
				{
					model.UserStatus=int.Parse(row["UserStatus"].ToString());
				}
				if(row["UserRemark"]!=null)
				{
					model.UserRemark=row["UserRemark"].ToString();
				}
				if(row["UserCardID"]!=null)
				{
					model.UserCardID=row["UserCardID"].ToString();
				}
				if(row["UserCardIDIssued"]!=null)
				{
					model.UserCardIDIssued=row["UserCardIDIssued"].ToString();
				}
				if(row["DriversLicenceNumber"]!=null)
				{
					model.DriversLicenceNumber=row["DriversLicenceNumber"].ToString();
				}
				if(row["DriversLicenceNumberIssued"]!=null)
				{
					model.DriversLicenceNumberIssued=row["DriversLicenceNumberIssued"].ToString();
				}
				if(row["PassportCode"]!=null)
				{
					model.PassportCode=row["PassportCode"].ToString();
				}
				if(row["PassportCodeIssued"]!=null)
				{
					model.PassportCodeIssued=row["PassportCodeIssued"].ToString();
				}
				if(row["UserSex"]!=null && row["UserSex"].ToString()!="")
				{
					model.UserSex=int.Parse(row["UserSex"].ToString());
				}
				if(row["UserBirthDay"]!=null && row["UserBirthDay"].ToString()!="")
				{
					model.UserBirthDay=DateTime.Parse(row["UserBirthDay"].ToString());
				}
				if(row["MaritalStatus"]!=null && row["MaritalStatus"].ToString()!="")
				{
					model.MaritalStatus=int.Parse(row["MaritalStatus"].ToString());
				}
				if(row["UserMobileNO"]!=null)
				{
					model.UserMobileNO=row["UserMobileNO"].ToString();
				}
				if(row["UserRegisterDate"]!=null && row["UserRegisterDate"].ToString()!="")
				{
					model.UserRegisterDate=DateTime.Parse(row["UserRegisterDate"].ToString());
				}
				if(row["UserAgreeDate"]!=null && row["UserAgreeDate"].ToString()!="")
				{
					model.UserAgreeDate=DateTime.Parse(row["UserAgreeDate"].ToString());
				}
				if(row["UserWorkStartDate"]!=null && row["UserWorkStartDate"].ToString()!="")
				{
					model.UserWorkStartDate=DateTime.Parse(row["UserWorkStartDate"].ToString());
				}
				if(row["UserWorkEndDate"]!=null && row["UserWorkEndDate"].ToString()!="")
				{
					model.UserWorkEndDate=DateTime.Parse(row["UserWorkEndDate"].ToString());
				}
				if(row["CompanyMail"]!=null)
				{
					model.CompanyMail=row["CompanyMail"].ToString();
				}
				if(row["UserTitle"]!=null)
				{
					model.UserTitle=row["UserTitle"].ToString();
				}
				if(row["UserPosition"]!=null)
				{
					model.UserPosition=row["UserPosition"].ToString();
				}
				if(row["WorkTelphone"]!=null)
				{
					model.WorkTelphone=row["WorkTelphone"].ToString();
				}
				if(row["HomeTelephone"]!=null)
				{
					model.HomeTelephone=row["HomeTelephone"].ToString();
				}
				if(row["UserPhoto"]!=null)
				{
					model.UserPhoto=row["UserPhoto"].ToString();
				}
				if(row["UserMacAddress"]!=null)
				{
					model.UserMacAddress=row["UserMacAddress"].ToString();
				}
				if(row["UserLastIP"]!=null)
				{
					model.UserLastIP=row["UserLastIP"].ToString();
				}
				if(row["UserLastDateTime"]!=null && row["UserLastDateTime"].ToString()!="")
				{
					model.UserLastDateTime=DateTime.Parse(row["UserLastDateTime"].ToString());
				}
				if(row["BrokerKey"]!=null)
				{
					model.BrokerKey=row["BrokerKey"].ToString();
				}
				if(row["EnterpriseKey"]!=null)
				{
					model.EnterpriseKey=row["EnterpriseKey"].ToString();
				}
				if(row["UserHeight"]!=null && row["UserHeight"].ToString()!="")
				{
					model.UserHeight=decimal.Parse(row["UserHeight"].ToString());
				}
				if(row["UserWeight"]!=null && row["UserWeight"].ToString()!="")
				{
					model.UserWeight=decimal.Parse(row["UserWeight"].ToString());
				}
				if(row["UserNation"]!=null)
				{
					model.UserNation=row["UserNation"].ToString();
				}
				if(row["UserCountry"]!=null)
				{
					model.UserCountry=row["UserCountry"].ToString();
				}
				if(row["UserEducationalBackground"]!=null && row["UserEducationalBackground"].ToString()!="")
				{
					model.UserEducationalBackground=int.Parse(row["UserEducationalBackground"].ToString());
				}
				if(row["UserEducationalSchool"]!=null)
				{
					model.UserEducationalSchool=row["UserEducationalSchool"].ToString();
				}
				if(row["SocialSecurityNumber"]!=null)
				{
					model.SocialSecurityNumber=row["SocialSecurityNumber"].ToString();
				}
				if(row["CurrentResidence"]!=null)
				{
					model.CurrentResidence=row["CurrentResidence"].ToString();
				}
				if(row["PropertyNames"]!=null)
				{
					model.PropertyNames=row["PropertyNames"].ToString();
				}
				if(row["PropertyValues"]!=null)
				{
					model.PropertyValues=row["PropertyValues"].ToString();
				}
			}
			return model;
		}
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Session["IsEnterpriseSubmit"] != null)
            {
                return;
            }
            zlzw.Model.CoreUserModel coreUserModel = new zlzw.Model.CoreUserModel();
            coreUserModel.UserGuid = Guid.NewGuid();
            coreUserModel.UserName = Request.Form["txbUserName"];//账号
            coreUserModel.Password = Request.Form["txbPassword"];//密码
            coreUserModel.UserMobileNO = Request.Form["txbUserMobileNO"];//手机号
            coreUserModel.UserRegisterDate = DateTime.Now;//用户注册日期
            coreUserModel.UserLastDateTime = DateTime.Now;//用户最后一次登录日期
            coreUserModel.UserType = 2;//企业用户
            coreUserModel.UserStatus = 1;//状态可用

            zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = new zlzw.Model.GeneralEnterpriseModel();
            generalEnterpriseModel.UserGuid = new Guid(coreUserModel.UserGuid.ToString());//所属账号的GUID
            generalEnterpriseModel.CompanyName = Request.Form["txbEnterpriseName"];//企业名称
            //generalEnterpriseModel.IndustryKey = drpJobFeildKindsType.SelectedValue + "-" + Request.Params["drpItems"];//公司行业
            generalEnterpriseModel.IndustryKey = Get_CurrentValue(Request.Params["txbJobFeildKinds"]) + "-" + Request.Params["txbJobFeildKinds"];//行业类别
            generalEnterpriseModel.PrincipleAddress = Request.Form["txbPrincipleAddress"];//公司地址
            generalEnterpriseModel.Telephone = Request.Form["txbTelephone"];//联系电话
            generalEnterpriseModel.ContactPerson = Request.Form["txbContactPerson"];//联系人
            generalEnterpriseModel.Email = Request.Form["txbEmail"];//电子邮件
            generalEnterpriseModel.EnterpriseWWW = Request.Form["txbEnterpriseWWW"];//公司网站
            generalEnterpriseModel.BusRoute = Request.Form["txbBusRoute"];//乘车路线
            generalEnterpriseModel.CanUsable = 1;
            generalEnterpriseModel.CreateDate = DateTime.Now;//创建日期
            //添加所在省市区信息
            generalEnterpriseModel.ShengName = Request.Form["drpShengList"];//省名称
            generalEnterpriseModel.ShiName = Request.Form["drpShiList"];//市名称
            generalEnterpriseModel.QuName = Request.Form["drpQuList"];//区名称
            generalEnterpriseModel.EnterpriseDescription = Request.Form["txbEnterpriseDescription"];//企业简介
            ////设置企业基本数据
            //generalEnterpriseModel.Expand_PublishJobCount = 0;//企业已发布的职位数
            //generalEnterpriseModel.Expand_MainResumeCount = 0;//企业已查看主投简历数
            //generalEnterpriseModel.Expand_SearchStrangeResumeCount = 0;//企业已搜索陌生简历数
            //generalEnterpriseModel.Expand_DownloadStrangeResumeCount = 0;//企业已下载陌生简历数量
            //generalEnterpriseModel.Expand_Balance = 0;//企业充值金额
            generalEnterpriseModel.IsEmergencyRecruitment = 0;//默认不允许企业发布紧急招聘
            generalEnterpriseModel.DownloadResume = 0;//默认下载陌生简历次数为0
            if (uploadBusinessLicense.HasFile)
            {
                string strFileExt = System.IO.Path.GetExtension(uploadBusinessLicense.FileName);
                if (strFileExt == ".jpg" || strFileExt == ".gif" || strFileExt == ".png" || strFileExt == ".jpeg" || strFileExt == ".bmp")
                {
                    string strFilePath = "~/BusinessLicense/" + txbEnterpriseName.Text + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + "_" + strFileExt;
                    uploadBusinessLicense.SaveAs(Server.MapPath(strFilePath));
                    generalEnterpriseModel.BusinessLicense = strFilePath;
                }
            }
            try
            {
                zlzw.BLL.CoreUserBLL coreUserBLL = new zlzw.BLL.CoreUserBLL();
                coreUserBLL.Add(coreUserModel);
                zlzw.BLL.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL();
                generalEnterpriseBLL.Add(generalEnterpriseModel);
                if (Session["IsEnterpriseSubmit"] == null)
                {
                    FineUI.Alert.Show("用户注册成功");
                    Session["IsEnterpriseSubmit"] = "1";
                }
                HttpCookie userGUID = new HttpCookie("CurrentUserGUID", coreUserModel.UserGuid.ToString());
                HttpCookie uerName = new HttpCookie("CurrentUserName", coreUserModel.UserName);
                userGUID.Expires = DateTime.Now.AddDays(1);
                uerName.Expires = DateTime.Now.AddDays(1);
                System.Web.HttpContext.Current.Response.Cookies.Add(userGUID);
                System.Web.HttpContext.Current.Response.Cookies.Add(uerName);
                Response.Redirect("default.aspx");
            }
            catch (Exception exp)
            {
                FineUI.Alert.Show("用户注册失败,请稍后重试");
            }
        }
示例#4
0
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public zlzw.Model.CoreUserModel GetModel(int UserID)
		{
			SqlParameter[] parameters = {
					new SqlParameter("@UserID", SqlDbType.Int,4)
			};
			parameters[0].Value = UserID;

			zlzw.Model.CoreUserModel model=new zlzw.Model.CoreUserModel();
			DataSet ds= DbHelperSQL.RunProcedure("CoreUser_GetModel",parameters,"ds");
			if(ds.Tables[0].Rows.Count>0)
			{
				return DataRowToModel(ds.Tables[0].Rows[0]);
			}
			else
			{
				return null;
			}
		}
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Session["IsSubmit"] != null)
            {
                return;
            }
            zlzw.Model.CoreUserModel coreUserModel = new zlzw.Model.CoreUserModel();
            coreUserModel.UserGuid = Guid.NewGuid();
            coreUserModel.UserName = Request.Form["txbUserName"];//用户名
            coreUserModel.Password = Request.Form["txbPassword"];//用户密码
            coreUserModel.UserNameCN = Request.Form["txbUserNameCN"];//用户姓名
            coreUserModel.UserSex = int.Parse(Request.Form["drpUserSex"]);//用户性别
            coreUserModel.UserEducationalBackground = int.Parse(Request.Form["drpUserEducationalBackground"]);//用户学历
            coreUserModel.UserBirthDay = DateTime.Parse(Request.Form["txbUserBirthDay"]);//出生日期
            coreUserModel.UserMobileNO = Request.Form["txbUserMobileNO"];//联系电话
            coreUserModel.UserCountry = Request.Form["txbUserCountry"];//户口原籍
            coreUserModel.CurrentResidence = Request.Form["txbCurrentResidence"];//当前居住地
            coreUserModel.UserEmail = Request.Form["txbUserEmail"];//用户电子信箱
            coreUserModel.MaritalStatus = int.Parse(Request.Form["drpMaritalStatus"]);//婚姻状态
            if (txbUserHeight.Text.Length == 0)
            {
                coreUserModel.UserHeight = Decimal.Parse("0");//身高
            }
            else
            {
                coreUserModel.UserHeight = Decimal.Parse(Request.Form["txbUserHeight"]);//身高
            }
            if (txbUserWeight.Text.Length == 0)
            {
                coreUserModel.UserWeight = Decimal.Parse("0");//体重
            }
            else
            {
                coreUserModel.UserWeight = Decimal.Parse(Request.Form["txbUserWeight"]);//体重
            }
            coreUserModel.UserRegisterDate = DateTime.Now;//用户注册日期
            coreUserModel.UserLastDateTime = DateTime.Now;//用户最后一次登录日期
            coreUserModel.UserType = 1;//普通用户
            coreUserModel.UserStatus = 1;//状态可用
            if (uploadUserPhoto.HasFile)
            {
                string strFileExt = System.IO.Path.GetExtension(uploadUserPhoto.FileName);
                if (strFileExt == ".jpg" || strFileExt == ".gif" || strFileExt == ".png" || strFileExt == ".jpeg" || strFileExt == ".bmp")
                {
                    string strFilePath = "~/UserPhotos/" + txbUserName.Text + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + "_" + strFileExt;
                    uploadUserPhoto.SaveAs(Server.MapPath(strFilePath));
                    coreUserModel.UserPhoto = strFilePath;
                }
            }

            zlzw.Model.JobPersonResumeModel jobPersonResumeModel = new zlzw.Model.JobPersonResumeModel();
            jobPersonResumeModel.OwnerUserKey = coreUserModel.UserGuid.ToString();//用户表GUID 
            //jobPersonResumeModel.JobPositionKinds = drpJobPositionKindsType.SelectedValue + "-" + Request.Form["drpJobPositionKinds"];//职位类别
            //jobPersonResumeModel.JobFeildKinds = drpJobFeildKindsType.SelectedValue + "-" + Request.Form["drpJobFeildKinds"];//期望行业
            jobPersonResumeModel.JobPositionKinds = Get_CurrentValue(Request.Params["txbJobPositionKinds"]) + "-" + Request.Params["txbJobPositionKinds"];
            jobPersonResumeModel.JobFeildKinds = Get_CurrentValue(Request.Params["txbJobFeildKinds"]) + "-" + Request.Params["txbJobFeildKinds"];
            jobPersonResumeModel.HopeJob = Request.Form["txbHopeJob"];//意向职位
            jobPersonResumeModel.JobWorkPlaceNames = Request.Form["txbJobWorkPlaceNames"];//期望地址
            jobPersonResumeModel.HopeRoomAndBoard = int.Parse(Request.Form["drpHopeRoomAndBoard"]);//期望食宿
            jobPersonResumeModel.JobSalary = int.Parse(Request.Form["drpJobSalary"]);//期望薪资
            jobPersonResumeModel.PersonalSkills = Request.Form["txbPersonalSkills"];//个人技能
            jobPersonResumeModel.SkillsCertificate = Request.Form["txbSkillsCertificate"];//技能证书
            jobPersonResumeModel.JobCurrentWorkStatus = int.Parse(Request.Form["drpJobCurrentWorkStatus"]);//当前状态
            jobPersonResumeModel.CurrentSalary = Request.Form["drpCurrentSalary"];//当前薪资
            jobPersonResumeModel.JobWorkType = int.Parse(Request.Form["drpJobWorkType"]);//当前状态
            jobPersonResumeModel.WorkExperience = Request.Form["txbWorkExperience"];//工作经历
            jobPersonResumeModel.EducationExperience = Request.Form["txbEducationExperience"];//教育经历
            jobPersonResumeModel.CreateDate = DateTime.Now;//创建日期
            jobPersonResumeModel.UpdateDate = DateTime.Now;//更新日期
            jobPersonResumeModel.CanUsable = 1;//状态可用
            jobPersonResumeModel.ResumeStatus = 1;//状态可用
            jobPersonResumeModel.UserAge = int.Parse(Get_CurrentUserAge(Request.Form["txbUserBirthDay"]));//用户年龄
            jobPersonResumeModel.UserSex = Get_UserSex(Request.Form["drpUserSex"]);//用户性别

            try
            {
                zlzw.BLL.CoreUserBLL coreUserBLL = new zlzw.BLL.CoreUserBLL();
                coreUserBLL.Add(coreUserModel);
                zlzw.BLL.JobPersonResumeBLL jobPersonResumeBLL = new zlzw.BLL.JobPersonResumeBLL();
                jobPersonResumeBLL.Add(jobPersonResumeModel);
                txbUserName.Text = "";
                txbPassword.Text = "";
                txbUserNameCN.Text = "";
                txbUserMobileNO.Text = "";
                txbUserCountry.Text = "";
                txbCurrentResidence.Text = "";
                txbUserEmail.Text = "";
                txbHopeJob.Text = "";
                txbJobWorkPlaceNames.Text = "";
                txbPersonalSkills.Text = "";
                txbSkillsCertificate.Text = "";
                txbWorkExperience.Text = "";
                txbEducationExperience.Text = "";
                if (Session["IsSubmit"] == null)
                {
                    FineUI.Alert.Show("简历提交成功");
                    Session["IsSubmit"] = "1";
                }
                HttpCookie userGUID = new HttpCookie("CurrentUserGUID", coreUserModel.UserGuid.ToString());
                HttpCookie uerName = new HttpCookie("CurrentUserName", coreUserModel.UserName);
                userGUID.Expires = DateTime.Now.AddDays(1);
                uerName.Expires = DateTime.Now.AddDays(1);
                System.Web.HttpContext.Current.Response.Cookies.Add(userGUID);
                System.Web.HttpContext.Current.Response.Cookies.Add(uerName);
                Response.Redirect("default.aspx");
            }
            catch (Exception exp)
            {
                FineUI.Alert.Show("简历提交失败,请稍后重试");
            }

        }