培训
This commit is contained in:
@@ -9,6 +9,22 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
public partial class TestPlan : PageBase
|
||||
{
|
||||
#region 项目主键
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
@@ -20,8 +36,21 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.GetButtonPower();
|
||||
var data = APIBaseInfoService.getWorkPost(CurrUser.ProjectId, null);
|
||||
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();
|
||||
}
|
||||
var data = APIBaseInfoService.getWorkPost(this.ProjectId, null);
|
||||
this.drpWorkPost.DataValueField = "BaseInfoId";
|
||||
this.drpWorkPost.DataTextField = "BaseInfoName";
|
||||
this.drpWorkPost.DataSource = data;
|
||||
@@ -40,17 +69,38 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
}
|
||||
}
|
||||
|
||||
/// <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;
|
||||
//}
|
||||
}
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
string strSql = @"SELECT TestPlan.TestPlanId,TestPlan.PlanName,TestPlan.PlanCode,TestPlan.PlanManId,PlanMan.UserName AS PlanManName,TestPlan.PlanDate,TestPlan.TestStartTime,TestPlan.TestEndTime,TestPlan.Duration,TestPlan.TotalScore,TestPlan.QuestionCount,TestPlan.TestPalce,TestPlan.UnitIds,TestPlan.UnitNames,TestPlan.DepartIds,TestPlan.DepartNames,TestPlan.WorkPostIds,TestPlan.WorkPostNames,TestPlan.QRCodeUrl,TestPlan.States"
|
||||
+ @" ,(CASE WHEN TestPlan.States='1' THEN '已发布未考试' WHEN TestPlan.States='2' THEN '考试中' WHEN TestPlan.States='3' THEN '考试结束' WHEN TestPlan.States='-1' THEN '已作废' ELSE '待提交' END) AS StatesName"
|
||||
+ @" FROM dbo.Training_TestPlan AS TestPlan"
|
||||
+ @" LEFT JOIN Sys_User AS PlanMan ON TestPlan.PlanManId= PlanMan.UserId "
|
||||
+ @" WHERE TestPlan.ProjectId='" + this.CurrUser.LoginProjectId+"'";
|
||||
+ @" WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql += " AND TestPlan.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND (TestPlan.PlanName LIKE @name OR TestPlan.PlanCode LIKE @name OR PlanMan.UserName LIKE @name OR TestPlan.TestPalce LIKE @name OR TestPlan.WorkPostNames LIKE @name)";
|
||||
@@ -226,7 +276,11 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectTestPlanMenuId);
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectTestPlanMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
|
||||
Reference in New Issue
Block a user