| 
									
										
										
										
											2023-06-07 18:55:33 +08:00
										 |  |  |  | using BLL; | 
					
						
							|  |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace FineUIPro.Web.ZHGL.Person | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class ProjectPerson : PageBase | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 加载页面 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (!IsPostBack) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Funs.DropDownPageSize(this.ddlPageSize); | 
					
						
							|  |  |  |  |                 ProjectService.InitProjectDropDownList(this.drpProject, false); | 
					
						
							|  |  |  |  |                 Funs.FineUIPleaseSelect(drpProject, "按项目查询"); | 
					
						
							|  |  |  |  |                 Funs.FineUIPleaseSelect(drpUnit, "按单位查询"); | 
					
						
							|  |  |  |  |                 WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, false); | 
					
						
							|  |  |  |  |                 Funs.FineUIPleaseSelect(drpWorkPost, "按岗位查询"); | 
					
						
							|  |  |  |  |                 if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     this.drpProject.SelectedValue = this.CurrUser.LoginProjectId; | 
					
						
							|  |  |  |  |                     this.drpProject.Readonly = true; | 
					
						
							|  |  |  |  |                     if (this.CurrUser.UnitId != BLL.Const.UnitId_CWCEC && !string.IsNullOrEmpty(this.CurrUser.UnitId)) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         UnitService.InitUnitDropDownList(this.drpUnit, this.drpProject.SelectedValue, false); | 
					
						
							|  |  |  |  |                         Funs.FineUIPleaseSelect(drpUnit, "按单位查询"); | 
					
						
							|  |  |  |  |                         this.drpUnit.SelectedValue = this.CurrUser.UnitId; | 
					
						
							|  |  |  |  |                         this.drpUnit.Readonly = true; | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 // 绑定表格 | 
					
						
							|  |  |  |  |                 this.BindGrid(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 绑定数据 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         private void BindGrid() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             var getData = PersonService.getListData(this.drpProject.SelectedValue, this.drpUnit.SelectedValue, this.drpWorkPost.SelectedValue, | 
					
						
							|  |  |  |  |               this.txtPersonName.Text.Trim(), this.txtIdCard.Text.Trim(), this.rbIsPostStates.SelectedValue, Grid1); | 
					
						
							| 
									
										
										
										
											2023-06-19 10:20:55 +08:00
										 |  |  |  |             Grid1.RecordCount = PersonService.count2; | 
					
						
							| 
									
										
										
										
											2023-06-07 18:55:33 +08:00
										 |  |  |  |             Grid1.DataSource = getData; | 
					
						
							|  |  |  |  |             Grid1.DataBind(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 查询 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 查询 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btSearch_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion  | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 分页 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 分页 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 分页显示条数下拉框 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 排序 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region Grid编辑事件 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Grid行双击事件 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.EditData(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 右键编辑事件 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnMenuEdit_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.EditData(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 编辑数据方法 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         private void EditData() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (Grid1.SelectedRowIndexArray.Length == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Alert.ShowInParent("请至少选择一条记录!", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             //if (this.btnMenuEdit.Hidden) | 
					
						
							|  |  |  |  |             //{ | 
					
						
							|  |  |  |  |                 SeePersonInfo(Grid1.SelectedRowID); | 
					
						
							|  |  |  |  |             //} | 
					
						
							|  |  |  |  |             //else | 
					
						
							|  |  |  |  |             //{ | 
					
						
							|  |  |  |  |             //    string sitepersonId = Funs.GetStrListByStr(Grid1.SelectedRowID, '#')[0]; | 
					
						
							|  |  |  |  |             //    PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectPersonEdit.aspx?SitePersonId={0}", sitepersonId, "编辑 - "))); | 
					
						
							|  |  |  |  |             //} | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 查看人员详细信息 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 查看人员详细信息 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnSee_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (Grid1.SelectedRowIndexArray.Length == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Alert.ShowInParent("请选择一条记录!", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             SeePersonInfo(Grid1.SelectedRowID); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///  | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="PersonId"></param> | 
					
						
							|  |  |  |  |         private void SeePersonInfo(string PersonId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             //string sitepersonId = Funs.GetStrListByStr(Grid1.SelectedRowID, '#')[0]; | 
					
						
							|  |  |  |  |             PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../HSSE/SitePerson/PersonListEdit.aspx?PersonId={0}&Company=Company", PersonId, "查看 - "))); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///  | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void drpProject_SelectedIndexChanged(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.drpUnit.Items.Clear(); | 
					
						
							|  |  |  |  |             UnitService.InitUnitDropDownList(this.drpUnit, this.drpProject.SelectedValue, false); | 
					
						
							|  |  |  |  |             Funs.FineUIPleaseSelect(drpUnit, "按单位查询"); | 
					
						
							|  |  |  |  |             this.BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |