人员管理补充公司级树

This commit is contained in:
夏菊 2025-04-08 18:30:09 +08:00
parent 5a6796f656
commit a37909b608
14 changed files with 312 additions and 149 deletions

View File

@ -33,11 +33,11 @@ namespace FineUIPro.Web.Door
{ {
this.ProjectId = Request.Params["projectId"]; this.ProjectId = Request.Params["projectId"];
} }
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId; this.ucTree.ProjectId = this.ProjectId;
Funs.DropDownPageSize(this.ddlPageSize); Funs.DropDownPageSize(this.ddlPageSize);
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true);
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
@ -48,11 +48,15 @@ namespace FineUIPro.Web.Door
} }
} }
} }
private void InitDropDownList()
{
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
}
protected void changeTree(object sender, EventArgs e) protected void changeTree(object sender, EventArgs e)
{ {
this.ProjectId = this.ucTree.ProjectId; this.ProjectId = this.ucTree.ProjectId;
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); this.InitDropDownList();
WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true);
this.GetPersonStatistic(); this.GetPersonStatistic();
} }
/// <summary> /// <summary>

View File

@ -35,11 +35,10 @@ namespace FineUIPro.Web.Door
{ {
this.ProjectId = Request.Params["projectId"]; this.ProjectId = Request.Params["projectId"];
} }
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId; this.ucTree.ProjectId = this.ProjectId;
Funs.DropDownPageSize(this.ddlPageSize); Funs.DropDownPageSize(this.ddlPageSize);
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue) if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
@ -57,9 +56,14 @@ namespace FineUIPro.Web.Door
protected void changeTree(object sender, EventArgs e) protected void changeTree(object sender, EventArgs e)
{ {
this.ProjectId = this.ucTree.ProjectId; this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
this.GetPersonStatistic(); this.GetPersonStatistic();
} }
private void InitDropDownList()
{
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
}
#region #region
/// <summary> /// <summary>
@ -240,7 +244,7 @@ namespace FineUIPro.Web.Door
{ {
if (registrationId != null) if (registrationId != null)
{ {
var registration = (from x in Funs.DB.T_d_facerecord where x.NewID == registrationId select x).FirstOrDefault(); var registration = (from x in Funs.DB.T_d_facerecord where x.NewID == registrationId.ToString() select x).FirstOrDefault();
// registration.Des1 = "FileUpload/Registration/20247/2024-07/638556302997373049_QQ截图20220817171229_-_副本.png"; // registration.Des1 = "FileUpload/Registration/20247/2024-07/638556302997373049_QQ截图20220817171229_-_副本.png";
if (registration != null) if (registration != null)
{ {

View File

@ -33,11 +33,11 @@ namespace FineUIPro.Web.Door
{ {
this.ProjectId = Request.Params["projectId"]; this.ProjectId = Request.Params["projectId"];
} }
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId; this.ucTree.ProjectId = this.ProjectId;
Funs.DropDownPageSize(this.ddlPageSize); Funs.DropDownPageSize(this.ddlPageSize);
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true);
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
@ -49,11 +49,14 @@ namespace FineUIPro.Web.Door
} }
} }
} }
private void InitDropDownList()
{
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
}
protected void changeTree(object sender, EventArgs e) protected void changeTree(object sender, EventArgs e)
{ {
this.ProjectId = this.ucTree.ProjectId; this.ProjectId = this.ucTree.ProjectId;
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); this.InitDropDownList();
WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true);
this.GetPersonStatistic(); this.GetPersonStatistic();
} }
/// <summary> /// <summary>

View File

@ -33,11 +33,10 @@ namespace FineUIPro.Web.Door
{ {
this.ProjectId = Request.Params["projectId"]; this.ProjectId = Request.Params["projectId"];
} }
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId; this.ucTree.ProjectId = this.ProjectId;
Funs.DropDownPageSize(this.ddlPageSize); Funs.DropDownPageSize(this.ddlPageSize);
UnitService.InitUnitDownList(this.drpUnit, this.ProjectId, true);
Funs.FineUIPleaseSelect(this.drpWorkTeam); Funs.FineUIPleaseSelect(this.drpWorkTeam);
WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true);
@ -55,12 +54,14 @@ namespace FineUIPro.Web.Door
} }
} }
} }
private void InitDropDownList()
{
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
}
protected void changeTree(object sender, EventArgs e) protected void changeTree(object sender, EventArgs e)
{ {
this.ProjectId = this.ucTree.ProjectId; this.ProjectId = this.ucTree.ProjectId;
UnitService.InitUnitDownList(this.drpUnit, this.ProjectId, true); this.InitDropDownList();
Funs.FineUIPleaseSelect(this.drpWorkTeam);
WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true);
this.GetPersonStatistic(); this.GetPersonStatistic();
} }
/// <summary> /// <summary>

