542 lines
20 KiB
C#
542 lines
20 KiB
C#
using BLL;
|
|
using System;
|
|
|
|
namespace FineUIPro.Web.Person
|
|
{
|
|
public partial class PersonView : PageBase
|
|
{
|
|
#region 定义项
|
|
/// <summary>
|
|
/// 主键
|
|
/// </summary>
|
|
public string PersonId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["PersonId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["PersonId"] = value;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 加载页面
|
|
/// <summary>
|
|
/// 加载页面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
this.PersonId = Request.Params["PersonId"];
|
|
this.InitDropDownList();
|
|
if (!string.IsNullOrEmpty(this.PersonId))
|
|
{
|
|
var person = BLL.Person_PersonsService.GetPerson_PersonsById(this.PersonId);
|
|
if (person != null)
|
|
{
|
|
#region 基本信息
|
|
this.txtPersonName.Text = person.PersonName;
|
|
this.txtJobNum.Text = person.JobNum;
|
|
this.drpUnit.SelectedValue = person.UnitId;
|
|
if (!string.IsNullOrEmpty(person.DepartId))
|
|
{
|
|
this.drpDepart.SelectedValue = person.DepartId;
|
|
}
|
|
this.txtAccount.Text = person.Account;
|
|
if (!string.IsNullOrEmpty(person.RoleIds))
|
|
{
|
|
this.drpRole.SelectedValueArray = person.RoleIds.Split(',');
|
|
}
|
|
if (!string.IsNullOrEmpty(person.WorkPostId))
|
|
{
|
|
this.drpWorkPost.SelectedValue = person.WorkPostId;
|
|
}
|
|
if (person.IsForeign.HasValue)
|
|
{
|
|
this.ckIsForeign.Checked = person.IsForeign.Value;
|
|
}
|
|
if (person.IsOffice.HasValue)
|
|
{
|
|
this.ckIsOffice.Checked = person.IsOffice.Value;
|
|
}
|
|
this.txtPersonType.Text = DropListService.getPersonTypeNameByValue(person.PersonType);
|
|
if (!string.IsNullOrEmpty(person.IdcardType))
|
|
{
|
|
this.drpIdcardType.SelectedValue = person.IdcardType;
|
|
}
|
|
this.txtIdentityCard.Text = person.IdentityCard;
|
|
this.txtIdcardAddress.Text = person.IdcardAddress;
|
|
if (!string.IsNullOrEmpty(person.IdcardForever))
|
|
{
|
|
this.rblIdcardForever.SelectedValue = person.IdcardForever;
|
|
if (person.IdcardForever == "Y")
|
|
{
|
|
this.txtIdcardEndDate.ShowRedStar = false;
|
|
this.txtIdcardEndDate.Required = false;
|
|
}
|
|
}
|
|
this.txtIdcardStartDate.Text = string.Format("{0:yyyy-MM-dd}", person.IdcardStartDate);
|
|
this.txtIdcardEndDate.Text = string.Format("{0:yyyy-MM-dd}", person.IdcardEndDate);
|
|
if (!string.IsNullOrEmpty(person.Sex))
|
|
{
|
|
this.rblSex.SelectedValue = person.Sex;
|
|
}
|
|
if (person.Birthday.HasValue)
|
|
{
|
|
this.txtBirthday.Text = string.Format("{0:yyyy-MM-dd}", person.Birthday);
|
|
this.txtAge.Text = IDCardValid.CalculateAgeCorrect(person.Birthday.Value).ToString();
|
|
}
|
|
this.txtTelephone.Text = person.Telephone;
|
|
if (!string.IsNullOrEmpty(person.PhotoUrl))
|
|
{
|
|
imgPhoto.ImageUrl = ("~/" + person.PhotoUrl);
|
|
}
|
|
if (!string.IsNullOrEmpty(person.QRCodeAttachUrl))
|
|
{
|
|
imgQR.ImageUrl = ("~/" + person.QRCodeAttachUrl);
|
|
}
|
|
if (!string.IsNullOrEmpty(person.IDCardUrl))
|
|
{
|
|
imgIDCard.ImageUrl = ("~/" + person.IDCardUrl);
|
|
}
|
|
if (!string.IsNullOrEmpty(person.IDCardBackUrl))
|
|
{
|
|
imgIDCardBack.ImageUrl = ("~/" + person.IDCardBackUrl);
|
|
}
|
|
#endregion
|
|
|
|
#region 详细信息
|
|
this.txtIntoDate.Text = string.Format("{0:yyyy-MM-dd}", person.IntoDate);
|
|
this.txtWorkDate.Text = string.Format("{0:yyyy-MM-dd}", person.WorkDate);
|
|
this.txtRetirementDate.Text = string.Format("{0:yyyy-MM-dd}", person.RetirementDate);
|
|
this.txtValidityDate.Text = string.Format("{0:yyyy-MM-dd}", person.ValidityDate);
|
|
if (!string.IsNullOrEmpty(person.PositionId))
|
|
{
|
|
this.drpPosition.SelectedValue = person.PositionId;
|
|
}
|
|
if (!string.IsNullOrEmpty(person.PostTitleId))
|
|
{
|
|
this.drpPostTitle.SelectedValue = person.PostTitleId;
|
|
}
|
|
this.txtPostTitleDate.Text = string.Format("{0:yyyy-MM-dd}", person.PostTitleDate);
|
|
this.txtGraduate.Text = person.Graduate;
|
|
this.txtMajor.Text = person.Major;
|
|
this.txtForeignLanguage.Text = person.ForeignLanguage;
|
|
if (!string.IsNullOrEmpty(person.CountryCode))
|
|
{
|
|
this.drpCountryCode.SelectedValue = person.CountryCode;
|
|
CityService.InitCityDropDownList(this.drpProvinceCode, person.CountryCode, false);
|
|
}
|
|
if (!string.IsNullOrEmpty(person.ProvinceCode))
|
|
{
|
|
this.drpProvinceCode.SelectedValue = person.ProvinceCode;
|
|
}
|
|
if (!string.IsNullOrEmpty(person.Nation))
|
|
{
|
|
this.drpNation.SelectedValue = person.Nation;
|
|
}
|
|
if (!string.IsNullOrEmpty(person.PoliticsStatus))
|
|
{
|
|
this.drpPoliticsStatus.SelectedValue = person.PoliticsStatus;
|
|
}
|
|
if (!string.IsNullOrEmpty(person.EduLevel))
|
|
{
|
|
this.drpEduLevel.SelectedValue = person.EduLevel;
|
|
}
|
|
if (!string.IsNullOrEmpty(person.MaritalStatus))
|
|
{
|
|
this.drpMaritalStatus.SelectedValue = person.MaritalStatus;
|
|
}
|
|
this.txtRelativeName.Text = person.RelativeName;
|
|
this.txtRelativeTel.Text = person.RelativeTel;
|
|
this.txtAddress.Text = person.Address;
|
|
#endregion
|
|
}
|
|
}
|
|
|
|
getInitGridCertificate();
|
|
getInitGridTrain();
|
|
getInitGridDuty();
|
|
getInitGridInOut();
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 下拉框初始化
|
|
/// <summary>
|
|
/// 初始化下拉框
|
|
/// </summary>
|
|
private void InitDropDownList()
|
|
{
|
|
UnitService.InitUnitDropDownList(this.drpUnit, string.Empty, false);
|
|
this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? Const.UnitId_SEDIN;
|
|
DepartService.InitDepartDropDownList(this.drpDepart, true);
|
|
RoleService.InitRoleDropDownList(this.drpRole, null, null, true);
|
|
WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true);
|
|
PositionService.InitPositionDropDownList(this.drpPosition, true);
|
|
PostTitleService.InitPostTitleDropDownList(this.drpPostTitle, true);
|
|
BasicDataService.InitBasicDataProjectUnitDropDownList(this.drpEduLevel, "EDU_LEVEL", true);
|
|
BasicDataService.InitBasicDataProjectUnitDropDownList(this.drpMaritalStatus, "MARITAL_STATUS", true);
|
|
BasicDataService.InitBasicDataProjectUnitDropDownList(this.drpIdcardType, "ZHENGJIAN_TYPE", false);
|
|
this.drpIdcardType.SelectedValue = "SHENFEN_ZHENGJIAN";
|
|
|
|
BasicDataService.InitBasicDataProjectUnitDropDownList(this.drpPoliticsStatus, "POLITICAL_LANDSCAPE", true);
|
|
BasicDataService.InitBasicDataProjectUnitDropDownList(this.drpNation, "MINZU_TYPE", true);
|
|
SynchroSetService.InitCountryDropDownList(this.drpCountryCode, false);
|
|
this.drpCountryCode.SelectedValue = "101";
|
|
CityService.InitCityDropDownList(this.drpProvinceCode, this.drpCountryCode.SelectedValue, true);
|
|
PositionService.InitPositionDropDownList(this.drpPosition, true);
|
|
;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 证书信息
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
private void getInitGridCertificate()
|
|
{
|
|
Funs.DropDownPageSize(this.ddlPageSizeGridCertificate);
|
|
BindGridCertificate();
|
|
}
|
|
|
|
#region 绑定数据
|
|
/// <summary>
|
|
/// 绑定数据
|
|
/// </summary>
|
|
private void BindGridCertificate()
|
|
{
|
|
var getData = PersonQualityService.getListData(this.PersonId, GridCertificate);
|
|
GridCertificate.RecordCount = PersonQualityService.count;
|
|
GridCertificate.DataSource = getData;
|
|
GridCertificate.DataBind();
|
|
}
|
|
#endregion
|
|
|
|
#region 分页
|
|
/// <summary>
|
|
/// 分页
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void GridCertificate_PageIndexChange(object sender, GridPageEventArgs e)
|
|
{
|
|
BindGridCertificate();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 分页显示条数下拉框
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void ddlPageSizeGridCertificate_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
GridCertificate.PageSize = Convert.ToInt32(ddlPageSizeGridCertificate.SelectedValue);
|
|
BindGridCertificate();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 排序
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void GridCertificate_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
|
{
|
|
BindGridCertificate();
|
|
}
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// 双击事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void GridCertificate_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
|
{
|
|
this.EditDataCertificate();
|
|
}
|
|
protected void btnCertificateEdit_Click(object sender, EventArgs e)
|
|
{
|
|
this.EditDataCertificate();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 编辑数据方法
|
|
/// </summary>
|
|
private void EditDataCertificate()
|
|
{
|
|
if (GridCertificate.SelectedRowIndexArray.Length == 0)
|
|
{
|
|
Alert.ShowInParent("请至少选择一条记录!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../HSSE/QualityAudit/PersonQualityEdit.aspx?PersonQualityId={0}&value=0", GridCertificate.SelectedRowID, "编辑 - ")));
|
|
}
|
|
#endregion
|
|
|
|
#region 培训信息
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
private void getInitGridTrain()
|
|
{
|
|
Funs.DropDownPageSize(this.ddlPageSizeGridTrain);
|
|
BindGridTrain();
|
|
}
|
|
|
|
#region 绑定数据
|
|
/// <summary>
|
|
/// 绑定数据
|
|
/// </summary>
|
|
private void BindGridTrain()
|
|
{
|
|
var getData = Person_PersonTrainService.getListData(this.PersonId, GridTrain);
|
|
GridTrain.RecordCount = Person_PersonTrainService.count;
|
|
GridTrain.DataSource = getData;
|
|
GridTrain.DataBind();
|
|
}
|
|
#endregion
|
|
|
|
#region 分页
|
|
/// <summary>
|
|
/// 分页
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void GridTrain_PageIndexChange(object sender, GridPageEventArgs e)
|
|
{
|
|
BindGridTrain();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 分页显示条数下拉框
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void ddlPageSizeGridTrain_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
GridTrain.PageSize = Convert.ToInt32(ddlPageSizeGridTrain.SelectedValue);
|
|
BindGridTrain();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 排序
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void GridTrain_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
|
{
|
|
BindGridTrain();
|
|
}
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// 双击事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void GridTrain_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
|
{
|
|
this.EditDataTrain();
|
|
}
|
|
protected void btnTrainEdit_Click(object sender, EventArgs e)
|
|
{
|
|
this.EditDataTrain();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 编辑数据方法
|
|
/// </summary>
|
|
private void EditDataTrain()
|
|
{
|
|
if (GridTrain.SelectedRowIndexArray.Length == 0)
|
|
{
|
|
Alert.ShowInParent("请至少选择一条记录!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PersonTrainEdit.aspx?PersonTrainId={0}&value=0", GridTrain.SelectedRowID, "编辑 - ")));
|
|
}
|
|
#endregion
|
|
|
|
#region 员工责任书
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
private void getInitGridDuty()
|
|
{
|
|
Funs.DropDownPageSize(this.ddlPageSizeGridDuty);
|
|
BindGridDuty();
|
|
}
|
|
|
|
#region 绑定数据
|
|
/// <summary>
|
|
/// 绑定数据
|
|
/// </summary>
|
|
private void BindGridDuty()
|
|
{
|
|
var getData = Person_DutyService.getListData(this.PersonId, GridDuty);
|
|
GridDuty.RecordCount = Person_DutyService.count;
|
|
GridDuty.DataSource = getData;
|
|
GridDuty.DataBind();
|
|
}
|
|
#endregion
|
|
|
|
#region 分页
|
|
/// <summary>
|
|
/// 分页
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void GridDuty_PageIndexChange(object sender, GridPageEventArgs e)
|
|
{
|
|
BindGridDuty();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 分页显示条数下拉框
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void ddlPageSizeGridDuty_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
GridDuty.PageSize = Convert.ToInt32(ddlPageSizeGridDuty.SelectedValue);
|
|
BindGridDuty();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 排序
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void GridDuty_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
|
{
|
|
BindGridDuty();
|
|
}
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// 双击事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void GridDuty_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
|
{
|
|
this.EditDataDuty();
|
|
}
|
|
protected void btnDutyEdit_Click(object sender, EventArgs e)
|
|
{
|
|
this.EditDataDuty();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 编辑数据方法
|
|
/// </summary>
|
|
private void EditDataDuty()
|
|
{
|
|
if (GridDuty.SelectedRowIndexArray.Length == 0)
|
|
{
|
|
Alert.ShowInParent("请至少选择一条记录!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DepartPersonDutyView.aspx?DutyId={0}", GridDuty.SelectedRowID, "编辑 - ")));
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 人员工作经历
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
private void getInitGridInOut()
|
|
{
|
|
Funs.DropDownPageSize(this.ddlPageSizeGridInOut);
|
|
BindGridInOut();
|
|
}
|
|
|
|
#region 绑定数据
|
|
/// <summary>
|
|
/// 绑定数据
|
|
/// </summary>
|
|
private void BindGridInOut()
|
|
{
|
|
var getData = SitePerson_PersonItemService.getListData(null, null, this.PersonId, null, null, null, null, GridInOut);
|
|
GridInOut.RecordCount = Person_PersonsService.count;
|
|
GridInOut.DataSource = getData;
|
|
GridInOut.DataBind();
|
|
}
|
|
#endregion
|
|
|
|
#region 分页
|
|
/// <summary>
|
|
/// 分页
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void GridInOut_PageIndexChange(object sender, GridPageEventArgs e)
|
|
{
|
|
BindGridInOut();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 分页显示条数下拉框
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void ddlPageSizeGridInOut_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
GridInOut.PageSize = Convert.ToInt32(ddlPageSizeGridInOut.SelectedValue);
|
|
BindGridInOut();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 排序
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void GridInOut_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
|
{
|
|
BindGridInOut();
|
|
}
|
|
#endregion
|
|
|
|
#region 数据操作事件
|
|
/// <summary>
|
|
/// 双击事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void GridInOut_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
|
{
|
|
this.EditDataInOut();
|
|
}
|
|
protected void btnInOutEdit_Click(object sender, EventArgs e)
|
|
{
|
|
this.EditDataInOut();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 编辑数据方法
|
|
/// </summary>
|
|
private void EditDataInOut()
|
|
{
|
|
if (GridInOut.SelectedRowIndexArray.Length == 0)
|
|
{
|
|
Alert.ShowInParent("请至少选择一条记录!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PersonItemEdit.aspx?PersonItemId={0}&value=0", GridInOut.SelectedRowID, "编辑 - ")));
|
|
}
|
|
#endregion
|
|
#endregion
|
|
}
|
|
} |