104 lines
3.5 KiB
C#
104 lines
3.5 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Web;
|
||
using System.Web.UI;
|
||
using System.Web.UI.WebControls;
|
||
using SuperMap.RealEstate.CoreFrameWork;
|
||
using SuperMap.RealEstate.Web.UI;
|
||
using SuperMap.RealEstate.Web.UI.WebControls;
|
||
using Business = SuperMap.RealEstate.Personnel.Storage.Business;
|
||
|
||
namespace SuperMap.RealEstate.Personnel.Modules.Department
|
||
{
|
||
public partial class DepartmentGs : UserControl<Business.DEPARTMENT>
|
||
{
|
||
protected void Page_Load(object sender, EventArgs e)
|
||
{
|
||
}
|
||
|
||
//在此加入界面的数据初始化(Page_Load之前),如DropDownList的数据源绑定等
|
||
public override void InitializeWebControl()
|
||
{
|
||
if (base.Request["ID"] != null)
|
||
{
|
||
|
||
base.CurrObject.DEPARTMENT_ID_Encrypt = base.Request["ID"];
|
||
this.BindDropDownList(base.CurrObject.KeyID);
|
||
}
|
||
else
|
||
{
|
||
this.BindDropDownList(string.Empty);
|
||
}
|
||
DEPARTMENT_VALID.Clear();
|
||
DictionaryHelper.BindingDropDownList("isvalid", DEPARTMENT_VALID.Items, this.Transaction);
|
||
try
|
||
{
|
||
DEPARTMENT_VALID.SelectedValue = "1";
|
||
}
|
||
catch
|
||
{
|
||
|
||
}
|
||
CurrObject.BindingAuthorityDropDownList(DEPARTMENT_AUTHORITY.Items,"",Request["ProvinceCode"], DEPARTMENT_AUTHORITY.SelectedValue);
|
||
//DEPARTMENT_AUTHORITY
|
||
base.SetControlDefaultValue(new Control[]
|
||
{
|
||
this.DEPARTMENT_PID,
|
||
this.DEPARTMENT_INDEX,
|
||
this.DEPARTMENT_VALID
|
||
});
|
||
}
|
||
|
||
//载入数据
|
||
public override bool LoadData()
|
||
{
|
||
|
||
//如果是工作流组件请自行修改载入的逻辑,以下是功能模块的默认代码
|
||
if (!String.IsNullOrEmpty(Request["ID"]))
|
||
{
|
||
CurrObject.DEPARTMENT_ID_Encrypt = Request["ID"];
|
||
return this.Select();
|
||
}
|
||
//默认返回值,工作流组件返回True,功能模块返回False。
|
||
return (WorkFlowPage != null);
|
||
}
|
||
|
||
public void BindDropDownList(string disbledValue, string selectValue)
|
||
{
|
||
this.BindDropDownList(disbledValue);
|
||
this.DEPARTMENT_PID.Value = selectValue;
|
||
}
|
||
|
||
public void BindDropDownList(string disabledValue)
|
||
{
|
||
this.DEPARTMENT_PID.Items.Clear();
|
||
this.DEPARTMENT_PID.Items.Add(new ListItemEx
|
||
{
|
||
Value = "-1",
|
||
Text = "默认类别"
|
||
});
|
||
|
||
base.CurrObject.BindingDropDownList(this.DEPARTMENT_PID.Items, disabledValue, 0, "");
|
||
}
|
||
|
||
public override void OnDataAction_BeforeSave(DataActionEventArgs<Business.DEPARTMENT> e)
|
||
{
|
||
e.CurrObject.OPERATE_DATE = DateTime.Now;
|
||
e.CurrObject.OPERATE_USER = Page.PassportInfo.Name;
|
||
e.CurrObject.OPERATE_USERID = Page.PassportInfo.ID;
|
||
base.OnDataAction_BeforeSave(e);
|
||
}
|
||
|
||
public override void OnDataAction_BeforeDelete(DataActionEventArgs<Business.DEPARTMENT> e)
|
||
{
|
||
Business.STAFF _STAFF = new Business.STAFF(Transaction);
|
||
_STAFF.AddSearchParameter("DEPARTMENT_ID", CurrObject.DEPARTMENT_ID);
|
||
if (_STAFF.Search())
|
||
{
|
||
throw new Exception("该部门有员工,无法删除!");
|
||
}
|
||
base.OnDataAction_BeforeDelete(e);
|
||
}
|
||
}
|
||
} |