View File

@ -35,9 +35,10 @@ namespace FineUIPro.Web.Door
{ {
this.ProjectId = Request.Params["projectId"]; this.ProjectId = Request.Params["projectId"];
} }
this.InitDropDownList();
WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, false);
this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId; this.ucTree.ProjectId = this.ProjectId;
UnitService.InitUnitDownList(this.drpUnit, this.ProjectId, true);
this.txtDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); this.txtDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
Search(); Search();
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
@ -47,11 +48,14 @@ namespace FineUIPro.Web.Door
} }
} }
} }
private void InitDropDownList()
{
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
}
protected void changeTree(object sender, EventArgs e) protected void changeTree(object sender, EventArgs e)
{ {
this.ProjectId = this.ucTree.ProjectId; this.ProjectId = this.ucTree.ProjectId;
UnitService.InitUnitDownList(this.drpUnit, this.ProjectId, false); this.InitDropDownList();
WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, false);
} }
#region #region

View File

@ -1,5 +1,7 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TaskNotice.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.TaskNotice" %> <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TaskNotice.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.TaskNotice" %>
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
@ -9,8 +11,23 @@
</head> </head>
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" /> <f:PageManager ID="PageManager1" AutoSizePanelID="Panel2" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false" <f:Panel ID="Panel2" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
EnableCollapse="true" Width="380" Title="公司-项目" TitleToolTip="公司-项目" ShowBorder="true"
ShowHeader="true" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft" Layout="Fit">
<Items>
<f:ContentPanel ID="ContentPanel1" runat="server" ShowHeader="false" EnableCollapse="true" AutoScroll="true"
BodyPadding="0px">
<uc1:UnitProjectTControl ID="ucTree" runat="server" Onchange="changeTree" />
</f:ContentPanel>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" AutoScroll="true">
<Items>
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false" MinHeight="700px"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch"> ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items> <Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="培训记录" EnableCollapse="true" <f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="培训记录" EnableCollapse="true"
@ -100,6 +117,10 @@
</f:Grid> </f:Grid>
</Items> </Items>
</f:Panel> </f:Panel>
</Items>
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="编制培训记录" Hidden="true" EnableIFrame="true" EnableMaximize="true" <f:Window ID="Window1" Title="编制培训记录" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true" Target="Parent" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
Width="1200px" Height="440px"> Width="1200px" Height="440px">

View File

