检查关联培训

This commit is contained in:
2026-11-19 16:31:11 +08:00
parent 461bca785b
commit 8490311e94
22 changed files with 442 additions and 132 deletions
@@ -70,9 +70,12 @@
<f:RenderField Width="150px" ColumnID="ClassifyItemCode" DataField="ClassifyItemCode" FieldType="String"
HeaderText="编号" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="250px" ColumnID="ClassifyItemName" DataField="ClassifyItemName" FieldType="String"
<f:RenderField Width="220px" ColumnID="ClassifyItemName" DataField="ClassifyItemName" FieldType="String"
HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="380px" ColumnID="CompanyTrainingItemNames" DataField="CompanyTrainingItemNames" FieldType="String"
HeaderText="学习教材" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
@@ -196,7 +196,7 @@ namespace FineUIPro.Web.BaseInfo
if (this.trObj.SelectedNode != null && !string.IsNullOrEmpty(this.trObj.SelectedNode.NodeID))
{
StringBuilder sb = new StringBuilder();
sb.Append("SELECT item.ClassifyItemId,item.ClassifyId,item.ClassifyItemCode,item.ClassifyItemName,item.CompileMan, item.CompileDate ");
sb.Append("SELECT item.ClassifyItemId,item.ClassifyId,item.ClassifyItemCode,item.ClassifyItemName,item.CompanyTrainingItemId,item.CompileMan, item.CompileDate ");
sb.Append("FROM dbo.Base_SafetyProblemClassifyItem AS item ");
sb.Append("WHERE item.ClassifyId=@ClassifyId ");
@@ -217,6 +217,24 @@ namespace FineUIPro.Web.BaseInfo
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(sb.ToString(), parameter);
// 学习教材:把逗号分隔的教材Id转换成教材中文名称
var trainingNames = new Dictionary<string, string>();
foreach (var trainingItem in BLL.CompanyTrainingItemService.GetCompanyTrainingItemList(null))
{
trainingNames[trainingItem.CompanyTrainingItemId] = trainingItem.CompanyTrainingItemName;
}
tb.Columns.Add("CompanyTrainingItemNames", typeof(string));
foreach (DataRow dr in tb.Rows)
{
var ids = Convert.ToString(dr["CompanyTrainingItemId"]).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
var names = new List<string>();
foreach (var id in ids)
{
names.Add(trainingNames.ContainsKey(id.Trim()) ? trainingNames[id.Trim()] : id.Trim());
}
dr["CompanyTrainingItemNames"] = string.Join(",", names);
}
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
@@ -16,7 +16,7 @@
<f:FormRow>
<Items>
<f:TextBox ID="txtClassifyItemCode" runat="server" Label="编号" Required="true"
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px" >
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px">
</f:TextBox>
</Items>
</f:FormRow>
@@ -27,6 +27,13 @@
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="dpCompanyTraining" runat="server" Label="培训教材" EnableSimulateTree="true" AutoSelectFirstItem="false" EnableMultiSelect="true" EnableCheckBoxSelect="true"
EnableEdit="true" LabelWidth="120px">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtCompileMan" runat="server" Label="整理人" Readonly="true" MaxLength="50" LabelWidth="120px">
@@ -1,9 +1,8 @@
using System;
using System.Linq;
using BLL;
using Model;
using BLL;
using System;
using System.Collections.Generic;
using Microsoft.Office.Interop.Excel;
using System.Linq;
namespace FineUIPro.Web.BaseInfo
{
@@ -46,6 +45,7 @@ namespace FineUIPro.Web.BaseInfo
{
if (!IsPostBack)
{
InitDropDownList();
this.GetButtonPower();
btnClose.OnClientClick = ActiveWindow.GetHideReference();
@@ -64,6 +64,10 @@ namespace FineUIPro.Web.BaseInfo
{
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", model.CompileDate);
}
if (!string.IsNullOrWhiteSpace(model.CompanyTrainingItemId))
{
dpCompanyTraining.SelectedValueArray = model.CompanyTrainingItemId.Split(',');
}
}
}
else
@@ -76,6 +80,21 @@ namespace FineUIPro.Web.BaseInfo
}
}
/// <summary>
/// 初始化下拉框
/// </summary>
private void InitDropDownList()
{
List<JQueryFeature> myList = new List<JQueryFeature>();
CompanyTrainingItemService.BoundTree(myList, "0", 0);
dpCompanyTraining.DataTextField = "Name";
dpCompanyTraining.DataValueField = "Id";
dpCompanyTraining.DataSimulateTreeLevelField = "Level";
dpCompanyTraining.DataEnableSelectField = "EnableSelect";
dpCompanyTraining.DataSource = myList;
dpCompanyTraining.DataBind();
}
#endregion
@@ -94,6 +113,10 @@ namespace FineUIPro.Web.BaseInfo
CompileManName = this.CurrUser.UserName,
};
if (dpCompanyTraining.SelectedValueArray != null && dpCompanyTraining.SelectedValueArray.Count() > 0)
{
newModel.CompanyTrainingItemId = string.Join(",", dpCompanyTraining.SelectedValueArray);
}
if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim()))
{
newModel.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim());
@@ -59,6 +59,15 @@ namespace FineUIPro.Web.BaseInfo
/// </remarks>
protected global::FineUIPro.TextBox txtClassifyItemName;
/// <summary>
/// dpCompanyTraining 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList dpCompanyTraining;
/// <summary>
/// txtCompileMan 控件。
/// </summary>