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

796 lines
34 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.Staff
{
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);
if (!string.IsNullOrEmpty(Request["ID"]))
{
AddFamily.Visible = true;
AddRewrd.Visible = true;
AddFullTime.Visible = true;
AddJob.Visible = true;
AddCERTIFICATE_EMPLOYMENT.Visible = true;
AddCon.Visible = true;
AddInOutInfo.Visible = true;
AddPassPort.Visible = true;
ADDASSESSMENT.Visible = true;
BtnPosition.Visible = true;
GridViewEx1.SetOpenControl(AddFamily, "AddFamilyPage.aspx?STAFF_ID=" + Request["ID"]);
GridViewEx2.SetOpenControl(BtnPosition, "/Personnel/Modules/Position/POSITIONList.aspx?STAFF_ID=" + Request["ID"], 1200, 600);
GridViewEx3.SetOpenControl(AddRewrd, "AddRewardPage.aspx?STAFF_ID=" + Request["ID"]);
GridViewEx4.SetOpenControl(AddFullTime, "AddFullPage.aspx?STAFF_ID=" + Request["ID"]);
GridViewEx5.SetOpenControl(AddCERTIFICATE_EMPLOYMENT, "AddCertifcatePage.aspx?STAFF_ID=" + Request["ID"]);
GridViewEx6.SetOpenControl(AddJob, "AddJobPage.aspx?STAFF_ID=" + Request["ID"]);
GridViewEx7.SetOpenControl(AddCon, "AddContractPage.aspx?STAFF_ID=" + Request["ID"]);
GridViewEx8.SetOpenControl(AddInOutInfo, "AddInOutPage.aspx?STAFF_ID=" + Request["ID"]);
GridViewEx9.SetOpenControl(AddPassPort, "AddPassPortPage.aspx?STAFF_ID=" + Request["ID"]);
GridViewEx10.SetOpenControl(ADDASSESSMENT, "AddAssessmentPage.aspx?STAFF_ID=" + Request["ID"]);
//绑定兼职岗位
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, "");
//员工状态
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);
//兼职岗位
//ADDITIONAL_POSITION.Clear();
//_RANK.BindingDropDownList(this.ADDITIONAL_POSITION.Items, "-1", 0, "");
}
#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);
}
#region ->
//OnDataAction_XXXXX 有一个系列可用,在此加入界面的逻辑处理
//e.CancelDataAction 来处理是否取消该动作;
//失败的原因可以用Page.Alert()传递到页面
public override void OnDataAction_BeforeSave(DataActionEventArgs<Business.STAFF> e)
{
//离职
if (STAFF_STATE.SelectedValue == "2")
{
if (string.IsNullOrEmpty(DIMISSION_DATE.Text))
{
e.CurrObject.DIMISSION_DATE = DateTime.Now;
}
e.CurrObject.WORK_EXPERIENCE += (string.IsNullOrEmpty(e.CurrObject.WORK_EXPERIENCE) ? "" : "\n") +
DIMISSION_DATE.Text.Replace(".", "/") + "- 离职";
e.CurrObject.RETIRE_DATE = null;
}
//退休
else if (STAFF_STATE.SelectedValue == "3")
{
if (string.IsNullOrEmpty(RETIRE_DATE.Text))
{
e.CurrObject.RETIRE_DATE = DateTime.Now;
}
e.CurrObject.WORK_EXPERIENCE += (string.IsNullOrEmpty(e.CurrObject.WORK_EXPERIENCE) ? "" : "\n") +
RETIRE_DATE.Text.Replace("-", "/") + "- 退休";
e.CurrObject.DIMISSION_DATE = null;
}
else
{
e.CurrObject.RETIRE_DATE = null;
e.CurrObject.DIMISSION_DATE = null;
}
e.CurrObject.OPERATE_DATE = DateTime.Now;
e.CurrObject.OPERATE_USER = Page.PassportInfo.Name;
e.CurrObject.OPERATE_USERID = Page.PassportInfo.ID;
if (!string.IsNullOrEmpty(Request["ID"]))
{
Business.STAFF _STAFF = new Business.STAFF(Transaction);
Business.ADDITIONAL _ADDITIONAL = new Business.ADDITIONAL(Transaction);
_ADDITIONAL.AddSearchParameter("STAFF_ID", Request["ID"].ToDecrypt());
_ADDITIONAL.AddSearchParameter("ADDITIONAL_DEPT", DEPARTMENT_ID.SelectedValue);
_ADDITIONAL.AddSearchParameter("ADDITIONAL_POSITION", CURRENT_POSITION.SelectedValue);
DataTable dt = _STAFF.ExecuteDataTable("SELECT * FROM PERSONNEL_STORAGE.T_STAFF WHERE STAFF_ID <> " +
CurrObject.STAFF_ID + " AND ID_CARD_NO = '" + CurrObject.ID_CARD_NO + "'");
if (dt.Rows.Count > 0)
{
throw new Exception("该身份证号已存在,请确认后添加!");
}
else if (_ADDITIONAL.Search())
{
throw new Exception("该岗位已兼职,请重新选择!");
}
}
else
{
Business.STAFF _STAFF = new Business.STAFF(Transaction);
_STAFF.AddSearchParameter("ID_CARD_NO", ID_CARD_NO.Text);
if (_STAFF.Search())
{
throw new Exception("该身份证号已存在,请确认后添加!");
}
}
if (CurrObject.ID_CARD_NO.Length != 15 && CurrObject.ID_CARD_NO.Length != 18)
{
throw new Exception("身份证号长度为15位或者18位,请确认后再保存!");
}
else
{
if (!CheckIDCard18(CurrObject.ID_CARD_NO) && !CheckIDCard15(CurrObject.ID_CARD_NO))
{
throw new Exception("请输入正确的身份证号码!");
}
}
base.OnDataAction_BeforeSave(e);
}
public override void OnDataAction_AfterSave(DataActionEventArgs<Business.STAFF> e)
{
#region
Business.POSITION _POSITION = new Business.POSITION(Transaction);
_POSITION.AddSearchParameter("STAFF_ID", CurrObject.STAFF_ID);
if (!_POSITION.Search())
{
Business.POSITION _POSITION_INSERT = new Business.POSITION(Transaction);
_POSITION_INSERT.STAFF_ID = CurrObject.STAFF_ID;
_POSITION_INSERT.QUASI_POST = CurrObject.CURRENT_POSITION.ToString();
_POSITION_INSERT.REMOVAL_REASON = "入职";
_POSITION_INSERT.APPROVAL_OPINION = "同意";
_POSITION_INSERT.APPOINTDISMISS_OPINOIN = "同意";
_POSITION_INSERT.APPOINTDISMISS_DATE = CurrObject.APPOINTMENT_TIME;
_POSITION_INSERT.OPERATE_DATE = DateTime.Now;
_POSITION_INSERT.OPERATE_USER = Page.PassportInfo.Name;
_POSITION_INSERT.OPERATE_USERID = Page.PassportInfo.ID;
_POSITION_INSERT.Insert();
}
#endregion
DataTable additional = (new Business.ADDITIONAL(Transaction)).ExecuteDataTable(
@"SELECT NVL(WM_CONCAT(DISTINCT ADDITIONAL_POSITION),'') AS CURRENT_POSITION
FROM PERSONNEL_STORAGE.T_ADDITIONAL WHERE STAFF_ID = " + CurrObject.STAFF_ID);
Business.STAFF _STAFF = new Business.STAFF(Transaction);
_STAFF.STAFF_ID = CurrObject.STAFF_ID.Value;
if (_STAFF.Select())
{
_STAFF.ADDITIONAL_POSITION = additional.Rows[0][0].ToString();
_STAFF.Update();
}
base.OnDataAction_AfterSave(e);
}
public override void OnDataAction_BeforeDelete(DataActionEventArgs<Business.STAFF> e)
{
Business.LEARNINGEXPERIENCE _LEARNINGEXPERIENCE = new Business.LEARNINGEXPERIENCE(Transaction);
_LEARNINGEXPERIENCE.AddSearchParameter("STAFF_ID", CurrObject.STAFF_ID);
if (_LEARNINGEXPERIENCE.Search())
{
_LEARNINGEXPERIENCE.Delete();
}
Business.FAMILY _FAMILY = new Business.FAMILY(Transaction);
_FAMILY.AddSearchParameter("STAFF_ID", CurrObject.STAFF_ID);
if (_FAMILY.Search())
{
_FAMILY.Delete();
}
Business.REWARDPUNISHMENT _REWARDPUNISHMENT = new Business.REWARDPUNISHMENT(Transaction);
_REWARDPUNISHMENT.AddSearchParameter("STAFF_ID", CurrObject.STAFF_ID);
if (_REWARDPUNISHMENT.Search())
{
_REWARDPUNISHMENT.Delete();
}
Business.ADDITIONAL _ADDITIONAL = new Business.ADDITIONAL(Transaction);
_ADDITIONAL.AddSearchParameter("STAFF_ID", CurrObject.STAFF_ID);
if (_ADDITIONAL.Search())
{
_ADDITIONAL.Delete();
}
base.OnDataAction_BeforeDelete(e);
}
#endregion
#region ->
protected void AddPhoto_Click(object sender, EventArgs e)
{
if (ButtonAddPhoto.FileName.ToString() == "")
{
Page.Alert("请选择图片!");
return;
}
if (string.IsNullOrEmpty(STAFF_ID.Text))
{
Page.Alert("请先保存员工信息!");
return;
}
string ImagePathSrc = string.Empty;
if (ButtonAddPhoto.HasFile)
{
string extension = Path.GetExtension(ButtonAddPhoto.PostedFile.FileName).ToLower();
if (extension != ".jpg" && extension != ".gif" && extension != ".png")
{
Page.Alert("图片格式不正确,请上传.jpg|.gif|.png格式的文件!");
return;
}
else if (ButtonAddPhoto.PostedFile.ContentLength > 819200)
{
Page.Alert("图片大小不能超过100K!");
return;
}
else
{
string newname = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss_ffff") + extension;
ImagePathSrc += "/UploadImage/UserPhoto/";
string savePath = Server.MapPath("~/UploadImage/UserPhoto/");
if (!Directory.Exists(savePath))
{
Directory.CreateDirectory(savePath);
}
ButtonAddPhoto.PostedFile.SaveAs(savePath + newname);
ImagePathSrc += newname;
Business.STAFF _STAFF = new Business.STAFF(Transaction);
_STAFF.STAFF_ID = int.Parse(STAFF_ID.Text);
if (_STAFF.Select())
{
_STAFF.AVATAR_ADDRESS = ImagePathSrc;
_STAFF.Update();
//刷新页面
Response.Redirect("StaffPage.aspx?ID=" + _STAFF.STAFF_ID_Encrypt);
}
}
}
}
#endregion
protected void ID_CARD_NO_CallBackSetControl(object sender, ClientSetEventArgs e)
{
if (ID_CARD_NO.Text.Length == 18)
{
try
{
int age = 0;
string birthdate = ID_CARD_NO.Text.Substring(6, 8);
string Sex = ID_CARD_NO.Text.Substring(16, 1);
int.Parse(birthdate);
string year = birthdate.Substring(0, 4);
string month = birthdate.Substring(4, 2);
string day = birthdate.Substring(6, 2);
STAFF_BIRTHDAY.Text = year + "-" + month + "-" + day;
e.SetValue(STAFF_BIRTHDAY);
Business.PLACEORIGIN _PLACEORIGIN = new Business.PLACEORIGIN(Transaction);
_PLACEORIGIN.AddSearchParameter("ID_NUMBER", ID_CARD_NO.Text.Substring(0, 6));
if (_PLACEORIGIN.Search())
{
e.SetValue(STAFF_ORIGIN, _PLACEORIGIN.REPRESENTATIVE_AREA);
}
if (int.Parse(Sex) % 2 == 0)
{
STAFF_SEX.SelectedValue = "2";
}
else
{
STAFF_SEX.SelectedValue = "1";
}
e.SetDropDownListEx(STAFF_SEX);
age = DateTime.Now.Year - int.Parse(year) - 1;
if (DateTime.Now.Month >= int.Parse(month))
{
if (DateTime.Now.Day >= int.Parse(day))
{
age += 1;
}
}
e.SetValue(STAFF_AGE, age.ToString());
}
catch
{
throw new Exception("请输入正确格式的身份证号码!");
}
}
}
protected void WORKDATE_CallBackSetControl(object sender, ClientSetEventArgs e)
{
DateTime T1 = DateTime.Parse(WORKDATE.Text);
TimeSpan span = DateTime.Now.Subtract(T1);
e.SetValue(WORKING_YEARS, (span.Days / 365).ToString());
}
#region ->
//公司司龄
protected void ENTER_COMPANY_CallBackSetControl(object sender, ClientSetEventArgs e)
{
DateTime T1 = DateTime.Parse(ENTER_COMPANY.Text);
TimeSpan span = DateTime.Now.Subtract(T1);
e.SetValue(ENTERCOMPANY_YEARS, (span.Days / 365).ToString());
}
//集团司龄
protected void GROUP_ENTERDATE_CallBackSetControl(object sender, ClientSetEventArgs e)
{
DateTime T1 = DateTime.Parse(GROUP_ENTERDATE.Text);
TimeSpan span = DateTime.Now.Subtract(T1);
e.SetValue(ENTERGROUP_YEARS, (span.Days / 365).ToString());
}
#endregion
protected void CURRENT_POSITION_CallBackSetControl(object sender, ClientSetEventArgs e)
{
if (!string.IsNullOrEmpty(CURRENT_POSITION.SelectedValue))
{
Business.RANK _RANK = new Business.RANK(Transaction);
_RANK.RANK_ID = int.Parse(CURRENT_POSITION.SelectedValue);
if (_RANK.Select())
{
STAFF_RANK.SelectedValue = _RANK.RANK_PID;
}
e.SetDropDownListEx(STAFF_RANK);
}
}
protected void STAFF_STATE_CallBackSetControl(object sender, ClientSetEventArgs e)
{
if (STAFF_STATE.SelectedValue == "2")
{
//DIMISSION_DATE.Visible = true;
//RETIRE_DATE.Visible = false;
e.SetVisible(li_DIMISSION_DATE, true);
e.SetVisible(li_RETIRE_DATE, false);
}
else if (STAFF_STATE.SelectedValue == "3")
{
//DIMISSION_DATE.Visible = false;
//RETIRE_DATE.Visible = true;
e.SetVisible(li_DIMISSION_DATE, false);
e.SetVisible(li_RETIRE_DATE, true);
}
else
{
//DIMISSION_DATE.Visible = false;
//RETIRE_DATE.Visible = false;
e.SetVisible(li_DIMISSION_DATE, false);
e.SetVisible(li_RETIRE_DATE, false);
}
e.SetValue(DIMISSION_DATE);
e.SetValue(RETIRE_DATE);
}
#region ->
#region SQL
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", false);
}
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("FULLTIME_GRADUATION_TIME", true);
}
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("JOB_GRADUATION_TIME", true);
}
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);
}
#endregion
#region
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);
}
#endregion
//行数据
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 { }
////岗位
//_QUASI_POST = e.Row.Cells[3].Text.Replace("&nbsp;", "");
//try
//{
// if (!string.IsNullOrEmpty(_CURRENT_POSITIONTxt))
// {
// _RANKONE.ResetProperty();
// _RANKONE.RANK_ID = int.Parse(_CURRENT_POSITIONTxt);
// if (_RANKONE.Select())
// {
// e.Row.Cells[3].Text = _RANKONE.RANK_NAME;
// }
// }
//}
//catch { }
LinkButton _ButtonRm = e.Row.Cells[8].FindControl("ButtonRm") as LinkButton;
if (!string.IsNullOrEmpty(STAFF_ID.Text))
{
_ButtonRm.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript(string.Format(
"../Position/Attachment/ATTACHMENTList.aspx?RELATION_ID={0}&STAFF_ID={1}", _POSITION_ID, STAFF_ID.Text.ToEncrypt()), 1000, 800);
}
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");
}
}
}
}
#endregion
/// 18位身份证号码验证
/// </summary>
private bool CheckIDCard18(string idNumber)
{
long n = 0;
if (long.TryParse(idNumber.Remove(17), out n) == false || n < Math.Pow(10, 16) || long.TryParse(idNumber.Replace('x', '0').Replace('X', '0'), out n) == false)
{
return false;//数字验证
}
string address = "11x22x35x44x53x12x23x36x45x54x13x31x37x46x61x14x32x41x50x62x15x33x42x51x63x21x34x43x52x64x65x71x81x82x91";
if (address.IndexOf(idNumber.Remove(2)) == -1)
{
return false;//省份验证
}
string birth = idNumber.Substring(6, 8).Insert(6, "-").Insert(4, "-");
DateTime time = new DateTime();
if (DateTime.TryParse(birth, out time) == false)
{
return false;//生日验证
}
string[] arrVarifyCode = ("1,0,x,9,8,7,6,5,4,3,2").Split(',');
string[] Wi = ("7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2").Split(',');
char[] Ai = idNumber.Remove(17).ToCharArray();
int sum = 0;
for (int i = 0; i < 17; i++)
{
sum += int.Parse(Wi[i]) * int.Parse(Ai[i].ToString());
}
int y = -1;
Math.DivRem(sum, 11, out y);
if (arrVarifyCode[y] != idNumber.Substring(17, 1).ToLower())
{
return false;//校验码验证
}
return true;//符合GB11643-1999标准
}
/// <summary> 15位身份证号码验证
/// </summary>
private bool CheckIDCard15(string idNumber)
{
long n = 0;
if (long.TryParse(idNumber, out n) == false || n < Math.Pow(10, 14))
{
return false;//数字验证
}
string address = "11x22x35x44x53x12x23x36x45x54x13x31x37x46x61x14x32x41x50x62x15x33x42x51x63x21x34x43x52x64x65x71x81x82x91";
if (address.IndexOf(idNumber.Remove(2)) == -1)
{
return false;//省份验证
}
string birth = idNumber.Substring(6, 6).Insert(4, "-").Insert(2, "-");
DateTime time = new DateTime();
if (DateTime.TryParse(birth, out time) == false)
{
return false;//生日验证
}
return true;
}
}
}