@ -12,7 +12,22 @@ namespace FineUIPro.Web.HSSE.EduTrain
{ {
public partial class TaskNotice : PageBase public partial class TaskNotice : PageBase
{ {
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region #region
/// <summary> /// <summary>
@ -25,8 +40,20 @@ namespace FineUIPro.Web.HSSE.EduTrain
if (!IsPostBack) if (!IsPostBack)
{ {
Funs.DropDownPageSize(this.ddlPageSize); Funs.DropDownPageSize(this.ddlPageSize);
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
this.ProjectId = Request.Params["projectId"];
}
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法 ////权限按钮方法
this.GetButtonPower(); this.GetButtonPower();
}
this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!"); this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!");
this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的&nbsp;<b><script>{0}</script></b>&nbsp;行数据吗?", Grid1.GetSelectedCountReference()); this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的&nbsp;<b><script>{0}</script></b>&nbsp;行数据吗?", Grid1.GetSelectedCountReference());
//单位 //单位
@ -40,13 +67,33 @@ namespace FineUIPro.Web.HSSE.EduTrain
} }
} }
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
this.BindGrid();
this.GetButtonPower();
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
btnNew.Hidden = true;
}
}
/// <summary> /// <summary>
/// 绑定数据 /// 绑定数据
/// </summary> /// </summary>
private void BindGrid() private void BindGrid()
{ {
string projectId = this.CurrUser.LoginProjectId; if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
//string projectId = this.CurrUser.LoginProjectId;
string strSql = @"SELECT task.TaskNoticeId, string strSql = @"SELECT task.TaskNoticeId,
task.TrainTitle, task.TrainTitle,
@ -69,7 +116,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
LEFT JOIN dbo.Sys_User AS users ON users.UserId = task.CreatMan where 1=1 "; LEFT JOIN dbo.Sys_User AS users ON users.UserId = task.CreatMan where 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>(); List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND task.ProjectId = @ProjectId"; strSql += " AND task.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", projectId)); listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (drpTrainType.SelectedValue != Const._Null) if (drpTrainType.SelectedValue != Const._Null)
{ {
strSql += " AND task.TrainType = @TrainType"; strSql += " AND task.TrainType = @TrainType";
@ -295,7 +342,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
{ {
return; return;
} }
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectTrainRecordMenuId); var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectTrainRecordMenuId);
if (buttonList.Count() > 0) if (buttonList.Count() > 0)
{ {
if (buttonList.Contains(BLL.Const.BtnAdd)) if (buttonList.Contains(BLL.Const.BtnAdd))

View File

@ -32,6 +32,51 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// </remarks> /// </remarks>
protected global::FineUIPro.PageManager PageManager1; protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel2;
/// <summary>
/// panelLeftRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// ContentPanel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ContentPanel ContentPanel1;
/// <summary>
/// ucTree 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary> /// <summary>
/// Panel1 控件。 /// Panel1 控件。
/// </summary> /// </summary>

View File

@ -53,6 +53,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
{ {
this.ProjectId = Request.Params["projectId"]; this.ProjectId = Request.Params["projectId"];
} }
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId; this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
@ -63,12 +64,6 @@ namespace FineUIPro.Web.HSSE.EduTrain
Funs.DropDownPageSize(this.ddlPageSize); Funs.DropDownPageSize(this.ddlPageSize);
this.GetButtonPower(); this.GetButtonPower();
var data = APIBaseInfoService.getWorkPost(CurrUser.ProjectId, null);
this.drpWorkPost.DataValueField = "BaseInfoId";
this.drpWorkPost.DataTextField = "BaseInfoName";
this.drpWorkPost.DataSource = data;
this.drpWorkPost.DataBind();
Funs.FineUIPleaseSelect(drpWorkPost);
ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格 // 绑定表格
BindGrid(); BindGrid();
@ -82,9 +77,20 @@ namespace FineUIPro.Web.HSSE.EduTrain
} }
} }
private void InitDropDownList()
{
var data = APIBaseInfoService.getWorkPost(this.ProjectId, null);
this.drpWorkPost.DataValueField = "BaseInfoId";
this.drpWorkPost.DataTextField = "BaseInfoName";
this.drpWorkPost.DataSource = data;
this.drpWorkPost.DataBind();
Funs.FineUIPleaseSelect(drpWorkPost);
}
protected void changeTree(object sender, EventArgs e) protected void changeTree(object sender, EventArgs e)
{ {
this.ProjectId = this.ucTree.ProjectId; this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
//新增UnitId //新增UnitId
this.UnitId = this.ucTree.UnitId; this.UnitId = this.ucTree.UnitId;
//判断 当有projectId的时候单位id为空 //判断 当有projectId的时候单位id为空

View File

@ -59,6 +59,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
{ {
this.ProjectId = Request.Params["projectId"]; this.ProjectId = Request.Params["projectId"];
} }
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId; this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
@ -66,14 +67,10 @@ namespace FineUIPro.Web.HSSE.EduTrain
this.panelLeftRegion.Hidden = true; this.panelLeftRegion.Hidden = true;
// this.Grid1.Columns[0].Hidden = true; // this.Grid1.Columns[0].Hidden = true;
} }
Funs.DropDownPageSize(this.ddlPageSize); Funs.DropDownPageSize(this.ddlPageSize);
ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
GetButtonPower(); GetButtonPower();
//单位
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
///更新没有结束时间且超时的考试记录 ///更新没有结束时间且超时的考试记录
GetDataService.UpdateTestPlanStates(); GetDataService.UpdateTestPlanStates();
@ -89,10 +86,15 @@ namespace FineUIPro.Web.HSSE.EduTrain
} }
} }
#endregion #endregion
private void InitDropDownList()
{
//单位
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
}
protected void changeTree(object sender, EventArgs e) protected void changeTree(object sender, EventArgs e)
{ {
this.ProjectId = this.ucTree.ProjectId; this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
//新增UnitId //新增UnitId
this.UnitId = this.ucTree.UnitId; this.UnitId = this.ucTree.UnitId;
//判断 当有projectId的时候单位id为空 //判断 当有projectId的时候单位id为空

View File

@ -60,12 +60,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
this.ucTree.ProjectId = this.ProjectId; this.ucTree.ProjectId = this.ProjectId;
//单位 //单位
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true); this.InitDropDownList();
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
{
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
this.drpUnitId.Enabled = false;
}
//培训类型 //培训类型
BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true); BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true);
//培训级别; //培训级别;
@ -81,9 +76,21 @@ namespace FineUIPro.Web.HSSE.EduTrain
} }
} }
private void InitDropDownList()
{
//单位
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
{
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
this.drpUnitId.Enabled = false;
}
}
protected void changeTree(object sender, EventArgs e) protected void changeTree(object sender, EventArgs e)
{ {
this.ProjectId = this.ucTree.ProjectId; this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
//新增UnitId //新增UnitId
this.UnitId = this.ucTree.UnitId; this.UnitId = this.ucTree.UnitId;
//判断 当有projectId的时候单位id为空 //判断 当有projectId的时候单位id为空

View File

@ -60,12 +60,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
this.ucTree.ProjectId = this.ProjectId; this.ucTree.ProjectId = this.ProjectId;
//单位 //单位
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true); this.InitDropDownList();
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
{
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
this.drpUnitId.Enabled = false;
}
//培训类型 //培训类型
BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true); BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true);
//培训级别; //培训级别;
@ -82,9 +77,20 @@ namespace FineUIPro.Web.HSSE.EduTrain
} }
} }
private void InitDropDownList()
{
//单位
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
{
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
this.drpUnitId.Enabled = false;
}
}
protected void changeTree(object sender, EventArgs e) protected void changeTree(object sender, EventArgs e)
{ {
this.ProjectId = this.ucTree.ProjectId; this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
//新增UnitId //新增UnitId
this.UnitId = this.ucTree.UnitId; this.UnitId = this.ucTree.UnitId;
//判断 当有projectId的时候单位id为空 //判断 当有projectId的时候单位id为空

View File

@ -74,12 +74,12 @@ namespace FineUIPro.Web.HSSE.EduTrain
this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId; this.ucTree.ProjectId = this.ProjectId;
Funs.DropDownPageSize(this.ddlPageSize); Funs.DropDownPageSize(this.ddlPageSize);
////权限按钮方法 //////权限按钮方法
this.GetButtonPower(); //this.GetButtonPower();
this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!"); this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!");
this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的&nbsp;<b><script>{0}</script></b>&nbsp;行数据吗?", Grid1.GetSelectedCountReference()); this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的&nbsp;<b><script>{0}</script></b>&nbsp;行数据吗?", Grid1.GetSelectedCountReference());
//单位
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true); this.InitDropDownList();
//培训类型 //培训类型
BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true); BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true);
trainType = Request.Params["trainType"]; trainType = Request.Params["trainType"];
@ -109,6 +109,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
protected void changeTree(object sender, EventArgs e) protected void changeTree(object sender, EventArgs e)
{ {
this.ProjectId = this.ucTree.ProjectId; this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
//新增UnitId //新增UnitId
this.UnitId = this.ucTree.UnitId; this.UnitId = this.ucTree.UnitId;
//判断 当有projectId的时候单位id为空 //判断 当有projectId的时候单位id为空
@ -123,6 +124,13 @@ namespace FineUIPro.Web.HSSE.EduTrain
btnNew.Hidden = true; btnNew.Hidden = true;
} }
} }
private void InitDropDownList()
{
//单位
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
}
/// <summary> /// <summary>
/// 绑定数据 /// 绑定数据
/// </summary> /// </summary>

View File

@ -43,7 +43,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
{ {
this.ProjectId = Request.Params["projectId"]; this.ProjectId = Request.Params["projectId"];
} }
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId; this.ucTree.ProjectId = this.ProjectId;
////权限按钮方法 ////权限按钮方法
@ -61,23 +61,28 @@ namespace FineUIPro.Web.HSSE.SitePerson
BindGrid(); BindGrid();
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId) ) if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId) )
{ {
UnitService.InitUnitDropDownList(this.drpUnit, this.CurrUser.LoginProjectId, true);
if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId))
{
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
this.drpUnit.Enabled = false;
}
this.panelLeftRegion.Hidden = true; this.panelLeftRegion.Hidden = true;
////权限按钮方法 ////权限按钮方法
this.GetButtonPower(); this.GetButtonPower();
} }
} }
} }
private void InitDropDownList()
{
//单位
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
{
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
this.drpUnit.Enabled = false;
}
}
protected void changeTree(object sender, EventArgs e) protected void changeTree(object sender, EventArgs e)
{ {
this.ProjectId = this.ucTree.ProjectId; this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
this.BindGrid(); this.BindGrid();
this.GetButtonPower(); this.GetButtonPower();
} }
#endregion #endregion