Ejemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Maticsoft.BLL.JobInfo jobbll = new Maticsoft.BLL.JobInfo();
            int jobid = int.Parse(Request.QueryString["JobID"].ToString());

            Maticsoft.Model.JobInfo jobmodel = jobbll.GetModel(jobid);
            if (txtJobTitleName.Text.Trim() == "")
            {
                lbljobtitle.Text = "请填写应聘职位";
                return;
            }
            jobmodel.JobTitle = txtJobTitleName.Text.Trim();
            lbljobtitle.Text  = "";
            if (txtAddress.Text.Trim() == "")
            {
                lblAddress.Text = "请填写工作地址";
                return;
            }
            jobmodel.Address = txtAddress.Text.Trim();
            lblAddress.Text  = "";
            if (txtNunber.Text.Trim() == "")
            {
                lblNumber.Text = "请填写您招聘人数";
                return;
            }
            jobmodel.Nunber = txtNunber.Text.Trim();
            lblNumber.Text  = "";
            if (txttime.Text.Trim() == "")
            {
                lblstarttime.Text = "请填写招聘时间";
                return;
            }
            jobmodel.Starttime = Convert.ToDateTime(txttime.Text.Trim());
            lblstarttime.Text  = "";
            if (txtduxiang.Text.Trim() == "")
            {
                lblduxiang.Text = "填写招聘对象";
                return;
            }
            jobmodel.Duxiang = txtduxiang.Text.Trim();
            lblduxiang.Text  = "";
            if (txtage.Text.Trim() == "")
            {
                lblage.Text = "请填写应聘者年龄";
                return;
            }
            jobmodel.Age = txtage.Text.Trim();
            lblage.Text  = "";
            if (txtxueli.Text.Trim() == "")
            {
                lblxueli.Text = "请填写学历要求";
                return;
            }
            jobmodel.Xueli = txtxueli.Text.Trim();
            lblxueli.Text  = "";
            if (txtmonery.Text.Trim() == "")
            {
                lblmonery.Text = "请填写薪水要求";
                return;
            }
            jobmodel.Monery = txtmonery.Text.Trim();
            lblmonery.Text  = "";
            if (txtzhuangye.Text.Trim() == "")
            {
                lblzhuanye.Text = "请填写专业要求";
                return;
            }
            jobmodel.Zhuanye = txtzhuangye.Text.Trim();
            lblzhuanye.Text  = "";
            if (txtEndtime.Text.Trim() == "")
            {
                lblEndtime.Text = "请填写结束时间";
                return;
            }
            jobmodel.Endtime = Convert.ToDateTime(txtEndtime.Text.Trim());
            lblEndtime.Text  = "";
            jobmodel.Miaoshu = txtmiaoshu.Text.Trim();
            jobmodel.Lianxi  = txtlink.Text.Trim();
            jobbll.Update(jobmodel);

            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息添加成功!')</script>");
            bind();
        }
Ejemplo n.º 2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtJobTitle.Text.Trim().Length == 0)
            {
                strErr += "JobTitle不能为空!\\n";
            }
            if (this.txtAddress.Text.Trim().Length == 0)
            {
                strErr += "Address不能为空!\\n";
            }
            if (this.txtNunber.Text.Trim().Length == 0)
            {
                strErr += "Nunber不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtStarttime.Text))
            {
                strErr += "Starttime格式错误!\\n";
            }
            if (this.txtDuxiang.Text.Trim().Length == 0)
            {
                strErr += "Duxiang不能为空!\\n";
            }
            if (this.txtAge.Text.Trim().Length == 0)
            {
                strErr += "Age不能为空!\\n";
            }
            if (this.txtXueli.Text.Trim().Length == 0)
            {
                strErr += "Xueli不能为空!\\n";
            }
            if (this.txtMonery.Text.Trim().Length == 0)
            {
                strErr += "Monery不能为空!\\n";
            }
            if (this.txtZhuanye.Text.Trim().Length == 0)
            {
                strErr += "Zhuanye不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtEndtime.Text))
            {
                strErr += "Endtime格式错误!\\n";
            }
            if (this.txtMiaoshu.Text.Trim().Length == 0)
            {
                strErr += "Miaoshu不能为空!\\n";
            }
            if (this.txtLianxi.Text.Trim().Length == 0)
            {
                strErr += "Lianxi不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      JobID     = int.Parse(this.lblJobID.Text);
            string   JobTitle  = this.txtJobTitle.Text;
            string   Address   = this.txtAddress.Text;
            string   Nunber    = this.txtNunber.Text;
            DateTime Starttime = DateTime.Parse(this.txtStarttime.Text);
            string   Duxiang   = this.txtDuxiang.Text;
            string   Age       = this.txtAge.Text;
            string   Xueli     = this.txtXueli.Text;
            string   Monery    = this.txtMonery.Text;
            string   Zhuanye   = this.txtZhuanye.Text;
            DateTime Endtime   = DateTime.Parse(this.txtEndtime.Text);
            string   Miaoshu   = this.txtMiaoshu.Text;
            string   Lianxi    = this.txtLianxi.Text;


            Maticsoft.Model.JobInfo model = new Maticsoft.Model.JobInfo();
            model.JobID     = JobID;
            model.JobTitle  = JobTitle;
            model.Address   = Address;
            model.Nunber    = Nunber;
            model.Starttime = Starttime;
            model.Duxiang   = Duxiang;
            model.Age       = Age;
            model.Xueli     = Xueli;
            model.Monery    = Monery;
            model.Zhuanye   = Zhuanye;
            model.Endtime   = Endtime;
            model.Miaoshu   = Miaoshu;
            model.Lianxi    = Lianxi;

            Maticsoft.BLL.JobInfo bll = new Maticsoft.BLL.JobInfo();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }