补充公司级别树

This commit is contained in:
2025-04-11 18:02:46 +08:00
parent fc7601612a
commit 96899ce306
28 changed files with 1777 additions and 939 deletions
@@ -1,19 +1,31 @@
using BLL;
using RestSharp.Extensions;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.CQMS.Comprehensive
{
public partial class TrainingRecords : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@@ -24,17 +36,50 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{
if (!IsPostBack)
{
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.ProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
this.GetButtonPower();
}
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true);
BindGrid();
}
}
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
btnNew.Hidden = true;
}
this.GetButtonPower();
this.BindGrid();
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = @"SELECT C.TrainingRecordsId,
C.ProjectId,
C.TrainingContents,
@@ -50,7 +95,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
+ @" LEFT JOIN Base_CNProfessional CN ON C.CNProfessionalId=CN.CNProfessionalId"
+ @" WHERE C.ProjectId = @ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (drpCNProfessionalId.SelectedValue != BLL.Const._Null)
{
strSql += " AND C.CNProfessionalId=@CNProfessionalId";
@@ -213,6 +258,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string rootPath = Server.MapPath("~/");
string initTemplatePath = Const.CQMS_TrainingRecordsTemplateUrl;
string uploadfilepath = string.Empty;
@@ -220,7 +270,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
uploadfilepath = rootPath + initTemplatePath;
var lists = (from x in Funs.DB.Comprehensive_TrainingRecords
where x.ProjectId == this.CurrUser.LoginProjectId
where x.ProjectId == this.ProjectId
select x);
if (drpCNProfessionalId.SelectedValue != BLL.Const._Null)
{
@@ -233,7 +283,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
lists = lists.OrderBy(x => x.RemarkCode);
if (lists != null)
{
string projectName = BLL.ProjectService.GetShortNameByProjectId(this.CurrUser.LoginProjectId);
string projectName = BLL.ProjectService.GetShortNameByProjectId(this.ProjectId);
newUrl = uploadfilepath.Replace("培训记录导入模板", "培训记录(" + projectName + DateTime.Now.ToString("yyyyMMdd") + "");
File.Copy(uploadfilepath, newUrl);
// 第一步:读取文件流
@@ -342,7 +392,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.TrainingRecordsMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.TrainingRecordsMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))