This commit is contained in:
2026-04-07 19:44:10 +08:00
parent 53eeca8eb3
commit 7ecbc2ebc0
46 changed files with 2694 additions and 992 deletions
+53 -3
View File
@@ -9,6 +9,22 @@ namespace FineUIPro.Web.HSSE.EduTrain
{
public partial class Task : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@@ -20,7 +36,20 @@ 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();
}
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
BindGrid();
@@ -34,17 +63,34 @@ namespace FineUIPro.Web.HSSE.EduTrain
}
}
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>
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = @"SELECT Task.TaskId,Task.PlanId,Task.UserId,Task.TaskDate,(CASE Task.States WHEN '0' THEN '未响应' WHEN '1' THEN '已响应' WHEN '2' THEN '已完成' ELSE '' END) AS States,Plans.PlanName,Person.PersonName
FROM dbo.Training_Task AS Task
LEFT JOIN dbo.Training_Plan AS Plans ON Plans.PlanId=Task.PlanId
LEFT JOIN dbo.SitePerson_Person AS Person ON Person.PersonId = Task.UserId
WHERE Task.ProjectId='" + this.CurrUser.LoginProjectId + "'";
WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND Task.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
{
strSql += " AND (Plans.PlanName LIKE @name OR Person.PersonName LIKE @name)";
@@ -195,7 +241,11 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectTrainingTaskMenuId);
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectTrainingTaskMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnDelete))