2022-09-05 16:36:31 +08:00
|
|
|
|
using BLL;
|
2023-03-24 18:03:17 +08:00
|
|
|
|
using Microsoft.Office.Core;
|
2022-09-05 16:36:31 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.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);
|
|
|
|
|
|
////权限按钮方法
|
|
|
|
|
|
this.GetButtonPower();
|
|
|
|
|
|
this.btnNew.OnClientClick = Window1.GetShowReference("ProjectPersonEdit.aspx") + "return false;";
|
|
|
|
|
|
ProjectService.InitProjectShortNameDropDownList(this.drpProject, false);
|
2022-11-30 16:25:59 +08:00
|
|
|
|
this.drpProject.SelectedIndex= 0;
|
|
|
|
|
|
|
2022-09-05 16:36:31 +08:00
|
|
|
|
Funs.FineUIPleaseSelect(drpProject, "按项目查询");
|
|
|
|
|
|
Funs.FineUIPleaseSelect(drpUnit, "按单位查询");
|
|
|
|
|
|
WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, false);
|
|
|
|
|
|
Funs.FineUIPleaseSelect(drpWorkPost, "按岗位查询");
|
|
|
|
|
|
DropListService.InitConstDropDownList(this.drpPersonType, DropListService.Group_PersonType, false);
|
|
|
|
|
|
Funs.FineUIPleaseSelect(drpPersonType, "按人员类型查询");
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
|
|
|
|
|
{
|
|
|
|
|
|
this.drpProject.SelectedValue = this.CurrUser.LoginProjectId;
|
|
|
|
|
|
this.drpProject.Readonly = true;
|
|
|
|
|
|
if (this.CurrUser.UnitId != Const.UnitId_SEDIN && !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();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
string arg = GetRequestEventArgument(); // 此函数所在文件:PageBase.cs
|
|
|
|
|
|
string[] args = arg.Split('$');
|
|
|
|
|
|
string rowID = Grid1.SelectedRowID;
|
|
|
|
|
|
if (args.Length > 0 && !string.IsNullOrEmpty(rowID))
|
|
|
|
|
|
{
|
|
|
|
|
|
var commandName = args[0];
|
|
|
|
|
|
string sitepersonId = Funs.GetStrListByStr(rowID, '#')[0];
|
|
|
|
|
|
string personId = Funs.GetStrListByStr(rowID, '#')[1];
|
|
|
|
|
|
if (commandName == "editit")
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!this.btnMenuEdit.Hidden)
|
|
|
|
|
|
{
|
|
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectPersonEdit.aspx?SitePersonId={0}", sitepersonId, "编辑 - ")));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ShowNotify("您没有权限!", MessageBoxIcon.Warning);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (commandName == "details")
|
|
|
|
|
|
{
|
2022-09-06 14:23:32 +08:00
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectPersonView.aspx?SitePersonId={0}", sitepersonId, "查看 - ")));
|
2022-09-05 16:36:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
else if (commandName == "reset")
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!this.btnMenuEdit.Hidden)
|
|
|
|
|
|
{
|
|
|
|
|
|
BLL.Person_PersonsService.UpdatePassword(personId, BLL.Const.Password);
|
|
|
|
|
|
ShowNotify("密码已重置为原始密码!", MessageBoxIcon.Success);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ShowNotify("您没有权限!", MessageBoxIcon.Warning);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (commandName == "salary")
|
|
|
|
|
|
{
|
2022-09-06 14:23:32 +08:00
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectPersonView.aspx?SitePersonId={0}", sitepersonId, "查看 - ")));
|
2022-09-05 16:36:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绑定数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void BindGrid()
|
|
|
|
|
|
{
|
|
|
|
|
|
var getData = SitePerson_PersonService.getListData(this.drpProject.SelectedValue, this.drpUnit.SelectedValue, this.drpWorkPost.SelectedValue,
|
|
|
|
|
|
this.txtPersonName.Text.Trim(), this.txtIdCard.Text.Trim(), this.rbIsPostStates.SelectedValue, this.drpPersonType.SelectedValue, Grid1);
|
|
|
|
|
|
Grid1.RecordCount = SitePerson_PersonService.count;
|
|
|
|
|
|
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="button"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
private void GetButtonPower()
|
|
|
|
|
|
{
|
|
|
|
|
|
string menuId = BLL.Const.ProjectPersonMenuId;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
|
|
|
|
|
{
|
|
|
|
|
|
menuId = BLL.Const.Project_ProjectPersonMenuId;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, menuId);
|
|
|
|
|
|
if (buttonList.Count() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (buttonList.Contains(BLL.Const.BtnAdd))
|
|
|
|
|
|
{
|
|
|
|
|
|
this.btnNew.Hidden = false;
|
|
|
|
|
|
this.btnImport.Hidden = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (buttonList.Contains(BLL.Const.BtnModify))
|
|
|
|
|
|
{
|
|
|
|
|
|
this.btnMenuEdit.Hidden = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (buttonList.Contains(BLL.Const.BtnDelete))
|
|
|
|
|
|
{
|
|
|
|
|
|
this.btnMenuDelete.Hidden = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 删除数据
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 右键删除事件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.DeleteData();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除方法
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void DeleteData()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Grid1.SelectedRowIndexArray.Length > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
string strShowNotify = SitePerson_PersonService.DeleteSitePersons(Grid1.SelectedRowIDArray, this.CurrUser);
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
if (!string.IsNullOrEmpty(strShowNotify))
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInTop(strShowNotify, MessageBoxIcon.Warning);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#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 btnImport_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("UserIn.aspx", "导入 - ")));
|
|
|
|
|
|
}
|
|
|
|
|
|
#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="projectPersonId"></param>
|
|
|
|
|
|
private void SeePersonInfo(string projectPersonId)
|
|
|
|
|
|
{
|
2022-09-06 14:23:32 +08:00
|
|
|
|
string sitepersonId = Funs.GetStrListByStr(Grid1.SelectedRowID, '#')[0];
|
|
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectPersonView.aspx?SitePersonId={0}", sitepersonId, "查看 - ")));
|
2022-09-05 16:36:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
#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();
|
|
|
|
|
|
}
|
2022-10-09 12:09:01 +08:00
|
|
|
|
|
|
|
|
|
|
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
|
}
|
2023-03-24 18:03:17 +08:00
|
|
|
|
|
|
|
|
|
|
protected void btnResetCardNo_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
string projectId = this.drpProject.SelectedValue;
|
|
|
|
|
|
|
|
|
|
|
|
if (projectId != Const._Null)
|
|
|
|
|
|
{
|
2023-06-27 22:30:19 +08:00
|
|
|
|
int count = GetDataService.SendCarNo(projectId);
|
2023-03-24 18:03:17 +08:00
|
|
|
|
Alert.ShowInParent("操作完成!共补卡号" + count.ToString() + "个。", MessageBoxIcon.Information);
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Alert.ShowInParent("请先选择项目!", MessageBoxIcon.Warning);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-09-05 16:36:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|