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 SuperMap.RealEstate.Web.UI; using SuperMap.RealEstate.Web.UI.WebControls; using SuperMap.RealEstate.CoreFrameWork; using SuperMap.RealEstate.ServiceModel; using SuperMap.RealEstate.Utility; using SuperMap.RealEstate.Web.Utility; using SuperMap.RealEstate.CoreFrameWork.Dictionary.Business; using Business = SuperMap.RealEstate.Personnel.Storage.Business; namespace SuperMap.RealEstate.Personnel.Modules.Staff { public partial class AddContract : UserControl { protected void Page_Load(object sender, EventArgs e) { } //在此加入界面的数据初始化(Page_Load之前),如DropDownList的数据源绑定等 public override void InitializeWebControl() { //劳动合同类型 LABORCONTRACT_TYPE.Items.Clear(); DictionaryHelper.BindingDropDownList("LABORCONTRACT_TYPE", LABORCONTRACT_TYPE.Items, this.Transaction); //合同类型 CONTRACT_TYPE.Items.Clear(); DictionaryHelper.BindingDropDownList("CONTRACT_TYPE", CONTRACT_TYPE.Items, this.Transaction); //合同状态 SERVICECONTRACT_STATE.Items.Clear(); DictionaryHelper.BindingDropDownList("CONTRACT_STATE", SERVICECONTRACT_STATE.Items, this.Transaction); } //载入数据 public override bool LoadData() { STAFF_ID.Text = Request["STAFF_ID"].ToDecrypt(); //如果是工作流组件请自行修改载入的逻辑,以下是功能模块的默认代码 if (!String.IsNullOrEmpty(Request["ID"])) { CurrObject.SERVICECONTRACT_ID_Encrypt = Request["ID"]; return this.Select(); } //默认返回值,工作流组件返回True,功能模块返回False。 return (WorkFlowPage != null); } public override void OnDataAction_BeforeSave(DataActionEventArgs e) { e.CurrObject.OPERATE_DATE = DateTime.Now; e.CurrObject.OPERATE_USER = Page.PassportInfo.Name; e.CurrObject.OPERATE_USERID = Page.PassportInfo.ID; if (!string.IsNullOrEmpty(REMINDER_MONTH.Text)) { CurrObject.REMINDER_DATE = DateTime.Parse(EXPIRATION_DATE.Text).AddDays(int.Parse(REMINDER_MONTH.Text) * -1); } base.OnDataAction_BeforeSave(e); } protected void LABORCONTRACT_TYPE_CallBackSetControl(object sender, ClientSetEventArgs e) { if (LABORCONTRACT_TYPE.SelectedValue == "2") { e.SetValue(EXPIRATION_DATE, "9999-12-31"); } } } }