username@email.com
2025-05-15 6fe02a16e55f17e45a3997171e1b2284d45af25b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using CY.Model;
using CY.BLL;
using CY.Infrastructure.Common;
using CY.Infrastructure.Query;
 
namespace CY.WebForm.Pages.personnel
{
    //吴辉
    //新增/修改招聘信息    
    public partial class OA_StaffRecruitmentsAdd : BasePage
    {
        OA_StaffRecruitmentsBLL bll_OA_StaffRecruitmentsBLL = null;
        OA_StaffPostCategoryBLL bll_OA_StaffPostCategoryBLL = null;
        OA_StaffPostBLL bll_OA_StaffPostBLL = null;
        public string Province = ""; //接收值 Request["selectProvince"].ToString2();
        public string City = "";//接收值 Request["selectCity"].ToString2();
 
        //初始化
        public OA_StaffRecruitmentsAdd()
        {
            bll_OA_StaffRecruitmentsBLL = new OA_StaffRecruitmentsBLL();
            bll_OA_StaffPostCategoryBLL = new OA_StaffPostCategoryBLL();
            bll_OA_StaffPostBLL = new OA_StaffPostBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitData();
            }
        }
 
        //数据加载
        public void InitData()
        {
            Pagination pa = new Pagination();
            pa.PageSize = 500;
            pa.PageIndex = 1;
            this.selP_CateId.DataSource = bll_OA_StaffPostCategoryBLL.SelectModelPage(pa, AdminAccount.MemberId, "", null, null, null, "");
            this.selP_CateId.DataTextField = "PC_Name";
            this.selP_CateId.DataValueField = "Keyid";
            this.selP_CateId.DataBind();
            this.selP_CateId.Items.Insert(0, new ListItem("请选择", ""));
 
            OA_StaffRecruitments m_OA_StaffRecruitments = bll_OA_StaffRecruitmentsBLL.GetModelByKeyid(Request["keyid"].ToInt32());
            if (m_OA_StaffRecruitments != null)
            {
                OA_StaffPost m_OA_StaffPost = bll_OA_StaffPostBLL.GetModelByKeyid(m_OA_StaffRecruitments.Postid);
                this.selP_CateId.SelectedValue = m_OA_StaffPost.P_CateId.ToString2();
                Pagination pa1 = new Pagination();
                pa1.PageSize = 500;
                pa1.PageIndex = 1;
                this.txtPostid.DataSource = bll_OA_StaffPostBLL.SelectModelPage(pa1, AdminAccount.MemberId, "", null, this.selP_CateId.SelectedValue.ToInt32(), null, null, null, "");
                this.txtPostid.DataTextField = "P_Name";
                this.txtPostid.DataValueField = "Keyid";
                this.txtPostid.DataBind();
                this.txtPostid.Items.Insert(0, new ListItem("请选择", ""));
 
                this.txtPostid.Value = m_OA_StaffRecruitments.Postid.ToString2();
                Province = m_OA_StaffRecruitments.R_WorkProvence.ToString2();
                City = m_OA_StaffRecruitments.R_WorkCity.ToString2();
                this.txtR_EndTime.Value = m_OA_StaffRecruitments.R_EndTime.Value.ToString("yyyy-MM-dd");
                this.txtR_Vacancies.Value = m_OA_StaffRecruitments.R_Vacancies.ToString2();
                this.txtR_PostDetail.Text = m_OA_StaffRecruitments.R_PostDetail.ToString2();
                this.txtR_PostNeed.Text = m_OA_StaffRecruitments.R_PostNeed.ToString2();
                this.txtR_Salary.Value = m_OA_StaffRecruitments.R_Salary.ToString2();
            }
            else
            {
                this.txtR_EndTime.Value = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd");
            }
        }
 
