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_StaffPostCategoryAdd : BasePage { OA_StaffPostCategoryBLL bll_OA_StaffPostCategoryBLL = null; //初始化 public OA_StaffPostCategoryAdd() { bll_OA_StaffPostCategoryBLL = new OA_StaffPostCategoryBLL(); } //页面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitData(); } } //数据加载 public void InitData() { OA_StaffPostCategory m_OA_StaffPostCategory = bll_OA_StaffPostCategoryBLL.GetModelByKeyid(Request["keyid"].ToInt32()); if (m_OA_StaffPostCategory != null) { this.txtPC_Name.Value = m_OA_StaffPostCategory.PC_Name.ToString2(); this.txtOrderNum.Value = m_OA_StaffPostCategory.OrderNum.ToString2(); } } //表单提交 protected void btn_submit_form(object sender, EventArgs e) { try { DateTime nowTime = DateTime.Now; OA_StaffPostCategory m_OA_StaffPostCategory = bll_OA_StaffPostCategoryBLL.GetModelByKeyid(Request["keyid"].ToInt32()); if (m_OA_StaffPostCategory == null) { m_OA_StaffPostCategory = new OA_StaffPostCategory(); } m_OA_StaffPostCategory.Memberid = AdminAccount.MemberId; m_OA_StaffPostCategory.PC_Name = this.txtPC_Name.Value.ToString2(); m_OA_StaffPostCategory.OrderNum = this.txtOrderNum.Value.ToInt32(); m_OA_StaffPostCategory.LastUpdateTime = DateTime.Now; m_OA_StaffPostCategory.Operator = CurrentUser.ShortName; if (Request["keyid"].ToInt32() > 0) { if (bll_OA_StaffPostCategoryBLL.UpdateModel(m_OA_StaffPostCategory)) JavaScript.MessageBoxAndFirstRefresh("更新成功", this, true); else JavaScript.MessageBox("更新失败", this); } else { if (bll_OA_StaffPostCategoryBLL.InsertModel(m_OA_StaffPostCategory)) JavaScript.MessageBoxAndFirstRefresh("新增成功", this, false); else JavaScript.MessageBox("操作失败", this); } } catch (Exception ex) { PAGEHandleException(ex); JavaScript.MessageBox("操作失败", this); } } } }