public void ShowData()
 {
     if (Request["ZhaoPinID"] + "" == "")
     {
         Response.Redirect("RightsWarn.aspx");
     }
     else
     {
         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()));
             this.txtAddress.Text = model_ZhaoPin.Address.ToString();
             this.txtBody.Text = model_ZhaoPin.Body.ToString();
             this.txtEndDate.Text = model_ZhaoPin.EndDate.ToString();
             this.txtNumber.Text = model_ZhaoPin.Number.ToString();
             this.txtPosition.Text = model_ZhaoPin.Position.ToString();
             this.txtSalary.Text = model_ZhaoPin.Salary.ToString();
             this.txtZhaoPinOrder.Text = model_ZhaoPin.ZhaoPinOrder.ToString();
         }
         catch
         {
             Response.Redirect("RightsWarn.aspx");
         }
     }
 }
 public void ShowZhaoPinInfo()
 {
     WebProject.BLL.BaseData.ZT_COM_ZhaoPin bll_ZhaoPin = new WebProject.BLL.BaseData.ZT_COM_ZhaoPin();
     DataSet ds = bll_ZhaoPin.GetList(" 1=1 ");
     this.Repeater1.DataSource = ds;
     this.Repeater1.DataBind();
 }
 public void ShowZhaoPinInfo()
 {
     if (Request["ZhaoPinID"] + "" == "")
     {
         Response.Redirect("ErrorPage.aspx");
     }
     else
     {
         try
         {
             int ZhaoPinID = Convert.ToInt32(Request.QueryString["ZhaoPinID"].ToString());
             WebProject.BLL.BaseData.ZT_COM_ZhaoPin bll_ZhaoPin = new WebProject.BLL.BaseData.ZT_COM_ZhaoPin();
             DataSet ds = bll_ZhaoPin.GetList(" 1=1 ");
             if (ds.Tables[0].Rows.Count > 0)
             {
                 this.lblPosition.Text = ds.Tables[0].Rows[0]["Position"].ToString();
                 this.lblNumber.Text = ds.Tables[0].Rows[0]["Number"].ToString();
                 this.lblSalary.Text = ds.Tables[0].Rows[0]["Salary"].ToString();
                 this.lblAddress.Text = ds.Tables[0].Rows[0]["Address"].ToString();
                 this.lblEndDate.Text = ds.Tables[0].Rows[0]["EndDate"].ToString();
                 this.lblBody.Text = ds.Tables[0].Rows[0]["Body"].ToString();
             }
         }
         catch
         {
             Response.Redirect("ErrorPage.aspx");
         }
     }
 }
 protected void btnDeleteSelect_Click(object sender, EventArgs e)
 {
     if (Session["ZT_ADMIN"] == null)
     {
         Response.Redirect("Login.aspx");
     }
     else
     {
         if (!Communal.CheckQx("ZhaoPinDelete.aspx"))
         {
             Response.Redirect("RightsWarn.aspx");
         }
         else
         {
             string DeleteTitle = "";
             foreach (GridViewRow gr in this.GridView1.Rows)
             {
                 CheckBox cb = (CheckBox)gr.Cells[1].FindControl("Select");
                 if (cb.Checked)
                 {
                     //删除数据库信息
                     Label ll = (Label)gr.Cells[1].FindControl("lblZhaoPinID");
                     int ZhaoPinID = Convert.ToInt32(ll.Text);
                     WebProject.BLL.BaseData.ZT_COM_ZhaoPin bll_ZhaoPin = new WebProject.BLL.BaseData.ZT_COM_ZhaoPin();
                     DeleteTitle += bll_ZhaoPin.GetModel(ZhaoPinID).Position + ",";
                     bll_ZhaoPin.Delete(ZhaoPinID);
                 }
             }
             LogManage.WriteLog(Request.UserHostAddress, "招聘管理", "删除招聘信息", "成功", "招聘职位:" + DeleteTitle.TrimEnd(',') + ", 删除人:" + SessionUtil.GetAdminSession().AdminNo);
             ShowData();
         }
     }
 }
 public void ShowData()
 {
     WebProject.BLL.BaseData.ZT_COM_ZhaoPin bll_ZhaoPin = new WebProject.BLL.BaseData.ZT_COM_ZhaoPin();
     DataSet ds = bll_ZhaoPin.GetList("");
     if (ds.Tables[0].Rows.Count > 0)
     {
         this.lblMessage.Visible = false;
         this.btnDeleteSelect.Visible = true;
         this.GridView1.Visible = true;
         this.GridView1.DataSource = ds;
         this.GridView1.DataBind();
     }
     else
     {
         this.lblMessage.Visible = true;
         this.btnDeleteSelect.Visible = false;
         this.GridView1.Visible = false;
     }
 }
 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.Model.BaseData.ZT_COM_ZhaoPin model_ZhaoPin = new WebProject.Model.BaseData.ZT_COM_ZhaoPin();
             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.YingPin = 0;
             model_ZhaoPin.ZhaoPinOrder = Convert.ToInt32(this.txtZhaoPinOrder.Text.Trim());
             WebProject.BLL.BaseData.ZT_COM_ZhaoPin bll_ZhaoPin = new WebProject.BLL.BaseData.ZT_COM_ZhaoPin();
             bll_ZhaoPin.Add(model_ZhaoPin);
             LogManage.WriteLog(Request.UserHostAddress, "招聘管理", "添加招聘信息", "成功", "招聘职位:" + model_ZhaoPin.Position.ToString() + ", 创建人:" + SessionUtil.GetAdminSession().AdminNo);
             MessageBox.ShowAndRedirect(this, "添加招聘信息成功!", "ZhaoPinList.aspx");
         }
         catch
         {
             Response.Redirect("RightsWarn.aspx");
         }
     }
 }
 public void ShowZhaoPinInfo()
 {
     if (Request["ZhaoPinID"] + "" == "")
     {
         this.txtPosition.ReadOnly = false;
         this.txtPosition.Enabled = true;
     }
     else
     {
         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);
             this.txtPosition.Text = model_ZhaoPin.Position.ToString();
             this.txtPosition.ReadOnly = true;
             this.txtPosition.Enabled = false;
         }
         catch
         {
             Response.Redirect("ErrorPage.aspx");
         }
     }
 }
 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 GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     if (Session["ZT_ADMIN"] == null)
     {
         Response.Redirect("Login.aspx");
     }
     else
     {
         if (!Communal.CheckQx("ZhaoPinDelete.aspx"))
         {
             Response.Redirect("RightsWarn.aspx");
         }
         else
         {
             //删除数据库的信息
             Label ll = (Label)this.GridView1.Rows[e.RowIndex].Cells[1].FindControl("lblZhaoPinID");
             int ZhaoPinID = Convert.ToInt32(ll.Text);
             WebProject.BLL.BaseData.ZT_COM_ZhaoPin bll_ZhaoPin = new WebProject.BLL.BaseData.ZT_COM_ZhaoPin();
             LogManage.WriteLog(Request.UserHostAddress, "招聘管理", "删除招聘信息", "成功", "招聘职位:" + bll_ZhaoPin.GetModel(ZhaoPinID).Position + ", 删除人:" + SessionUtil.GetAdminSession().AdminNo);
             bll_ZhaoPin.Delete(ZhaoPinID);
             //重新加载信息
             ShowData();
         }
     }
 }