自动生成培训计划

This commit is contained in:
2025-04-19 16:21:39 +08:00
parent 18819ad259
commit 4746c21508
29 changed files with 1357 additions and 3443 deletions
@@ -70,7 +70,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
{
this.ProjectId = Request.Params["projectId"];
}
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
Funs.DropDownPageSize(this.ddlPageSize);
@@ -78,8 +78,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
this.GetButtonPower();
this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!");
this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的&nbsp;<b><script>{0}</script></b>&nbsp;行数据吗?", Grid1.GetSelectedCountReference());
//单位
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
//培训类型
BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true);
trainType = Request.Params["trainType"];
@@ -97,7 +96,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
{
this.btnRefresh.Hidden = false;
}
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
if (!string.IsNullOrEmpty(this.ProjectId))
{
this.panelLeftRegion.Hidden = true;
// this.Grid1.Columns[0].Hidden = true;
@@ -106,9 +105,23 @@ namespace FineUIPro.Web.HSSE.EduTrain
}
}
}
private void InitDropDownList()
{
//单位
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
{
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
this.drpUnitId.Enabled = false;
}
}
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
//新增UnitId
this.UnitId = this.ucTree.UnitId;
//判断 当有projectId的时候单位id为空
@@ -234,88 +247,6 @@ namespace FineUIPro.Web.HSSE.EduTrain
}
#region 2023-6-27 15:03:28
//else //公司级数据
//{
// string strSql = "select TrainRecord.TrainingId"
// + @",TrainRecord.TrainTitle"
// + @",TrainType.TrainTypeName,TrainLevel.TrainLevelName"
// + @",TrainRecord.TrainStartDate"
// + @",TrainRecord.TrainEndDate"
// + @",TrainRecord.TeachHour"
// + @",TrainRecord.TeachMan"
// + @",TrainRecord.TrainPersonNum"
// + @",TrainingCode"
// // + @",CodeRecords.Code AS TrainingCode"
// + @",(CASE WHEN TrainRecord.States = " + BLL.Const.State_0 + " OR TrainRecord.States IS NULL THEN '待['+OperateUser.UserName+']提交' WHEN TrainRecord.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.UserName+']办理' END) AS FlowOperateName"
// + @",TrainRecord.UnitIds"
// + @" from EduTrain_TrainRecord AS TrainRecord "
// + @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON TrainRecord.TrainingId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1"
// + @" LEFT JOIN Sys_User AS OperateUser ON FlowOperate.OperaterId=OperateUser.UserId "
// + @" LEFT JOIN Base_TrainType AS TrainType ON TrainRecord.TrainTypeId=TrainType.TrainTypeId "
// + @" LEFT JOIN Base_TrainLevel AS TrainLevel ON TrainRecord.TrainLevelId=TrainLevel.TrainLevelId "
// + @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON TrainRecord.TrainingId=CodeRecords.DataId WHERE 1=1 ";
// List<SqlParameter> listStr = new List<SqlParameter>();
// if (!string.IsNullOrEmpty(ProjectId))
// {
// strSql += " AND (TrainRecord.ProjectId = '' or TrainRecord.ProjectId is null) ";
// //listStr.Add(new SqlParameter("@ProjectId", ProjectId));
// }
// if (this.drpTrainType.SelectedValue != BLL.Const._Null)
// {
// strSql += " AND TrainRecord.TrainTypeId = @TrainType";
// listStr.Add(new SqlParameter("@TrainType", this.drpTrainType.SelectedValue));
// }
// if (this.drpTrainLevel.SelectedValue != BLL.Const._Null)
// {
// strSql += " AND TrainRecord.TrainLevelId = @TrainLevel";
// listStr.Add(new SqlParameter("@TrainLevel", this.drpTrainLevel.SelectedValue));
// }
// if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim()))
// {
// strSql += " AND TrainRecord.TrainStartDate >= @StartDate ";
// listStr.Add(new SqlParameter("@StartDate", this.txtStartDate.Text.Trim()));
// }
// if (!string.IsNullOrEmpty(this.txtEndDate.Text.Trim()))
// {
// strSql += " AND TrainRecord.TrainStartDate <= @EndDate ";
// listStr.Add(new SqlParameter("@EndDate", this.txtEndDate.Text.Trim()));
// }
// if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId))
// {
// strSql += " AND TrainRecord.UnitIds LIKE @UnitId1";
// listStr.Add(new SqlParameter("@UnitId1", "%" + this.CurrUser.UnitId + "%"));
// }
// strSql += " AND TrainRecord.UnitIds LIKE @UnitId";
// listStr.Add(new SqlParameter("@UnitId", "%" + this.ucTree.UnitId.Trim() + "%"));
// SqlParameter[] parameter = listStr.ToArray();
// DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
// Grid1.RecordCount = tb.Rows.Count;
// //tb = GetFilteredTable(Grid1.FilteredData, tb);
// var table = this.GetPagedDataTable(Grid1, tb);
// Grid1.DataSource = table;
// Grid1.DataBind();
// int totalPersonNum = 0;
// for (int i = 0; i < tb.Rows.Count; i++)
// {
// totalPersonNum += Funs.GetNewIntOrZero(tb.Rows[i][8].ToString());
// }
// JObject summary = new JObject
// {
// { "TeachMan", "合计:" },
// { "TrainPersonNum", totalPersonNum }
// };
// Grid1.SummaryData = summary;
//}
#endregion
string projectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值
{