培训
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Aspose.Words;
|
||||
using BLL;
|
||||
using FineUIPro.Web.DataShow;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -11,6 +12,22 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
public partial class TestRecord : PageBase
|
||||
{
|
||||
#region 项目主键
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
@@ -22,8 +39,21 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
if (!IsPostBack)
|
||||
{
|
||||
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();
|
||||
}
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
GetButtonPower();
|
||||
|
||||
var sysTestRule = Funs.DB.Sys_TestRule.FirstOrDefault();
|
||||
if (sysTestRule != null)
|
||||
@@ -39,9 +69,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
}
|
||||
else
|
||||
{
|
||||
this.lbPassScore.Text = "红色表示分数低于80分。";
|
||||
|
||||
|
||||
this.lbPassScore.Text = "红色表示分数低于80分。";
|
||||
}
|
||||
|
||||
///更新没有结束时间且超时的考试记录
|
||||
@@ -65,6 +93,10 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
string strSql = @"SELECT TestRecord.TestRecordId,TestRecord.TestPlanId, TestRecord.TestManId,TestRecord.TestStartTime,TestRecord.TestEndTime, TestRecord.TestScores,
|
||||
(CASE WHEN TestPlan.PlanName IS NULL THEN Training.TrainingName ELSE TestPlan.PlanName END) AS PlanName,
|
||||
ISNULL(TestPlan.Duration,90) AS Duration,ISNULL(TestPlan.TotalScore,100) AS TotalScore,TestPlan.TestPalce,ISNULL(TestPlan.QuestionCount,95) AS QuestionCount,TestRecord.TemporaryUser,Person.PersonName AS TestManName
|
||||
@@ -74,8 +106,10 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
+ @" LEFT JOIN dbo.Training_TestTraining AS Training ON Training.TrainingId = TestRecord.TestType"
|
||||
+ @" LEFT JOIN dbo.SitePerson_Person AS Person ON Person.PersonId = TestRecord.TestManId "
|
||||
+ @" LEFT JOIN dbo.Base_Unit AS Unit ON Person.UnitId=Unit.UnitId"
|
||||
+ @" WHERE TestRecord.TestStartTime is not null and (isFiled IS NULL OR isFiled = 0) and TestRecord.ProjectId = '" + this.CurrUser.LoginProjectId+"'";
|
||||
+ @" WHERE TestRecord.TestStartTime is not null and (isFiled IS NULL OR isFiled = 0) ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql += " AND TestRecord.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND (Person.PersonName LIKE @name OR TestPlan.PlanName LIKE @name OR Training.TrainingName LIKE @name OR Unit.UnitName like @name)";
|
||||
@@ -337,7 +371,11 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HSSETestRecordMenuId);
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HSSETestRecordMenuId);
|
||||
if (buttonList.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user