protected void btnSubmit_Click(object sender, EventArgs e) { if (this.txtPosition.Text.Trim() == "") { MessageBox.Show(this, "请输入你要应聘的职位!"); return; } else { if (this.txtName.Text.Trim() == "") { MessageBox.Show(this, "请输入你的姓名!"); return; } else { string sex = "1"; if (this.sex1.Checked == false && this.sex2.Checked == false) { MessageBox.Show(this, "请选择性别!"); return; } if (this.sex2.Checked) { sex = "0"; } else { if (this.txtBirthday.Text.Trim() == "") { MessageBox.Show(this, "请输入你的出生年月!"); return; } else { if (this.txtAddress.Text.Trim() == "") { MessageBox.Show(this, "请输入你的现居地址!"); return; } else { if (this.txtMobile.Text.Trim() == "") { MessageBox.Show(this, "请填写您的手机号码!"); return; } else { double u; if (!double.TryParse(this.txtMobile.Text, out u)) { MessageBox.Show(this, "手机号码必须为数字!"); return; } if (u <= 13000000000 || u >= 19000000000) { MessageBox.Show(this, "请输入正确的手机号码!");//判断输入框中的值是否为数字和是否溢出 return; } else { if (CheckString.CheckSqlKeyWord(this.txtAddress.Text) == true || CheckString.CheckSqlKeyWord(this.txtBirthday.Text) == true || CheckString.CheckSqlKeyWord(this.txtEmail.Text) == true || CheckString.CheckSqlKeyWord(this.txtMobile.Text) == true || CheckString.CheckSqlKeyWord(this.txtName.Text) == true || CheckString.CheckSqlKeyWord(this.txtPosition.Text) == true || CheckString.CheckSqlKeyWord(this.txtTelephone.Text) == true) { MessageBox.Show(this, "应聘信息内请不要包含非法字符!"); return; } WebProject.Model.BaseData.ZT_COM_RenCai model_RenCai = new WebProject.Model.BaseData.ZT_COM_RenCai(); model_RenCai.Address = this.txtAddress.Text.Trim(); model_RenCai.Birthday = Convert.ToDateTime(this.txtBirthday.Text.Trim()); model_RenCai.CreateDate = DateTime.Now; model_RenCai.Email = this.txtEmail.Text.Trim(); model_RenCai.Mobile = this.txtMobile.Text.Trim(); model_RenCai.Name = this.txtName.Text.Trim(); model_RenCai.Position = this.txtPosition.Text.Trim(); model_RenCai.Sex = sex.ToString(); model_RenCai.Telephone = this.txtTelephone.Text.Trim(); WebProject.BLL.BaseData.ZT_COM_RenCai bll_RenCai = new WebProject.BLL.BaseData.ZT_COM_RenCai(); bll_RenCai.Add(model_RenCai); if (Request["ZhaoPinID"] != "") { try { int ZhaoPinID = Convert.ToInt32(Request.QueryString["ZhaoPinID"].ToString()); WebProject.BLL.BaseData.ZT_COM_ZhaoPin bll_ZhaoPin = new WebProject.BLL.BaseData.ZT_COM_ZhaoPin(); WebProject.Model.BaseData.ZT_COM_ZhaoPin model_ZhaoPin = bll_ZhaoPin.GetModel(ZhaoPinID); model_ZhaoPin.Number += 1; bll_ZhaoPin.Update(model_ZhaoPin); MessageBox.ShowAndRedirect(this, "应聘信息填写成功!", "ZhaoPin.aspx"); } catch { Response.Redirect("ErrorPage.aspx"); } } } } } } } } } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (Session["ZT_ADMIN"] == null) { Response.Redirect("Login.aspx"); } else { if (this.txtAddress.Text == "") { MessageBox.Show(this, "请输入工作地址!"); return; } if (this.txtBody.Text == "") { MessageBox.Show(this, "请输入招聘内容!"); return; } if (this.txtEndDate.Text == "") { MessageBox.Show(this, "请输入截止日期!"); return; } if (this.txtNumber.Text == "") { MessageBox.Show(this, "请输入招聘人数!"); return; } if (this.txtPosition.Text == "") { MessageBox.Show(this, "请输入招聘职位!"); return; } if (this.txtSalary.Text == "") { MessageBox.Show(this, "请输入工资待遇!"); return; } if (this.txtZhaoPinOrder.Text == "") { MessageBox.Show(this, "请输入招聘排序!"); return; } try { WebProject.BLL.BaseData.ZT_COM_ZhaoPin bll_ZhaoPin = new WebProject.BLL.BaseData.ZT_COM_ZhaoPin(); WebProject.Model.BaseData.ZT_COM_ZhaoPin model_ZhaoPin = bll_ZhaoPin.GetModel(Int32.Parse(Request["ZhaoPinID"].ToString())); model_ZhaoPin.Address = this.txtAddress.Text.Trim(); model_ZhaoPin.Body = this.txtBody.Text.Trim(); model_ZhaoPin.CreateBy = SessionUtil.GetAdminSession().AdminNo; model_ZhaoPin.CreateDate = DateTime.Now; model_ZhaoPin.EndDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); model_ZhaoPin.Number = Convert.ToInt32(this.txtNumber.Text.Trim()); model_ZhaoPin.Position = this.txtPosition.Text.Trim(); model_ZhaoPin.Salary = this.txtSalary.Text.Trim(); model_ZhaoPin.ZhaoPinOrder = Convert.ToInt32(this.txtZhaoPinOrder.Text.Trim()); bll_ZhaoPin.Update(model_ZhaoPin); LogManage.WriteLog(Request.UserHostAddress, "招聘管理", "修改招聘信息", "成功", "招聘职位:" + model_ZhaoPin.Position.ToString() + ", 修改人:" + SessionUtil.GetAdminSession().AdminNo); MessageBox.ShowAndRedirect(this, "修改招聘信息成功!", "ZhaoPinList.aspx"); } catch { Response.Redirect("RightsWarn.aspx"); } } }