人员管理补充公司级树

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
@@ -12,7 +12,22 @@ namespace FineUIPro.Web.HSSE.EduTrain
{
public partial class TaskNotice : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
@@ -25,19 +40,47 @@ namespace FineUIPro.Web.HSSE.EduTrain
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
////权限按钮方法
this.GetButtonPower();
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.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!");
this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的&nbsp;<b><script>{0}</script></b>&nbsp;行数据吗?", Grid1.GetSelectedCountReference());
//单位
// BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
// BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
//培训类型
BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true);
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
BindGrid();
}
}
/// <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;
}
}
@@ -46,8 +89,12 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// </summary>
private void BindGrid()
{
string projectId = this.CurrUser.LoginProjectId;
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
//string projectId = this.CurrUser.LoginProjectId;
string strSql = @"SELECT task.TaskNoticeId,
task.TrainTitle,
task.TrainType,
@@ -69,14 +116,14 @@ namespace FineUIPro.Web.HSSE.EduTrain
LEFT JOIN dbo.Sys_User AS users ON users.UserId = task.CreatMan where 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND task.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", projectId));
if (drpTrainType.SelectedValue!=Const._Null)
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (drpTrainType.SelectedValue != Const._Null)
{
strSql += " AND task.TrainType = @TrainType";
listStr.Add(new SqlParameter("@TrainType", drpTrainType.SelectedValue));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
@@ -97,7 +144,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
//};
// Grid1.SummaryData = summary;
}
#endregion
@@ -184,9 +231,9 @@ namespace FineUIPro.Web.HSSE.EduTrain
var model = EduTrain_TaskNoticeService.GetEduTrain_TaskNoticeById(TaskNoticeId);
if (model != null)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TaskNoticeEdit.aspx?TaskNoticeId={0}", TaskNoticeId, "编辑 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TaskNoticeEdit.aspx?TaskNoticeId={0}", TaskNoticeId, "编辑 - ")));
}
}
#endregion
@@ -295,7 +342,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
{
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.Contains(BLL.Const.BtnAdd))
@@ -361,7 +408,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
return "";
}
protected string ConvertUserName(object users)
protected string ConvertUserName(object users)
{
string userName = string.Empty;
if (users != null)
@@ -399,6 +446,6 @@ namespace FineUIPro.Web.HSSE.EduTrain
}
#endregion
}
}