培训
This commit is contained in:
@@ -8,6 +8,22 @@ namespace FineUIPro.Web.HSSE.Train
|
||||
{
|
||||
public partial class TestTrainRecord : PageBase
|
||||
{
|
||||
#region 项目主键
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
@@ -18,6 +34,20 @@ namespace FineUIPro.Web.HSSE.Train
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
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.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
this.BindGrid();
|
||||
}
|
||||
@@ -29,6 +59,24 @@ namespace FineUIPro.Web.HSSE.Train
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <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;
|
||||
//}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 绑定数据
|
||||
@@ -37,6 +85,10 @@ namespace FineUIPro.Web.HSSE.Train
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
string strSql = @"SELECT Task.TaskId,Task.TaskDate,person.PersonName,TrainingItem.TrainingId,TrainingItem.TrainingItemId,Training.TrainingCode,Training.TrainingName"
|
||||
+ @",TrainingItem.TrainingItemCode,TrainingItem.TrainingItemName "
|
||||
+ @" FROM Training_Task AS Task"
|
||||
@@ -44,7 +96,8 @@ namespace FineUIPro.Web.HSSE.Train
|
||||
+ @" LEFT JOIN SitePerson_Person AS person ON Task.UserId =person.PersonId "
|
||||
+ @" LEFT JOIN Training_TrainingItem AS TrainingItem ON PlanItem.TrainingEduItemId =TrainingItem.TrainingItemId"
|
||||
+ @" LEFT JOIN Training_Training AS Training ON TrainingItem.TrainingId=Training.TrainingId"
|
||||
+ @" WHERE Task.UserId=@UserId ";
|
||||
+ @" WHERE 1=1 ";
|
||||
strSql += " AND Task.UserId=@UserId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@UserId", this.CurrUser.UserId)
|
||||
|
||||
Reference in New Issue
Block a user