Example #1
0
 public void BindData()
 {
     if (view_action == "notify")
     {
         Model.Recruitment cp = Factory.GetExecution().SelectByID <Model.Recruitment>(requestID);
         if (cp != null)
         {
             if (cp.Language == 1)
             {
                 Chinese.Checked = true;
             }
             else if (cp.Language == 3)
             {
                 English.Checked = true;
             }
             else if (cp.Language == 2)
             {
                 Traditional.Checked = true;
             }
             txtTitle.Text               = cp.Title;
             txtDepartment.Text          = cp.Department;
             txtNumber.Text              = cp.Number.ToString();
             Responsibilities            = cp.Responsibilities;
             JobRequirements             = cp.JobRequirements;
             txtSalary.Text              = cp.Salary;
             txtCreatePeople.Text        = cp.CreatePeople;
             HomePageUploadImg.ImageUrl  = WebSite.IMAGESERVER_WEBPATH + photoPath + cp.LogoUrl;
             HomePageUploadFileName.Text = cp.LogoUrl;
             txtKeywords.Text            = cp.Keywords;
             txtDescription.Text         = cp.Description;
         }
     }
 }
Example #2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         //Responsibilities = Request.Form["editorValue"]; //获取umeditor的值
         //JobRequirements = Request.Form["editorValue"]; //获取umeditor的值
         //Responsibilities = Server.HtmlDecode(txtResponsibilities.InnerHtml);
         //JobRequirements = Server.HtmlDecode(txtJobRequirements.InnerHtml);
         Responsibilities = hfResponsibilities.Value;
         JobRequirements  = hfJobRequirements.Value;
         if (string.IsNullOrEmpty(Responsibilities))
         {
             Common.MessageBox.ShowLayer(this, "岗位职责不能为空", 2);
             return;
         }
         if (string.IsNullOrEmpty(JobRequirements))
         {
             Common.MessageBox.ShowLayer(this, "岗位要求不能为空", 2);
             return;
         }
         if (view_action == "notify")
         {
             Model.Recruitment cp = Factory.GetExecution().SelectByID <Model.Recruitment>(requestID);
             if (cp != null)
             {
                 cp.Language         = Convert.ToInt32(Request.Form["language"]);
                 cp.Title            = txtTitle.Text;
                 cp.Department       = txtDepartment.Text;
                 cp.Number           = Convert.ToInt32(txtNumber.Text);
                 cp.Responsibilities = Responsibilities;
                 cp.JobRequirements  = JobRequirements;
                 cp.Salary           = txtSalary.Text;
                 cp.CreatePeople     = txtCreatePeople.Text;
                 cp.LogoUrl          = HomePageUploadFileName.Text;
                 cp.CreatePeople     = txtCreatePeople.Text;
                 cp.UpdateTime       = DateTime.Now;
                 cp.Keywords         = txtKeywords.Text.Trim();
                 cp.Description      = txtDescription.Text.Trim();
                 bool flag = Factory.GetExecution().Update <Model.Recruitment>(cp);
                 if (flag)
                 {
                     Common.MessageBox.ShowRedirect(this, "/HumanResources/TalentRecruitment.aspx");
                 }
             }
         }
         else
         {
             Model.Recruitment cp = new Model.Recruitment();
             cp.Language         = Convert.ToInt32(Request.Form["language"]);
             cp.Title            = txtTitle.Text;
             cp.Department       = txtDepartment.Text;
             cp.Number           = Convert.ToInt32(txtNumber.Text);
             cp.Responsibilities = Responsibilities;
             cp.JobRequirements  = JobRequirements;
             cp.Salary           = txtSalary.Text;
             cp.CreatePeople     = txtCreatePeople.Text;
             cp.LogoUrl          = HomePageUploadFileName.Text;
             cp.BrowseTimes      = 0;
             cp.CreatePeople     = txtCreatePeople.Text;
             cp.UpdateTime       = DateTime.Now;
             cp.CreateTime       = DateTime.Now;
             cp.Keywords         = txtKeywords.Text.Trim();
             cp.Description      = txtDescription.Text.Trim();
             bool flag = Factory.GetExecution().Add <Model.Recruitment>(cp);
             if (flag)
             {
                 Common.MessageBox.ShowRedirect(this, "/HumanResources/TalentRecruitment.aspx");
             }
         }
     }
     catch (Exception ex)
     {
         Common.MessageBox.ShowLayer(this, "添加失败!" + ex.Message, 2);
     }
     finally
     {
         BindData();
     }
 }