2025-03-27 15:05:14 +08:00

613 lines
22 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SuperMap.RealEstate.CoreFrameWork;
using SuperMap.RealEstate.ServiceModel;
using SuperMap.RealEstate.Utility;
using SuperMap.RealEstate.Web.UI;
using SuperMap.RealEstate.Web.UI.WebControls;
using SuperMap.RealEstate.Web.Utility;
using Business = SuperMap.RealEstate.Personnel.Storage.Business;
namespace SuperMap.RealEstate.Personnel.Modules.Statistics
{
public partial class StatisticPage : SuperMap.RealEstate.Web.UI.PageValid
{
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack) return;
//婚姻状况
MARITAL_STATUS.Items.Clear();
DictionaryHelper.BindingDropDownList("MARITAL_STATUS", MARITAL_STATUS.Items, this.Transaction);
//性别
STAFF_SEX.Items.Clear();
DictionaryHelper.BindingDropDownList("SEX_TYPE", STAFF_SEX.Items, this.Transaction);
//民族
STAFF_NATION.Items.Clear();
DictionaryHelper.BindingDropDownList("NATION", STAFF_NATION.Items, this.Transaction);
//现任岗位
CURRENT_POSITION.Clear();
Business.RANK _RANK = new Business.RANK(Transaction);
_RANK.BindingDropDownList(this.CURRENT_POSITION.Items, "-1", 0, "");
//员工状态
STAFF_STATE.Items.Clear();
DictionaryHelper.BindingDropDownList("PERSONNEL_STATE", STAFF_STATE.Items, this.Transaction);
//学历
HIGHEST_EDUCATION.Items.Clear();
DictionaryHelper.BindingDropDownList("EDUCATION", HIGHEST_EDUCATION.Items, this.Transaction);
//学位
ACADEMIC_DEGREE.Clear();
DictionaryHelper.BindingDropDownList("ACADEMIC_DEGREE", ACADEMIC_DEGREE.Items, this.Transaction);
//用工模式
CONTRACT_TYPE.Items.Clear();
DictionaryHelper.BindingDropDownList("CONTRACT_TYPE", CONTRACT_TYPE.Items, this.Transaction);
//合同类型
LABORCONTRACT_TYPE.Items.Clear();
DictionaryHelper.BindingDropDownList("LABORCONTRACT_TYPE", LABORCONTRACT_TYPE.Items, this.Transaction);
//资格证类型
CERTIFICATE_EMPLOYMENT_TYPE.Clear();
DictionaryHelper.BindingDropDownList("CERTIFICATE_EMPLOYMENT_TYPE", CERTIFICATE_EMPLOYMENT_TYPE.Items, this.Transaction);
//职级
STAFF_RANK.Clear();
DataTable dt = _RANK.ExecuteDataTable(
"SELECT RANK_ID,RANK_NAME FROM PERSONNEL_STORAGE.T_RANK WHERE RANK_PID = -1 ORDER BY RANK_INDEX,RANK_ID");
foreach (DataRow dr in dt.Rows)
{
ListItemEx _ListItemEx = new ListItemEx();
_ListItemEx.Text = dr["RANK_NAME"].ToString();
_ListItemEx.Value = dr["RANK_ID"].ToString();
STAFF_RANK.Items.Add(_ListItemEx);
}
//职称
SKILL_LEVEL.Items.Clear();
DictionaryHelper.BindingDropDownList("SKILL_LEVEL", SKILL_LEVEL.Items, this.Transaction);
SessionRead();
//ButtonSave.Attributes.Add("onclick", "refreshParent()");
//设置清空提示
SetControlConfirm(ButtonDelete, "您确定要清空所有查询条件吗?");
//设置按钮状态
SetControlClientAction(ButtonDelete, false, true, true);
SetControlClientAction(ButtonSave);
//注册遮罩式窗口关闭脚本
SetControlClosePopDialog(ButtonClose);
}
#region ->
protected void ButtonSave_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(CERTIFICATE_EMPLOYMENT_TYPE.SelectedValue) &&
!string.IsNullOrEmpty(CERTIFICATE_EMPLOYMENT_LEVEL.Text))
{
Alert("请选择资格证类型!");
return;
}
if (!string.IsNullOrEmpty(CERTIFICATE_EMPLOYMENT_TYPE.SelectedValue) &&
string.IsNullOrEmpty(CERTIFICATE_EMPLOYMENT_LEVEL.Text))
{
Alert("请填写资格等级!");
return;
}
SessionAccess();
//Alert("设置成功!", 3);
//Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language=javascript>top.location.reload(); </script>");
//Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language=javascript>pop-dialog-mask-iframe.window.location.reload(); </script>");
ClosePopDialog();
//RefreshOpenerGridPage(RefreshGridPageType.Update);
//Response.Redirect("/Personnel/Modules/Statistics/StaffList.aspx");
}
#endregion
#region ->
protected void ButtonDelete_Click(object sender, EventArgs e)
{
Session["Statistic"] = null;
Response.Redirect(Request.Url.ToString());
}
#endregion
#region Session
private void SessionAccess()
{
Dictionary<string, object> _Dic = null;
try
{
_Dic = Session["Statistic"] == null ? new Dictionary<string, object>() :
(Dictionary<string, object>)Session["Statistic"];
}
catch
{
_Dic = new Dictionary<string, object>();
}
#region Session
//性别
if (_Dic.ContainsKey("STAFF_SEX"))
{
_Dic["STAFF_SEX"] = STAFF_SEX.SelectedValue;
}
else
{
_Dic.Add("STAFF_SEX", STAFF_SEX.SelectedValue);
}
//职级
if (_Dic.ContainsKey("STAFF_RANK"))
{
_Dic["STAFF_RANK"] = STAFF_RANK.SelectedValue;
}
else
{
_Dic.Add("STAFF_RANK", STAFF_RANK.SelectedValue);
}
//岗位
if (_Dic.ContainsKey("CURRENT_POSITION"))
{
_Dic["CURRENT_POSITION"] = CURRENT_POSITION.SelectedValue;
}
else
{
_Dic.Add("CURRENT_POSITION", CURRENT_POSITION.SelectedValue);
}
//学位
if (_Dic.ContainsKey("ACADEMIC_DEGREE"))
{
_Dic["ACADEMIC_DEGREE"] = ACADEMIC_DEGREE.SelectedValue;
}
else
{
_Dic.Add("ACADEMIC_DEGREE", ACADEMIC_DEGREE.SelectedValue);
}
//学历
if (_Dic.ContainsKey("HIGHEST_EDUCATION"))
{
_Dic["HIGHEST_EDUCATION"] = HIGHEST_EDUCATION.SelectedValue;
}
else
{
_Dic.Add("HIGHEST_EDUCATION", HIGHEST_EDUCATION.SelectedValue);
}
//学历
if (_Dic.ContainsKey("STAFF_STATE"))
{
_Dic["STAFF_STATE"] = STAFF_STATE.SelectedValue;
}
else
{
_Dic.Add("STAFF_STATE", STAFF_STATE.SelectedValue);
}
//合同类型
if (_Dic.ContainsKey("LABORCONTRACT_TYPE"))
{
_Dic["LABORCONTRACT_TYPE"] = LABORCONTRACT_TYPE.SelectedValue;
}
else
{
_Dic.Add("LABORCONTRACT_TYPE", LABORCONTRACT_TYPE.SelectedValue);
}
//用工模式
if (_Dic.ContainsKey("CONTRACT_TYPE"))
{
_Dic["CONTRACT_TYPE"] = CONTRACT_TYPE.SelectedValue;
}
else
{
_Dic.Add("CONTRACT_TYPE", CONTRACT_TYPE.SelectedValue);
}
//婚姻状况
if (_Dic.ContainsKey("MARITAL_STATUS"))
{
_Dic["MARITAL_STATUS"] = MARITAL_STATUS.SelectedValue;
}
else
{
_Dic.Add("MARITAL_STATUS", MARITAL_STATUS.SelectedValue);
}
//民族
if (_Dic.ContainsKey("STAFF_NATION"))
{
_Dic["STAFF_NATION"] = STAFF_NATION.SelectedValue;
}
else
{
_Dic.Add("STAFF_NATION", STAFF_NATION.SelectedValue);
}
//资格证类型
if (_Dic.ContainsKey("CERTIFICATE_EMPLOYMENT_TYPE"))
{
_Dic["CERTIFICATE_EMPLOYMENT_TYPE"] = CERTIFICATE_EMPLOYMENT_TYPE.SelectedValue;
}
else
{
_Dic.Add("CERTIFICATE_EMPLOYMENT_TYPE", CERTIFICATE_EMPLOYMENT_TYPE.SelectedValue);
}
//开始出生日期
if (_Dic.ContainsKey("StartDate_Birth"))
{
_Dic["StartDate_Birth"] = StartDate_Birth.Text;
}
else
{
_Dic["StartDate_Birth"] = StartDate_Birth.Text;
}
//结束出生日期
if (_Dic.ContainsKey("EndDate_Birth"))
{
_Dic["EndDate_Birth"] = EndDate_Birth.Text;
}
else
{
_Dic["EndDate_Birth"] = EndDate_Birth.Text;
}
//开始工作时间
if (_Dic.ContainsKey("StartDate_WORKDATE"))
{
_Dic["StartDate_WORKDATE"] = StartDate_WORKDATE.Text;
}
else
{
_Dic["StartDate_WORKDATE"] = StartDate_WORKDATE.Text;
}
//结束工作时间
if (_Dic.ContainsKey("EndDate_WORKDATE"))
{
_Dic["EndDate_WORKDATE"] = EndDate_WORKDATE.Text;
}
else
{
_Dic["EndDate_WORKDATE"] = EndDate_WORKDATE.Text;
}
//开始进入公司时间
if (_Dic.ContainsKey("StartDate_ENTER_COMPANY"))
{
_Dic["StartDate_ENTER_COMPANY"] = StartDate_ENTER_COMPANY.Text;
}
else
{
_Dic["StartDate_ENTER_COMPANY"] = StartDate_ENTER_COMPANY.Text;
}
//结束进入公司时间
if (_Dic.ContainsKey("EndDate_ENTER_COMPANY"))
{
_Dic["EndDate_ENTER_COMPANY"] = EndDate_ENTER_COMPANY.Text;
}
else
{
_Dic["EndDate_ENTER_COMPANY"] = EndDate_ENTER_COMPANY.Text;
}
//开始任职时间
if (_Dic.ContainsKey("StartDate_APPOINTMENT_TIME"))
{
_Dic["StartDate_APPOINTMENT_TIME"] = StartDate_APPOINTMENT_TIME.Text;
}
else
{
_Dic["StartDate_APPOINTMENT_TIME"] = StartDate_APPOINTMENT_TIME.Text;
}
//结束任职时间
if (_Dic.ContainsKey("EndDate_APPOINTMENT_TIME"))
{
_Dic["EndDate_APPOINTMENT_TIME"] = EndDate_APPOINTMENT_TIME.Text;
}
else
{
_Dic["EndDate_APPOINTMENT_TIME"] = EndDate_APPOINTMENT_TIME.Text;
}
//开始入党时间
if (_Dic.ContainsKey("StartDate_JOINPARTYDATE"))
{
_Dic["StartDate_JOINPARTYDATE"] = StartDate_JOINPARTYDATE.Text;
}
else
{
_Dic["StartDate_JOINPARTYDATE"] = StartDate_JOINPARTYDATE.Text;
}
//结束入党时间
if (_Dic.ContainsKey("EndDate_JOINPARTYDATE"))
{
_Dic["EndDate_JOINPARTYDATE"] = EndDate_JOINPARTYDATE.Text;
}
else
{
_Dic["EndDate_JOINPARTYDATE"] = EndDate_JOINPARTYDATE.Text;
}
//开始合同时间
if (_Dic.ContainsKey("StartDate_CONTRACT"))
{
_Dic["StartDate_CONTRACT"] = StartDate_CONTRACT.Text;
}
else
{
_Dic["StartDate_CONTRACT"] = StartDate_CONTRACT.Text;
}
//结束合同时间
if (_Dic.ContainsKey("EndDate_CONTRACT"))
{
_Dic["EndDate_CONTRACT"] = EndDate_CONTRACT.Text;
}
else
{
_Dic["EndDate_CONTRACT"] = EndDate_CONTRACT.Text;
}
//开始工龄
if (_Dic.ContainsKey("Start_WORKING_YEARS"))
{
_Dic["Start_WORKING_YEARS"] = Start_WORKING_YEARS.Text;
}
else
{
_Dic["Start_WORKING_YEARS"] = Start_WORKING_YEARS.Text;
}
//结束工龄
if (_Dic.ContainsKey("End_WORKING_YEARS"))
{
_Dic["End_WORKING_YEARS"] = End_WORKING_YEARS.Text;
}
else
{
_Dic["End_WORKING_YEARS"] = End_WORKING_YEARS.Text;
}
//开始司龄
if (_Dic.ContainsKey("Start_ENTERCOMPANY_YEARS"))
{
_Dic["Start_ENTERCOMPANY_YEARS"] = Start_ENTERCOMPANY_YEARS.Text;
}
else
{
_Dic["Start_ENTERCOMPANY_YEARS"] = Start_ENTERCOMPANY_YEARS.Text;
}
//结束司龄
if (_Dic.ContainsKey("End_ENTERCOMPANY_YEARS"))
{
_Dic["End_ENTERCOMPANY_YEARS"] = End_ENTERCOMPANY_YEARS.Text;
}
else
{
_Dic["End_ENTERCOMPANY_YEARS"] = End_ENTERCOMPANY_YEARS.Text;
}
//开始年龄
if (_Dic.ContainsKey("Start_STAFF_AGE"))
{
_Dic["Start_STAFF_AGE"] = Start_STAFF_AGE.Text;
}
else
{
_Dic["Start_STAFF_AGE"] = Start_STAFF_AGE.Text;
}
//结束年龄
if (_Dic.ContainsKey("End_STAFF_AGE"))
{
_Dic["End_STAFF_AGE"] = End_STAFF_AGE.Text;
}
else
{
_Dic["End_STAFF_AGE"] = End_STAFF_AGE.Text;
}
//专业等级
if (_Dic.ContainsKey("SKILL_CLASS"))
{
_Dic["SKILL_CLASS"] = SKILL_CLASS.Text;
}
else
{
_Dic["SKILL_CLASS"] = SKILL_CLASS.Text;
}
//资格等级
if (_Dic.ContainsKey("CERTIFICATE_EMPLOYMENT_LEVEL"))
{
_Dic["CERTIFICATE_EMPLOYMENT_LEVEL"] = CERTIFICATE_EMPLOYMENT_LEVEL.Text;
}
else
{
_Dic["CERTIFICATE_EMPLOYMENT_LEVEL"] = CERTIFICATE_EMPLOYMENT_LEVEL.Text;
}
//职称
if (_Dic.ContainsKey("SKILL_LEVEL"))
{
_Dic["SKILL_LEVEL"] = SKILL_LEVEL.SelectedValue;
}
else
{
_Dic.Add("SKILL_LEVEL", SKILL_LEVEL.SelectedValue);
}
//政治面貌
if (_Dic.ContainsKey("POLITICAL_VISAGE"))
{
_Dic["POLITICAL_VISAGE"] = POLITICAL_VISAGE.Text;
}
else
{
_Dic["POLITICAL_VISAGE"] = POLITICAL_VISAGE.Text;
}
#endregion
Session["Statistic"] = _Dic;
}
#endregion
#region Session
private Dictionary<string, object> SessionRead()
{
Dictionary<string, object> _Dic = null;
try
{
_Dic = Session["Statistic"] == null ? new Dictionary<string, object>() :
(Dictionary<string, object>)Session["Statistic"];
}
catch
{
_Dic = new Dictionary<string, object>();
}
if (_Dic.ContainsKey("STAFF_SEX") && _Dic["STAFF_SEX"] != null)
{
STAFF_SEX.SelectedValue = _Dic["STAFF_SEX"].ToString();
}
if (_Dic.ContainsKey("STAFF_RANK") && _Dic["STAFF_RANK"] != null)
{
STAFF_RANK.SelectedValue = _Dic["STAFF_RANK"].ToString();
}
if (_Dic.ContainsKey("CURRENT_POSITION") && _Dic["CURRENT_POSITION"] != null)
{
CURRENT_POSITION.SelectedValue = _Dic["CURRENT_POSITION"].ToString();
}
if (_Dic.ContainsKey("HIGHEST_EDUCATION") && _Dic["HIGHEST_EDUCATION"] != null)
{
HIGHEST_EDUCATION.SelectedValue = _Dic["HIGHEST_EDUCATION"].ToString();
}
if (_Dic.ContainsKey("ACADEMIC_DEGREE") && _Dic["ACADEMIC_DEGREE"] != null)
{
ACADEMIC_DEGREE.SelectedValue = _Dic["ACADEMIC_DEGREE"].ToString();
}
if (_Dic.ContainsKey("STAFF_STATE") && _Dic["STAFF_STATE"] != null)
{
STAFF_STATE.SelectedValue = _Dic["STAFF_STATE"].ToString();
}
if (_Dic.ContainsKey("LABORCONTRACT_TYPE") && _Dic["LABORCONTRACT_TYPE"] != null)
{
LABORCONTRACT_TYPE.SelectedValue = _Dic["LABORCONTRACT_TYPE"].ToString();
}
if (_Dic.ContainsKey("CONTRACT_TYPE") && _Dic["CONTRACT_TYPE"] != null)
{
CONTRACT_TYPE.SelectedValue = _Dic["CONTRACT_TYPE"].ToString();
}
if (_Dic.ContainsKey("MARITAL_STATUS") && _Dic["MARITAL_STATUS"] != null)
{
MARITAL_STATUS.SelectedValue = _Dic["MARITAL_STATUS"].ToString();
}
if (_Dic.ContainsKey("STAFF_NATION") && _Dic["STAFF_NATION"] != null)
{
STAFF_NATION.SelectedValue = _Dic["STAFF_NATION"].ToString();
}
if (_Dic.ContainsKey("CERTIFICATE_EMPLOYMENT_TYPE") && _Dic["CERTIFICATE_EMPLOYMENT_TYPE"] != null)
{
CERTIFICATE_EMPLOYMENT_TYPE.SelectedValue = _Dic["CERTIFICATE_EMPLOYMENT_TYPE"].ToString();
}
if (_Dic.ContainsKey("StartDate_Birth") && _Dic["StartDate_Birth"] != null)
{
StartDate_Birth.Text = _Dic["StartDate_Birth"].ToString();
}
if (_Dic.ContainsKey("EndDate_Birth") && _Dic["EndDate_Birth"] != null)
{
EndDate_Birth.Text = _Dic["EndDate_Birth"].ToString();
}
if (_Dic.ContainsKey("StartDate_WORKDATE") && _Dic["StartDate_WORKDATE"] != null)
{
StartDate_WORKDATE.Text = _Dic["StartDate_WORKDATE"].ToString();
}
if (_Dic.ContainsKey("EndDate_WORKDATE") && _Dic["EndDate_WORKDATE"] != null)
{
EndDate_WORKDATE.Text = _Dic["EndDate_WORKDATE"].ToString();
}
if (_Dic.ContainsKey("StartDate_ENTER_COMPANY") && _Dic["StartDate_ENTER_COMPANY"] != null)
{
StartDate_ENTER_COMPANY.Text = _Dic["StartDate_ENTER_COMPANY"].ToString();
}
if (_Dic.ContainsKey("EndDate_ENTER_COMPANY") && _Dic["EndDate_ENTER_COMPANY"] != null)
{
EndDate_ENTER_COMPANY.Text = _Dic["EndDate_ENTER_COMPANY"].ToString();
}
if (_Dic.ContainsKey("StartDate_APPOINTMENT_TIME") && _Dic["StartDate_APPOINTMENT_TIME"] != null)
{
StartDate_APPOINTMENT_TIME.Text = _Dic["StartDate_APPOINTMENT_TIME"].ToString();
}
if (_Dic.ContainsKey("EndDate_APPOINTMENT_TIME") && _Dic["EndDate_APPOINTMENT_TIME"] != null)
{
EndDate_APPOINTMENT_TIME.Text = _Dic["EndDate_APPOINTMENT_TIME"].ToString();
}
if (_Dic.ContainsKey("StartDate_JOINPARTYDATE") && _Dic["StartDate_JOINPARTYDATE"] != null)
{
StartDate_JOINPARTYDATE.Text = _Dic["StartDate_JOINPARTYDATE"].ToString();
}
if (_Dic.ContainsKey("EndDate_JOINPARTYDATE") && _Dic["EndDate_JOINPARTYDATE"] != null)
{
EndDate_JOINPARTYDATE.Text = _Dic["EndDate_JOINPARTYDATE"].ToString();
}
if (_Dic.ContainsKey("StartDate_CONTRACT") && _Dic["StartDate_CONTRACT"] != null)
{
StartDate_CONTRACT.Text = _Dic["StartDate_CONTRACT"].ToString();
}
if (_Dic.ContainsKey("EndDate_CONTRACT") && _Dic["EndDate_CONTRACT"] != null)
{
EndDate_CONTRACT.Text = _Dic["EndDate_CONTRACT"].ToString();
}
if (_Dic.ContainsKey("Start_WORKING_YEARS") && _Dic["Start_WORKING_YEARS"] != null)
{
Start_WORKING_YEARS.Text = _Dic["Start_WORKING_YEARS"].ToString();
}
if (_Dic.ContainsKey("End_WORKING_YEARS") && _Dic["End_WORKING_YEARS"] != null)
{
End_WORKING_YEARS.Text = _Dic["End_WORKING_YEARS"].ToString();
}
if (_Dic.ContainsKey("Start_ENTERCOMPANY_YEARS") && _Dic["Start_ENTERCOMPANY_YEARS"] != null)
{
Start_ENTERCOMPANY_YEARS.Text = _Dic["Start_ENTERCOMPANY_YEARS"].ToString();
}
if (_Dic.ContainsKey("End_ENTERCOMPANY_YEARS") && _Dic["End_ENTERCOMPANY_YEARS"] != null)
{
End_ENTERCOMPANY_YEARS.Text = _Dic["End_ENTERCOMPANY_YEARS"].ToString();
}
if (_Dic.ContainsKey("Start_STAFF_AGE") && _Dic["Start_STAFF_AGE"] != null)
{
Start_STAFF_AGE.Text = _Dic["Start_STAFF_AGE"].ToString();
}
if (_Dic.ContainsKey("End_STAFF_AGE") && _Dic["End_STAFF_AGE"] != null)
{
End_STAFF_AGE.Text = _Dic["End_STAFF_AGE"].ToString();
}
if (_Dic.ContainsKey("SKILL_CLASS") && _Dic["SKILL_CLASS"] != null)
{
SKILL_CLASS.Text = _Dic["SKILL_CLASS"].ToString();
}
if (_Dic.ContainsKey("CERTIFICATE_EMPLOYMENT_LEVEL") && _Dic["CERTIFICATE_EMPLOYMENT_LEVEL"] != null)
{
CERTIFICATE_EMPLOYMENT_LEVEL.Text = _Dic["CERTIFICATE_EMPLOYMENT_LEVEL"].ToString();
}
if (_Dic.ContainsKey("SKILL_LEVEL") && _Dic["SKILL_LEVEL"] != null)
{
SKILL_LEVEL.SelectedValue = _Dic["SKILL_LEVEL"].ToString();
}
if (_Dic.ContainsKey("POLITICAL_VISAGE") && _Dic["POLITICAL_VISAGE"] != null)
{
POLITICAL_VISAGE.Text = _Dic["POLITICAL_VISAGE"].ToString();
}
return _Dic;
}
#endregion
}
}