培训
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
@@ -20,6 +22,13 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
var sysTestRule = Funs.DB.Sys_TestRule.FirstOrDefault();
|
||||
var passingScore = "60";
|
||||
if (sysTestRule != null)
|
||||
{
|
||||
passingScore = sysTestRule.PassingScore.ToString();
|
||||
}
|
||||
TestQualifyCount.HeaderText = passingScore + "分以上";
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
}
|
||||
@@ -37,6 +46,12 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
var sysTestRule = Funs.DB.Sys_TestRule.FirstOrDefault();
|
||||
var passingScore = "60";
|
||||
if (sysTestRule != null)
|
||||
{
|
||||
passingScore = sysTestRule.PassingScore.ToString();
|
||||
}
|
||||
string strSql = @"SELECT PersonId,CardNo,PersonName,person.UnitId,Unit.UnitCode,Unit.UnitName,person.DepartId,Depart.DepartCode,Depart.DepartName"
|
||||
+ @",WorkPostName,ISNULL(TestCount,0) AS TestCount,ISNULL(TestQualifyCount,0) AS TestQualifyCount "
|
||||
+ @" FROM SitePerson_Person AS person "
|
||||
@@ -45,7 +60,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
+ @" LEFT JOIN Base_Depart AS Depart ON person.DepartId=Depart.DepartId"
|
||||
+ @" LEFT JOIN (SELECT COUNT(TestRecordId) AS TestCount,TestManId FROM Training_TestRecord GROUP BY TestManId) AS TestCount"
|
||||
+ @" ON person.PersonId=TestCount.TestManId"
|
||||
+ @" LEFT JOIN (SELECT COUNT(TestRecordId) AS TestQualifyCount,TestManId FROM Training_TestRecord WHERE TestScores>= 60 GROUP BY TestManId) AS TestQualifyCount"
|
||||
+ @" LEFT JOIN (SELECT COUNT(TestRecordId) AS TestQualifyCount,TestManId FROM Training_TestRecord WHERE TestScores>= "+ passingScore + " GROUP BY TestManId) AS TestQualifyCount"
|
||||
+ @" ON person.PersonId=TestQualifyCount.TestManId"
|
||||
+ @" WHERE PersonId <> '" + BLL.Const.sysglyId + "' and person.projectid='" + this.CurrUser.LoginProjectId + "'";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
@@ -54,7 +69,11 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
strSql += " AND (PersonName LIKE @name OR CardNo LIKE @name OR Unit.UnitName LIKE @name OR Depart.DepartName LIKE @name OR WorkPostName LIKE @name)";
|
||||
listStr.Add(new SqlParameter("@name", "%" + this.txtName.Text.Trim() + "%"));
|
||||
}
|
||||
if (cbNoPass.Checked)
|
||||
{
|
||||
strSql += " AND TestScores < "+ passingScore;
|
||||
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
|
||||
Reference in New Issue
Block a user