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

379 lines
17 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
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.Statistics
{
public partial class Staff : UserControl<Business.STAFF>
{
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack) return;
GridViewEx1.SelectingWithInit<Business.FAMILY>(ObjectDataSource1, GridPageEx1);
GridViewEx2.SelectingWithInit<Business.POSITION>(ObjectDataSource2, GridPageEx2,
DictionaryHelper.GetDictionary(Transaction, "VARIANT_TYPE").AsNewKeys("VARIANT_TYPE"));
GridViewEx3.SelectingWithInit<Business.REWARDPUNISHMENT>(ObjectDataSource3, GridPageEx3,
DictionaryHelper.GetDictionary(Transaction, "REWARDPUNISHMENT_TYPE").AsNewKeys("REWARDPUNISHMENT_TYPE"));
GridViewEx4.SelectingWithInit<Business.LEARNINGEXPERIENCE>(ObjectDataSource4, GridPageEx4,
DictionaryHelper.GetDictionary(Transaction, "EDUCATION").AsNewKeys("FULLTIME_EDUCATION"),
DictionaryHelper.GetDictionary(Transaction, "ACADEMIC_DEGREE").AsNewKeys("FULLTIME_ACADEMIC_DEGREE"));
GridViewEx5.SelectingWithInit<Business.LEARNINGEXPERIENCE>(ObjectDataSource5, GridPageEx5,
DictionaryHelper.GetDictionary(Transaction, "CERTIFICATE_EMPLOYMENT_TYPE").AsNewKeys("CERTIFICATE_EMPLOYMENT_TYPE"));
GridViewEx6.SelectingWithInit<Business.LEARNINGEXPERIENCE>(ObjectDataSource6, GridPageEx6,
DictionaryHelper.GetDictionary(Transaction, "EDUCATION").AsNewKeys("JOB_EDUCATION"),
DictionaryHelper.GetDictionary(Transaction, "ACADEMIC_DEGREE").AsNewKeys("JOB_ACADEMIC_DEGREE"));
GridViewEx7.SelectingWithInit<Business.SERVICECONTRACT>(ObjectDataSource7, GridPageEx7,
DictionaryHelper.GetDictionary(Transaction, "LABORCONTRACT_TYPE").AsNewKeys("LABORCONTRACT_TYPE"),
DictionaryHelper.GetDictionary(Transaction, "CONTRACT_TYPE").AsNewKeys("CONTRACT_TYPE"),
DictionaryHelper.GetDictionary(Transaction, "CONTRACT_STATE").AsNewKeys("SERVICECONTRACT_STATE"));
GridViewEx8.SelectingWithInit<Business.INOUTRECORD>(ObjectDataSource8, GridPageEx8);
GridViewEx9.SelectingWithInit<Business.PASSPORT>(ObjectDataSource9, GridPageEx9,
DictionaryHelper.GetDictionary(Transaction, "PASSPORT_STATE").AsNewKeys("PASSPORT_STATE"),
DictionaryHelper.GetDictionary(Transaction, "PASSPORT_TYPE").AsNewKeys("PASSPORT_TYPE"));
GridViewEx10.SelectingWithInit<Business.ASSESSMENT>(ObjectDataSource10, GridPageEx10);
AddPhoto.Visible = false;
Business.STAFF _STAFF = new Business.STAFF(Transaction);
_STAFF.STAFF_ID_Encrypt = Request["ID"];
if (_STAFF.Select())
{
if (_STAFF.ID_CARD_NO.Length == 18)
{
ID_CARD_NO.Text = _STAFF.ID_CARD_NO.Substring(0, 3) + "***********" + _STAFF.ID_CARD_NO.Substring(15, 3);
}
else if (_STAFF.ID_CARD_NO.Length == 15)
{
ID_CARD_NO.Text = _STAFF.ID_CARD_NO.Substring(0, 3) + "********" + _STAFF.ID_CARD_NO.Substring(12, 3);
}
if (!string.IsNullOrEmpty(_STAFF.PHONE_NUMBER) && _STAFF.PHONE_NUMBER.Length == 11)
{
PHONE_NUMBER.Text = _STAFF.PHONE_NUMBER.Substring(0, 3) + "****" + _STAFF.PHONE_NUMBER.Substring(8, 3);
}
}
//绑定兼职岗位
DataTable dt = (new Business.ADDITIONAL(Transaction)).ExecuteDataTable(
"SELECT * FROM PERSONNEL_STORAGE.T_ADDITIONAL WHERE STAFF_ID = " + Request["ID"].ToDecrypt());
ADDITIONAL_POSITION.Text = "";
foreach (DataRow row in dt.Rows)
{
string str = "";
//单位
if (!string.IsNullOrEmpty(row["ADDITIONAL_UNIT"].ToString()))
{
Business.DEPARTMENT _DEPARTMENT = new Business.DEPARTMENT(Transaction);
_DEPARTMENT.DEPARTMENT_ID_Encrypt = row["ADDITIONAL_UNIT"].ToEncrypt();
if (_DEPARTMENT.Select())
{
str += _DEPARTMENT.DEPARTMENT_NAME;
}
}
//部门
if (!string.IsNullOrEmpty(row["ADDITIONAL_DEPT"].ToString()))
{
Business.DEPARTMENT _DEPARTMENT = new Business.DEPARTMENT(Transaction);
_DEPARTMENT.DEPARTMENT_ID_Encrypt = row["ADDITIONAL_DEPT"].ToEncrypt();
if (_DEPARTMENT.Select())
{
str += _DEPARTMENT.DEPARTMENT_NAME;
}
}
//岗位
if (!string.IsNullOrEmpty(row["ADDITIONAL_POSITION"].ToString()))
{
Business.RANK _RANK = new Business.RANK(Transaction);
_RANK.RANK_ID_Encrypt = row["ADDITIONAL_POSITION"].ToEncrypt();
if (_RANK.Select())
{
str += _RANK.RANK_NAME;
}
}
ADDITIONAL_POSITION.Text += (string.IsNullOrEmpty(ADDITIONAL_POSITION.Text) ? "" : "") + str;
}
}
#region (Page_Load之前)DropDownList的数据源绑定等
public override void InitializeWebControl()
{
//健康状况
ISHEALTH.Items.Clear();
DictionaryHelper.BindingDropDownList("HEALTH", ISHEALTH.Items, this.Transaction);
//婚姻状况
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, "");
//兼职岗位
//ADDITIONAL_POSITION.Clear();
//_RANK.BindingDropDownList(this.ADDITIONAL_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);
//部门
DEPARTMENT_ID.Items.Clear();
Business.DEPARTMENT _DEPARTMENT = new Business.DEPARTMENT(this.Transaction);
_DEPARTMENT.BindingDropDownList(this.DEPARTMENT_ID.Items, "-1", 0, "");
//职级
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_GRADE.Items.Clear();
DictionaryHelper.BindingDropDownList("SKILL_LEVEL", SKILL_GRADE.Items, this.Transaction);
}
#endregion
//载入数据
public override bool LoadData()
{
//如果是工作流组件请自行修改载入的逻辑,以下是功能模块的默认代码
if (!String.IsNullOrEmpty(Request["ID"]))
{
CurrObject.STAFF_ID_Encrypt = Request["ID"];
if (this.Select())
{
if (CurrObject.STAFF_STATE == 2)
{
li_DIMISSION_DATE.Attributes["style"] = "display:block;";
}
else
{
li_DIMISSION_DATE.Attributes["style"] = "display:none;";
}
if (CurrObject.STAFF_STATE == 3)
{
li_RETIRE_DATE.Attributes["style"] = "display:block;";
}
else
{
li_RETIRE_DATE.Attributes["style"] = "display:none;";
}
}
return this.Select();
}
//默认返回值工作流组件返回True,功能模块返回False。
return (WorkFlowPage != null);
}
protected void GridViewEx1_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
{
e.AddAndParams("STAFF_ID", STAFF_ID.Text);
e.AddOrderByParams("FAMILY_RELATIONSHIPINDEX", false);
}
protected void GridViewEx2_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
{
e.AddAndParams("STAFF_ID", STAFF_ID.Text);
e.AddOrderByParams("APPOINTDISMISS_DATE", true);
}
protected void GridViewEx3_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
{
e.AddAndParams("STAFF_ID", STAFF_ID.Text);
e.AddOrderByParams("REWARDPUNISHMENT_ID", false);
}
protected void GridViewEx4_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
{
e.AddAndParams("STAFF_ID", STAFF_ID.Text);
e.AddOrderByParams("LEARNINGEXPERIENCE_ID", false);
}
protected void GridViewEx5_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
{
e.AddAndParams("STAFF_ID", STAFF_ID.Text);
e.AddOrderByParams("LEARNINGEXPERIENCE_ID", false);
}
protected void GridViewEx6_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
{
e.AddAndParams("STAFF_ID", STAFF_ID.Text);
e.AddOrderByParams("LEARNINGEXPERIENCE_ID", false);
}
protected void GridViewEx7_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
{
e.AddAndParams("STAFF_ID", STAFF_ID.Text);
e.AddOrderByParams("SERVICECONTRACT_ID", false);
}
protected void GridViewEx8_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
{
e.AddAndParams("STAFF_ID", STAFF_ID.Text);
e.AddOrderByParams("INOUTRECORD_ID", false);
}
protected void GridViewEx9_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
{
e.AddAndParams("STAFF_ID", STAFF_ID.Text);
e.AddOrderByParams("PASSPORT_ID", false);
}
protected void GridViewEx10_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
{
e.AddAndParams("STAFF_ID", STAFF_ID.Text);
e.AddOrderByParams("ASSESSMENT_DATE", true);
}
protected void GridPageEx1_CallBackPageChanged(object sender, ClientSetEventArgs e)
{
GridViewEx1.Pagging<Business.FAMILY>(ObjectDataSource1, GridPageEx1);
//设置UI变化
e.SetValue(GridViewEx1);
}
protected void GridPageEx2_CallBackPageChanged(object sender, ClientSetEventArgs e)
{
GridViewEx2.Pagging<Business.POSITION>(ObjectDataSource2, GridPageEx2);
//设置UI变化
e.SetValue(GridViewEx2);
}
protected void GridPageEx3_CallBackPageChanged(object sender, ClientSetEventArgs e)
{
GridViewEx3.Pagging<Business.REWARDPUNISHMENT>(ObjectDataSource3, GridPageEx3);
//设置UI变化
e.SetValue(GridViewEx3);
}
protected void GridPageEx4_CallBackPageChanged(object sender, ClientSetEventArgs e)
{
GridViewEx4.Pagging<Business.LEARNINGEXPERIENCE>(ObjectDataSource4, GridPageEx4);
//设置UI变化
e.SetValue(GridViewEx4);
}
protected void GridPageEx5_CallBackPageChanged(object sender, ClientSetEventArgs e)
{
GridViewEx5.Pagging<Business.LEARNINGEXPERIENCE>(ObjectDataSource5, GridPageEx5);
//设置UI变化
e.SetValue(GridViewEx5);
}
protected void GridPageEx6_CallBackPageChanged(object sender, ClientSetEventArgs e)
{
GridViewEx6.Pagging<Business.LEARNINGEXPERIENCE>(ObjectDataSource6, GridPageEx6);
//设置UI变化
e.SetValue(GridViewEx6);
}
protected void GridPageEx7_CallBackPageChanged(object sender, ClientSetEventArgs e)
{
GridViewEx7.Pagging<Business.SERVICECONTRACT>(ObjectDataSource7, GridPageEx7);
//设置UI变化
e.SetValue(GridViewEx7);
}
protected void GridPageEx8_CallBackPageChanged(object sender, ClientSetEventArgs e)
{
GridViewEx8.Pagging<Business.INOUTRECORD>(ObjectDataSource8, GridPageEx8);
//设置UI变化
e.SetValue(GridViewEx8);
}
protected void GridPageEx9_CallBackPageChanged(object sender, ClientSetEventArgs e)
{
GridViewEx9.Pagging<Business.PASSPORT>(ObjectDataSource9, GridPageEx9);
//设置UI变化
e.SetValue(GridViewEx9);
}
protected void GridPageEx10_CallBackPageChanged(object sender, ClientSetEventArgs e)
{
GridViewEx10.Pagging<Business.ASSESSMENT>(ObjectDataSource10, GridPageEx10);
//设置UI变化
e.SetValue(GridViewEx10);
}
protected void GridViewEx10_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[2].Text.Length > 30)
{
e.Row.Cells[2].ToolTip = e.Row.Cells[2].Text;
e.Row.Cells[2].Text = e.Row.Cells[2].Text.Substring(0, 30) + "...";
}
}
}
protected void GridViewEx2_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string _POSITION_ID = GridViewEx2.DataKeys[e.Row.RowIndex][0].ToEncrypt();//内码
string _VARIANT_TYPE = GridViewEx2.DataKeys[e.Row.RowIndex].Values["VARIANT_TYPE"].ToEncrypt();//异动类型
string _APPOINTDISMISS_DATE = GridViewEx2.DataKeys[e.Row.RowIndex].Values["APPOINTDISMISS_DATE"].ToEncrypt();//任免时间
//岗位
string _QUASI_POST = e.Row.Cells[3].Text.Replace("&nbsp;", "");
Business.RANK _RANKONE = new Business.RANK(Transaction);
try
{
if (!string.IsNullOrEmpty(_QUASI_POST))
{
_RANKONE.RANK_ID = int.Parse(_QUASI_POST);
if (_RANKONE.Select())
{
e.Row.Cells[3].Text = _RANKONE.RANK_NAME;
}
}
}
catch { }
if (_VARIANT_TYPE.ToDecrypt() == "免职")
{
if (!string.IsNullOrEmpty(_APPOINTDISMISS_DATE))
{
e.Row.Cells[6].Text = DateTime.Parse(_APPOINTDISMISS_DATE.ToDecrypt()).ToString("yyyy.MM");
}
}
else
{
if (!string.IsNullOrEmpty(_APPOINTDISMISS_DATE))
{
e.Row.Cells[5].Text = DateTime.Parse(_APPOINTDISMISS_DATE.ToDecrypt()).ToString("yyyy.MM");
}
}
}
}
}
}