        //表单提交
        protected void btn_submit_form(object sender, EventArgs e)
        {
            try
            {
                DateTime nowTime = DateTime.Now;
                if (string.IsNullOrEmpty(Request["selectProvince"].ToString2()) || string.IsNullOrEmpty(Request["selectCity"].ToString2()))
                {
                    JavaScript.MessageBox("请选择工作地点", this);
                    return;
                }
                if (string.IsNullOrEmpty(this.txtR_EndTime.Value))
                {
                    JavaScript.MessageBox("请选择报名结束时间", this);
                    return;
                }
                if (this.txtR_EndTime.Value.ToDateTime2() <= nowTime)
                {
                    JavaScript.MessageBox("报名结束时间 需 大于当前时间", this);
                    return;
                }
                OA_StaffRecruitments m_OA_StaffRecruitments = bll_OA_StaffRecruitmentsBLL.GetModelByKeyid(Request["keyid"].ToInt32());
                if (m_OA_StaffRecruitments == null)
                {
                    m_OA_StaffRecruitments = new OA_StaffRecruitments();
                    m_OA_StaffRecruitments.R_ResumeAllCount = 0;
                    m_OA_StaffRecruitments.R_ResumeNewCount = 0;
                    m_OA_StaffRecruitments.R_StartTime = DateTime.Now;
                    m_OA_StaffRecruitments.R_Status = 2;
                }
 
                if (m_OA_StaffRecruitments.R_Status == 0 || m_OA_StaffRecruitments.R_Status == 1)
                {
                    m_OA_StaffRecruitments.R_StartTime = DateTime.Now;
                    m_OA_StaffRecruitments.R_Status = 2;
                }
 
                m_OA_StaffRecruitments.FirmId = CurrentUser.MemberId;
                m_OA_StaffRecruitments.Postid = this.txtPostid.Value.ToInt32();
                m_OA_StaffRecruitments.R_WorkProvence = Request["selectProvince"].ToString2();
                m_OA_StaffRecruitments.R_WorkCity = Request["selectCity"].ToString2();
                m_OA_StaffRecruitments.R_EndTime = this.txtR_EndTime.Value.ToDateTime2();
                m_OA_StaffRecruitments.R_Vacancies = this.txtR_Vacancies.Value.ToInt32();
                m_OA_StaffRecruitments.R_PostDetail = this.txtR_PostDetail.Text.ToString2();
                m_OA_StaffRecruitments.R_PostNeed = this.txtR_PostNeed.Text.ToString2();
                m_OA_StaffRecruitments.R_Salary = this.txtR_Salary.Value.ToString2();
                m_OA_StaffRecruitments.LastUpdateTime = DateTime.Now;
                m_OA_StaffRecruitments.Operator = CurrentUser.ShortName;
                m_OA_StaffRecruitments.Remark = "";
 
                if (Request["keyid"].ToInt32() > 0)
                {
                    if (bll_OA_StaffRecruitmentsBLL.UpdateModel(m_OA_StaffRecruitments))
                        JavaScript.MessageBoxAndFirstRefresh("更新成功", this, true);
                    else
                        JavaScript.MessageBox("更新失败", this);
                }
                else
                {
                    if (bll_OA_StaffRecruitmentsBLL.InsertModel(m_OA_StaffRecruitments))
                        JavaScript.MessageBoxAndFirstRefresh("新增成功", this, false);
                    else
                        JavaScript.MessageBox("操作失败", this);
                }
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                JavaScript.MessageBox("操作失败", this);
            }
        }
 
        protected void selP_CateId_SelectedIndexChanged(object sender, EventArgs e)
        {
            Pagination pa = new Pagination();
            pa.PageSize = 500;
            pa.PageIndex = 1;
            this.txtPostid.DataSource = bll_OA_StaffPostBLL.SelectModelPage(pa, AdminAccount.MemberId, "", null, this.selP_CateId.SelectedValue.ToInt32(), null, null, null, "");
            this.txtPostid.DataTextField = "P_Name";
            this.txtPostid.DataValueField = "Keyid";
            this.txtPostid.DataBind();
            this.txtPostid.Items.Insert(0, new ListItem("请选择", ""));
        }
    }
}