自动生成培训计划
This commit is contained in:
parent
18819ad259
commit
4746c21508
|
@ -34,6 +34,8 @@ BEGIN
|
|||
ALTER TABLE Training_Plan ADD CheckType nvarchar(50) ;
|
||||
--¼ì²é¼Ç¼Id
|
||||
ALTER TABLE Training_Plan ADD CheckId nvarchar(50) ;
|
||||
--培训教材Id
|
||||
ALTER TABLE Training_Plan ADD CompanyTrainingItemId nvarchar(50) ;
|
||||
END
|
||||
GO
|
||||
|
||||
|
|
|
@ -117,6 +117,7 @@ namespace BLL
|
|||
{
|
||||
return (from x in Funs.DB.Training_CompanyTraining
|
||||
where x.IsEndLever == true
|
||||
orderby x.CompanyTrainingCode
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
using Microsoft.Office.Interop.Excel;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
using Model;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Numerics;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
@ -35,6 +33,18 @@ namespace BLL
|
|||
return db.Training_Plan.FirstOrDefault(e => e.CheckId == checkId && e.IsRetakeCourse == 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据培训教材Id获取今年培训计划
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="itemId"></param>
|
||||
/// <param name="year"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Training_Plan> GetThisYearPlanByCompanyTrainingItemId(string projectId, string itemId, int year)
|
||||
{
|
||||
return db.Training_Plan.Where(e => e.ProjectId == projectId && e.CompanyTrainingItemId == itemId && e.IsRetakeCourse != 1 && ((DateTime)e.DesignerDate).Year == year).ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
@ -52,6 +62,7 @@ namespace BLL
|
|||
PlanName = model.PlanName,
|
||||
TrainContent = model.TrainContent,
|
||||
TrainStartDate = model.TrainStartDate,
|
||||
TrainEndDate = model.TrainEndDate,
|
||||
TeachHour = model.TeachHour,
|
||||
TeachMan = model.TeachMan,
|
||||
TeachAddress = model.TeachAddress,
|
||||
|
@ -64,7 +75,8 @@ namespace BLL
|
|||
Cycle = model.Cycle,
|
||||
IsRetakeCourse = model.IsRetakeCourse,
|
||||
CheckType = model.CheckType,
|
||||
CheckId = model.CheckId
|
||||
CheckId = model.CheckId,
|
||||
CompanyTrainingItemId = model.CompanyTrainingItemId
|
||||
};
|
||||
db.Training_Plan.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
|
@ -82,8 +94,8 @@ namespace BLL
|
|||
isUpdate.PlanName = model.PlanName;
|
||||
isUpdate.TrainContent = model.TrainContent;
|
||||
isUpdate.TrainStartDate = model.TrainStartDate;
|
||||
isUpdate.TeachHour = model.TeachHour;
|
||||
isUpdate.TrainEndDate = model.TrainEndDate;
|
||||
isUpdate.TeachHour = model.TeachHour;
|
||||
isUpdate.TeachMan = model.TeachMan;
|
||||
isUpdate.TeachAddress = model.TeachAddress;
|
||||
isUpdate.TrainTypeId = model.TrainTypeId;
|
||||
|
@ -96,6 +108,7 @@ namespace BLL
|
|||
isUpdate.IsRetakeCourse = model.IsRetakeCourse;
|
||||
isUpdate.CheckType = model.CheckType;
|
||||
isUpdate.CheckId = model.CheckId;
|
||||
isUpdate.CompanyTrainingItemId = model.CompanyTrainingItemId;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
@ -123,12 +136,25 @@ namespace BLL
|
|||
return (from x in db.Training_Plan orderby x.PlanCode select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取某一岗位今年入场培训计划
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="workPostId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Training_Plan> GetPlanListByWorkPostId(string projectId, string workPostId)
|
||||
{
|
||||
var list = (from x in db.Training_Plan
|
||||
where x.ProjectId == projectId && (x.WorkPostId == null || x.WorkPostId.Contains(workPostId)) && x.CompanyTrainingItemId != null && x.IsRetakeCourse == null && Convert.ToDateTime(x.DesignerDate).Year == DateTime.Now.Year
|
||||
select x).ToList();
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查重修,并生成培训计划、任务
|
||||
/// </summary>
|
||||
/// <param name="info"></param>
|
||||
public static void RetakeCourseProducePlan(RetakeCourseProducePlanInfo info)
|
||||
public static void RetakeCourseProducePlan(ProducePlanInfo info)
|
||||
{
|
||||
var plan = GetPlanByCheckId(info.CheckId);
|
||||
var person = PersonService.GetPersonById(info.PersonId);
|
||||
|
@ -157,7 +183,8 @@ namespace BLL
|
|||
Cycle = "",
|
||||
IsRetakeCourse = 1,
|
||||
CheckType = plan.CheckType,
|
||||
CheckId = plan.CheckId
|
||||
CheckId = plan.CheckId,
|
||||
CompanyTrainingItemId = info.CompanyTrainingItemId
|
||||
};
|
||||
UpdatePlan(planModel);
|
||||
}
|
||||
|
@ -189,7 +216,8 @@ namespace BLL
|
|||
Cycle = "",
|
||||
IsRetakeCourse = 1,
|
||||
CheckType = info.CheckType.ToString(),
|
||||
CheckId = info.CheckId
|
||||
CheckId = info.CheckId,
|
||||
CompanyTrainingItemId = info.CompanyTrainingItemId
|
||||
};
|
||||
AddPlan(planModel);
|
||||
}
|
||||
|
@ -239,5 +267,176 @@ namespace BLL
|
|||
};
|
||||
TrainingPlanItemService.AddPlanItem(newPlanItem);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选择教材生成培训计划
|
||||
/// </summary>
|
||||
/// <param name="info"></param>
|
||||
public static void SelectCompanyTrainingItemProducePlan(ProducePlanInfo info)
|
||||
{
|
||||
var companyTrainingItem = CompanyTrainingItemService.GetCompanyTrainingItemById(info.CompanyTrainingItemId);
|
||||
var teachHour = companyTrainingItem.LearningTime / 3600;
|
||||
|
||||
//1、根据教材id查询适用岗位下相关人员;
|
||||
var workPostIds = !string.IsNullOrWhiteSpace(companyTrainingItem.WorkPostIds) ? companyTrainingItem.WorkPostIds.Split(',').ToList() : new List<string>();
|
||||
|
||||
var workPostPersons = PersonService.GetPersonListByWorkPostIds(info.CurrProjectId, workPostIds);
|
||||
//人员单位
|
||||
var unitIds = workPostPersons.Any() ? String.Join(", ", workPostPersons.Select(x => x.UnitId).Distinct()) : string.Empty;
|
||||
//2、根据教材id查询今年是否有相关培训计划(排除重修培训计划),如果有先删除;
|
||||
var plans = GetThisYearPlanByCompanyTrainingItemId(info.CurrProjectId, info.CompanyTrainingItemId, DateTime.Now.Year);
|
||||
if (plans.Any())
|
||||
{//删除今年的培训计划
|
||||
foreach (var plan in plans)
|
||||
{
|
||||
//删除培训明细
|
||||
TrainingPlanItemService.DeletePlanItemByPlanId(plan.PlanId);
|
||||
//删除任务
|
||||
TrainingTaskService.DeleteTaskByPlanId(plan.PlanId);
|
||||
DeletePlanById(plan.PlanId);
|
||||
}
|
||||
}
|
||||
|
||||
//生成培训计划
|
||||
string planId = SQLHelper.GetNewID();
|
||||
string code = ProjectService.GetProjectByProjectId(info.CurrProjectId).ProjectCode + "-";
|
||||
string planCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", info.CurrProjectId, code);
|
||||
|
||||
Model.Training_Plan planModel = new Model.Training_Plan
|
||||
{
|
||||
PlanId = planId,
|
||||
PlanCode = planCode,
|
||||
ProjectId = info.CurrProjectId,
|
||||
DesignerId = info.CurrUserId,
|
||||
DesignerDate = DateTime.Now,
|
||||
PlanName = companyTrainingItem.CompanyTrainingItemName,
|
||||
TrainContent = companyTrainingItem.CompanyTrainingItemName,
|
||||
TrainStartDate = DateTime.Now,
|
||||
TrainEndDate = info.TrainEndDate,
|
||||
TeachHour = teachHour,
|
||||
//TeachMan = companyTrainingItem.,
|
||||
//TeachAddress = model.TeachAddress,
|
||||
TrainTypeId = Const.EntryTrainTypeId,
|
||||
TrainLevelId = Const.OtherTrainLevelId,
|
||||
UnitIds = unitIds,
|
||||
WorkPostId = companyTrainingItem.WorkPostIds,
|
||||
States = "1",
|
||||
Cycle = "",
|
||||
//IsRetakeCourse = 0,
|
||||
//CheckType = info.CheckType.ToString(),
|
||||
//CheckId = info.CheckId,
|
||||
CompanyTrainingItemId = info.CompanyTrainingItemId
|
||||
};
|
||||
AddPlan(planModel);
|
||||
|
||||
//新增培训明细
|
||||
Model.Training_PlanItem newPlanItem = new Model.Training_PlanItem
|
||||
{
|
||||
PlanItemId = SQLHelper.GetNewID(),
|
||||
PlanId = planId,
|
||||
CompanyTrainingItemId = info.CompanyTrainingItemId,
|
||||
CompanyTrainingId = companyTrainingItem.CompanyTrainingId
|
||||
};
|
||||
TrainingPlanItemService.AddPlanItem(newPlanItem);
|
||||
|
||||
List<Training_Task> newTasks = new List<Training_Task>();
|
||||
List<Training_TaskItem> newTaskItems = new List<Training_TaskItem>();
|
||||
//循环给人员添加任务
|
||||
foreach (var person in workPostPersons)
|
||||
{
|
||||
string taskId = SQLHelper.GetNewID();
|
||||
//新增培训任务
|
||||
Model.Training_Task newTask = new Model.Training_Task
|
||||
{
|
||||
TaskId = taskId,
|
||||
ProjectId = info.CurrProjectId,
|
||||
PlanId = planId,
|
||||
UserId = person.PersonId,
|
||||
TaskDate = DateTime.Now,
|
||||
States = Const.State_1,
|
||||
};
|
||||
newTasks.Add(newTask);
|
||||
|
||||
//新增培训任务明细
|
||||
Model.Training_TaskItem newTaskItem = new Model.Training_TaskItem
|
||||
{
|
||||
TaskItemId = SQLHelper.GetNewID(),
|
||||
TaskId = taskId,
|
||||
PlanId = planId,
|
||||
PersonId = person.PersonId,
|
||||
TrainingItemCode = companyTrainingItem.CompanyTrainingItemCode,
|
||||
TrainingItemName = companyTrainingItem.CompanyTrainingItemName,
|
||||
AttachUrl = companyTrainingItem.AttachUrl,
|
||||
CompanyTrainingItemId = info.CompanyTrainingItemId,
|
||||
//LearnTime = trainingItem.LearningTime,
|
||||
//VideoProgress = 0,
|
||||
};
|
||||
newTaskItems.Add(newTaskItem);
|
||||
}
|
||||
|
||||
db.Training_Task.InsertAllOnSubmit(newTasks);
|
||||
db.Training_TaskItem.InsertAllOnSubmit(newTaskItems);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选择人员生成培训计划
|
||||
/// </summary>
|
||||
/// <param name="info"></param>
|
||||
public static bool SelectPersonProducePlan(ProducePlanInfo info)
|
||||
{
|
||||
bool result = false;
|
||||
//1、根据人员获取人员基本信息
|
||||
var person = PersonService.GetPersonById(info.PersonId);
|
||||
if (string.IsNullOrWhiteSpace(person.WorkPostId))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
//2、根据人员岗位Id查询今年入场培训计划
|
||||
var lstPlan = GetPlanListByWorkPostId(info.CurrProjectId, person.WorkPostId);
|
||||
foreach (var plan in lstPlan)
|
||||
{
|
||||
var task = (from x in db.Training_Task
|
||||
where x.ProjectId == info.CurrProjectId && x.PlanId == plan.PlanId && x.UserId == person.PersonId
|
||||
select x).ToList();
|
||||
if (task.Any())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var companyTrainingItem = CompanyTrainingItemService.GetCompanyTrainingItemById(plan.CompanyTrainingItemId);
|
||||
string taskId = SQLHelper.GetNewID();
|
||||
//新增培训任务
|
||||
Model.Training_Task newTask = new Model.Training_Task
|
||||
{
|
||||
TaskId = taskId,
|
||||
ProjectId = info.CurrProjectId,
|
||||
PlanId = plan.PlanId,
|
||||
UserId = person.PersonId,
|
||||
TaskDate = DateTime.Now,
|
||||
States = Const.State_1,
|
||||
};
|
||||
|
||||
//新增培训任务明细
|
||||
Model.Training_TaskItem newTaskItem = new Model.Training_TaskItem
|
||||
{
|
||||
TaskItemId = SQLHelper.GetNewID(),
|
||||
TaskId = taskId,
|
||||
PlanId = plan.PlanId,
|
||||
PersonId = person.PersonId,
|
||||
TrainingItemCode = companyTrainingItem.CompanyTrainingItemCode,
|
||||
TrainingItemName = companyTrainingItem.CompanyTrainingItemName,
|
||||
AttachUrl = companyTrainingItem.AttachUrl,
|
||||
CompanyTrainingItemId = info.CompanyTrainingItemId,
|
||||
//LearnTime = trainingItem.LearningTime,
|
||||
//VideoProgress = 0,
|
||||
};
|
||||
|
||||
db.Training_Task.InsertOnSubmit(newTask);
|
||||
db.Training_TaskItem.InsertOnSubmit(newTaskItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -323,6 +323,33 @@ namespace BLL
|
|||
return (from x in Funs.DB.SitePerson_Person where x.ProjectId == projectId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据岗位id获取在岗人员信息列表
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="workPostIds"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.SitePerson_Person> GetPersonListByWorkPostIds(string projectId, List<string> workPostIds)
|
||||
{
|
||||
var list = new List<Model.SitePerson_Person>();
|
||||
if (workPostIds.Any())
|
||||
{
|
||||
foreach (var work in workPostIds)
|
||||
{
|
||||
var plist = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && x.ProjectId == projectId && x.WorkPostId == work select x).ToList();
|
||||
if (plist.Any())
|
||||
{
|
||||
list.AddRange(plist);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && x.ProjectId == projectId select x).ToList();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加人员信息
|
||||
/// </summary>
|
||||
|
|
|
@ -1850,6 +1850,7 @@
|
|||
<Content Include="HSSE\EduTrain\AccidentCaseItemSelectCloumn.aspx" />
|
||||
<Content Include="HSSE\EduTrain\AccidentCaseSave.aspx" />
|
||||
<Content Include="HSSE\EduTrain\PlanEdit.aspx" />
|
||||
<Content Include="HSSE\EduTrain\SelectCompanyTrainingItemProducePlan.aspx" />
|
||||
<Content Include="HSSE\EduTrain\TaskNotice.aspx" />
|
||||
<Content Include="HSSE\EduTrain\TaskNoticeEdit.aspx" />
|
||||
<Content Include="HSSE\EduTrain\TrainFindWorkPost.aspx" />
|
||||
|
@ -3675,7 +3676,6 @@
|
|||
<Content Include="Controls\My97DatePicker\开发包\skin\whyGreen\datepicker.css" />
|
||||
<Content Include="Controls\My97DatePicker\开发包\skin\whyGreen\img.gif" />
|
||||
<Content Include="Downloads\chinaexcelweb.cab" />
|
||||
<Content Include="ErrLog.txt" />
|
||||
<Content Include="favicon.ico" />
|
||||
<Content Include="App_Themes\Default\Default.css" />
|
||||
<Content Include="aspnet_client\FreeTextBox\FTB-FreeTextBox.js" />
|
||||
|
@ -12680,6 +12680,13 @@
|
|||
<Compile Include="HSSE\EduTrain\PlanEdit.aspx.designer.cs">
|
||||
<DependentUpon>PlanEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\EduTrain\SelectCompanyTrainingItemProducePlan.aspx.cs">
|
||||
<DependentUpon>SelectCompanyTrainingItemProducePlan.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\EduTrain\SelectCompanyTrainingItemProducePlan.aspx.designer.cs">
|
||||
<DependentUpon>SelectCompanyTrainingItemProducePlan.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\EduTrain\TaskNotice.aspx.cs">
|
||||
<DependentUpon>TaskNotice.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
|
|
@ -232,7 +232,7 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
if (!string.IsNullOrWhiteSpace(model.ResponsibleMan) && !string.IsNullOrWhiteSpace(model.CompanyTrainingItemId))
|
||||
{//责任人和重修教材非空,生成培训计划
|
||||
var CheckTypeName = Enums.RetakeCourseType.领导带班检查.ToString();
|
||||
Model.RetakeCourseProducePlanInfo info = new Model.RetakeCourseProducePlanInfo
|
||||
Model.ProducePlanInfo info = new Model.ProducePlanInfo
|
||||
{
|
||||
CurrProjectId = this.CurrUser.LoginProjectId,
|
||||
CurrUserId = this.CurrUser.UserId,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Plan.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.Plan" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
|
@ -9,14 +10,26 @@
|
|||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel2" runat="server" />
|
||||
<f:Panel ID="Panel2" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
|
||||
EnableCollapse="true" Width="380" Title="公司-项目" TitleToolTip="公司-项目" ShowBorder="true"
|
||||
ShowHeader="true" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft" Layout="Fit">
|
||||
<Items>
|
||||
<f:ContentPanel ID="ContentPanel1" runat="server" ShowHeader="false" EnableCollapse="true" AutoScroll="true"
|
||||
BodyPadding="0px">
|
||||
<uc1:UnitProjectTControl ID="ucTree" runat="server" Onchange="changeTree" />
|
||||
</f:ContentPanel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
|
||||
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="培训计划" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="PlanId" EnableColumnLines="true" DataIDField="PlanId"
|
||||
AllowSorting="true" SortField="PlanCode" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
|
||||
IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true"
|
||||
IsDatabasePaging="true" PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
|
||||
|
@ -36,7 +49,8 @@
|
|||
</f:DropDownList>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
|
||||
<f:Button ID="btnSelectTextbookProducePlan" ToolTip="选择教材生成培训计划" Icon="ShapesManySelect" runat="server" OnClick="btnSelectTextbookProducePlan_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" runat="server" OnClick="btnNew_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
|
@ -45,7 +59,7 @@
|
|||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
|
||||
TextAlign="Center" />
|
||||
<f:RenderField Width="80px" ColumnID="PlanCode" DataField="PlanCode" SortField="PlanCode"
|
||||
<f:RenderField Width="90px" ColumnID="PlanCode" DataField="PlanCode" SortField="PlanCode"
|
||||
HeaderText="编号" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="PlanName" DataField="PlanName" FieldType="String"
|
||||
|
@ -95,10 +109,16 @@
|
|||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
|
||||
<f:Window ID="Window1" Title="编辑培训计划" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window_Close"
|
||||
Width="1000px" Height="450px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="选择教材生成培训计划" Hidden="true" EnableIFrame="true" EnableMaximize="true" Width="1000px" Height="720px"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window_Close" IsModal="true">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuView" OnClick="btnMenuView_Click" EnablePostBack="true"
|
||||
runat="server" Text="查看" Icon="Find">
|
||||
|
|
|
@ -10,6 +10,23 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
{
|
||||
public partial class Plan : PageBase
|
||||
{
|
||||
#region 项目主键
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
|
@ -21,8 +38,21 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.GetButtonPower();
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
this.InitDropDownList();
|
||||
TrainTypeService.InitTrainTypeDropDownList(drpTrainType, true);
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
}
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
|
||||
// 绑定表格
|
||||
|
@ -42,9 +72,8 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
/// </summary>
|
||||
private void InitDropDownList()
|
||||
{
|
||||
UnitService.InitUnitByProjectIdUnitTypeDropDownList1(drpUnit, this.CurrUser.LoginProjectId, false);
|
||||
TrainTypeService.InitTrainTypeDropDownList(drpTrainType, true);
|
||||
WorkPostService.InitWorkPostByProjectIdDropDownList(drpWorkPost, this.CurrUser.LoginProjectId, false);
|
||||
UnitService.InitUnitByProjectIdUnitTypeDropDownList1(drpUnit, this.ProjectId, false);
|
||||
WorkPostService.InitWorkPostByProjectIdDropDownList(drpWorkPost, this.ProjectId, false);
|
||||
//var data = APIBaseInfoService.getWorkPost(CurrUser.ProjectId, null);
|
||||
//this.drpWorkPost.DataValueField = "BaseInfoId";
|
||||
//this.drpWorkPost.DataTextField = "BaseInfoName";
|
||||
|
@ -53,6 +82,23 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
//Funs.FineUIPleaseSelect(drpWorkPost);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
this.InitDropDownList();
|
||||
this.BindGrid();
|
||||
|
||||
this.GetButtonPower();
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
btnNew.Hidden = true;
|
||||
}
|
||||
}
|
||||
#region 编制
|
||||
/// <summary>
|
||||
/// 编制
|
||||
|
@ -61,10 +107,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PlanEdit.aspx", "编辑 - ")));
|
||||
|
||||
}
|
||||
#endregion
|
||||
/// <summary>
|
||||
|
@ -72,6 +115,11 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string strSql = @"SELECT Plans.PlanId,Plans.PlanCode, Plans.PlanName, Plans.DesignerId, Plans.DesignerDate, Plans.WorkPostId,UnitIds,TrainStartDate,TeachHour,TeachAddress,
|
||||
(CASE Plans.States WHEN '0' THEN '计划中' WHEN '1' THEN '待考试' WHEN '2' THEN '考试中' WHEN '3' THEN '已结束' WHEN '-1' THEN '已作废' END ) AS States,
|
||||
(CASE Plans.IsRetakeCourse WHEN '1' THEN '重修培训' ELSE '日常培训' END ) AS IsRetakeCourseStr,
|
||||
|
@ -79,9 +127,11 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
+ @" FROM dbo.Training_Plan AS Plans "
|
||||
+ @" LEFT JOIN Sys_User AS Users ON Users.UserId = Plans.DesignerId "
|
||||
+ @" LEFT JOIN Base_TrainType AS TrainType ON TrainType.TrainTypeId = Plans.TrainTypeId "
|
||||
+ @" WHERE Plans.ProjectId='" + this.CurrUser.LoginProjectId + "'";
|
||||
+ @" WHERE 1=1";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
strSql += " AND Plans.ProjectId = @ProjectId ";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND (PlanCode LIKE @name OR PlanName LIKE @name)";
|
||||
|
@ -211,6 +261,27 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 选择教材生成培训计划
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSelectTextbookProducePlan_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("SelectCompanyTrainingItemProducePlan.aspx?ProjectId={0}", this.ProjectId), "选择教材生成培训计划"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 窗口关闭事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window_Close(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#region 删除
|
||||
/// <summary>
|
||||
/// 批量删除数据
|
||||
|
@ -275,7 +346,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
|
||||
#region 格式化字符串
|
||||
/// <summary>
|
||||
/// 格式化受伤情况
|
||||
/// 格式化接受培训岗位
|
||||
/// </summary>
|
||||
/// <param name="injury"></param>
|
||||
/// <returns></returns>
|
||||
|
@ -326,7 +397,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectTrainingPlanMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectTrainingPlanMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
|
|
|
@ -33,13 +33,49 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
protected global::FineUIPro.Panel Panel2;
|
||||
|
||||
/// <summary>
|
||||
/// panelLeftRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
/// <summary>
|
||||
/// ContentPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ContentPanel ContentPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// ucTree 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
|
@ -104,6 +140,15 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSelectTextbookProducePlan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSelectTextbookProducePlan;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
|
@ -167,6 +212,15 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="PlanEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.PlanEdit" %>
|
||||
|
||||
<%@ Register Src="~/Controls/FlowOperateControl.ascx" TagName="FlowOperateControl" TagPrefix="uc1" %>
|
||||
<!DOCTYPE html>
|
||||
|
||||
|
@ -8,18 +9,16 @@
|
|||
<link href="~/res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<style type="text/css">
|
||||
.labcenter
|
||||
{
|
||||
.labcenter {
|
||||
text-align: center;
|
||||
}
|
||||
.f-grid-row.burlywood
|
||||
{
|
||||
|
||||
.f-grid-row.burlywood {
|
||||
background-color: burlywood;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.fontred
|
||||
{
|
||||
.fontred {
|
||||
color: #FF7575;
|
||||
background-image: none;
|
||||
}
|
||||
|
@ -68,10 +67,9 @@
|
|||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtTeachHour" runat="server" Label="学时" Required="true" ShowRedStar="true" DecimalPrecision="2" NoNegative="true" >
|
||||
<f:NumberBox ID="txtTeachHour" runat="server" Label="学时" Required="true" ShowRedStar="true" DecimalPrecision="2" NoNegative="true">
|
||||
</f:NumberBox>
|
||||
<f:DropDownList ID="drpCycle" runat="server" Label="周期" ShowRedStar="true"
|
||||
Required="true">
|
||||
<f:DropDownList ID="drpCycle" runat="server" Label="周期" ShowRedStar="true" Required="true">
|
||||
<f:ListItem Text="单次" Value="" />
|
||||
<f:ListItem Text="周" Value="0" />
|
||||
<f:ListItem Text="月(第二周)" Value="1" />
|
||||
|
@ -80,8 +78,8 @@
|
|||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox runat="server" ID="txtTeachMan" Label="授课人" Required="true" ShowRedStar="true" ></f:TextBox>
|
||||
<f:TextBox runat="server" ID="txtTeachAddress" Label="授课地址" Required="true" ShowRedStar="true" ></f:TextBox>
|
||||
<f:TextBox runat="server" ID="txtTeachMan" Label="授课人" Required="true" ShowRedStar="true"></f:TextBox>
|
||||
<f:TextBox runat="server" ID="txtTeachAddress" Label="授课地址" Required="true" ShowRedStar="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
|
|
|
@ -97,6 +97,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
dpSysUser.DataSource = getDataList;
|
||||
dpSysUser.DataBind();
|
||||
|
||||
//initdpSysUser();
|
||||
var userids = (from x in Funs.DB.Training_Task where x.PlanId == trainingPlan.PlanId select x.UserId).ToArray();
|
||||
if (userids != null && userids.Length > 0)
|
||||
{
|
||||
|
@ -428,9 +429,9 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
//this.drpCheckItem.Items.Clear();
|
||||
//Technique_CheckItemSetService.InitCheckItemSetNameDropDownList(this.drpCheckItem, "2", this.drpSupCheckItemSet.SelectedValue, false);
|
||||
}
|
||||
|
||||
protected void drpWorkUnit_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
string unitName = ((DropDownList)sender).SelectedValue;
|
||||
string id = "";
|
||||
if (unitName != BLL.Const._Null)
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectCompanyTrainingItemProducePlan.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.SelectCompanyTrainingItemProducePlan" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>选择培训教材</title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
.f-grid-row .f-grid-cell-inner {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="选择培训教材"
|
||||
EnableCollapse="true" runat="server" BoxFlex="1" EnableColumnLines="true"
|
||||
DataKeyNames="CompanyTrainingItemId" AllowCellEditing="true" ClicksToEdit="2" DataIDField="CompanyTrainingItemId"
|
||||
AllowSorting="false" SortField="CompanyTrainingItemCode" SortDirection="ASC" OnSort="Grid1_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="20" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpCompanyTrainingType" runat="server" Label="教材类别" Width="350px" LabelWidth="80px" EmptyText="请选择教材类别"
|
||||
EnableEdit="true" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
|
||||
</f:DropDownList>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSure" ToolTip="确定按钮" Icon="Accept" runat="server" OnClick="btnSure_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<%--<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center" />--%>
|
||||
<f:RenderField Width="100px" ColumnID="CompanyTrainingItemCode" DataField="CompanyTrainingItemCode" SortField="CompanyTrainingItemCode" FieldType="String" TextAlign="center"
|
||||
HeaderText="编号">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="260px" ColumnID="CompanyTrainingItemName" DataField="CompanyTrainingItemName" FieldType="String" HeaderText="教材名称" TextAlign="left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="140px" ColumnID="CompanyTrainingName" DataField="CompanyTrainingName" FieldType="String" HeaderText="教材类别" TextAlign="center"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField MinWidth="440px" ColumnID="WorkPostNames" DataField="WorkPostNames" FieldType="String" HeaderText="适合岗位" TextAlign="left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="选择培训教材" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="1000px"
|
||||
Height="400px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuSure" OnClick="btnSure_Click" EnablePostBack="true" Icon="Accept" runat="server" Text="确定">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,194 @@
|
|||
using BLL;
|
||||
using FineUIPro.Web.DataShow;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
/// <summary>
|
||||
/// 选择培训教材生成培训计划
|
||||
/// </summary>
|
||||
public partial class SelectCompanyTrainingItemProducePlan : PageBase
|
||||
{
|
||||
|
||||
#region 项目主键
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
BLL.CompanyTrainingService.InitCompanyTrainingIsEndDropDownList(this.drpCompanyTrainingType, true);
|
||||
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
|
||||
{
|
||||
Grid1.PageSize = this.CurrUser.PageSize.Value;
|
||||
}
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
//培训教材
|
||||
string strSql = @"SELECT item.CompanyTrainingItemId,train.CompanyTrainingName,item.CompanyTrainingId,item.CompanyTrainingItemCode,item.CompanyTrainingItemName,item.CompileMan,item.CompileDate,(CASE WHEN WorkPostNames IS NULL THEN '通用' ELSE WorkPostNames END) AS WorkPostNames
|
||||
FROM Training_CompanyTrainingItem AS item LEFT JOIN Training_CompanyTraining AS train on train.CompanyTrainingId=item.CompanyTrainingId
|
||||
WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
var drpType = this.drpCompanyTrainingType.SelectedValue;
|
||||
if (!string.IsNullOrEmpty(drpType) && drpType != Const._Null)
|
||||
{
|
||||
strSql += " AND item.CompanyTrainingId=@CompanyTrainingId ";
|
||||
listStr.Add(new SqlParameter("@CompanyTrainingId", drpType));
|
||||
}
|
||||
strSql += "ORDER BY item.CompanyTrainingItemCode ";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
#region 排序 分页
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 确定按钮事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSure_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string itemId = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
this.SaveData(itemId,this.ProjectId);
|
||||
}
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string itemId = Grid1.SelectedRowID;
|
||||
this.SaveData(itemId, this.ProjectId);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 生成计划
|
||||
/// </summary>
|
||||
/// <param name="itemId">被选中的培训教材Id</param>
|
||||
/// <param name="projectId">项目</param>
|
||||
private void SaveData(string itemId, string projectId)
|
||||
{
|
||||
Model.ProducePlanInfo info = new Model.ProducePlanInfo
|
||||
{
|
||||
CurrProjectId = projectId,
|
||||
CurrUserId = this.CurrUser.UserId,
|
||||
//CheckId = model.HazardRegisterId,
|
||||
//CheckType = (int)Enums.RetakeCourseType.日常巡检,
|
||||
//CheckTypeName = "日常巡检重修",
|
||||
//PersonId = model.ResponsibleMan,
|
||||
CompanyTrainingItemId = itemId,
|
||||
TrainEndDate = new DateTime(DateTime.Now.Year, 12, 31)
|
||||
};
|
||||
TrainingPlanService.SelectCompanyTrainingItemProducePlan(info);
|
||||
}
|
||||
}
|
||||
}
|
134
SGGL/FineUIPro.Web/HSSE/EduTrain/SelectCompanyTrainingItemProducePlan.aspx.designer.cs
generated
Normal file
134
SGGL/FineUIPro.Web/HSSE/EduTrain/SelectCompanyTrainingItemProducePlan.aspx.designer.cs
generated
Normal file
|
@ -0,0 +1,134 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
|
||||
|
||||
public partial class SelectCompanyTrainingItemProducePlan
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// drpCompanyTrainingType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpCompanyTrainingType;
|
||||
|
||||
/// <summary>
|
||||
/// btnSure 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSure;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuSure 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuSure;
|
||||
}
|
||||
}
|
|
@ -15,14 +15,14 @@
|
|||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="培训任务" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="TaskId" EnableColumnLines="true" ForceFit="true"
|
||||
DataIDField="TaskId" AllowSorting="true" SortField="TaskDate,PersonName"
|
||||
DataIDField="TaskId" AllowSorting="true" SortField="TaskDate DESC,PersonName"
|
||||
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
|
||||
PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox ID="txtName" runat="server" Label="查询" EmptyText="输入查询条件" AutoPostBack="true"
|
||||
<f:TextBox ID="txtName" runat="server" Label="查询" EmptyText="输入培训计划、人员名称" AutoPostBack="true"
|
||||
OnTextChanged="TextBox_TextChanged" Width="350px" LabelWidth="80px" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
strSql += " AND (Plans.PlanName LIKE @name OR Person.PersonName LIKE @name)";
|
||||
listStr.Add(new SqlParameter("@name", "%" + this.txtName.Text.Trim() + "%"));
|
||||
}
|
||||
strSql += " ORDER BY Task.TaskDate DESC";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrainFind.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.TrainFind" %>
|
||||
|
||||
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head id="Head1" runat="server">
|
||||
|
@ -9,7 +10,22 @@
|
|||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel2" runat="server" />
|
||||
<f:Panel ID="Panel2" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
|
||||
EnableCollapse="true" Width="380" Title="公司-项目" TitleToolTip="公司-项目" ShowBorder="true"
|
||||
ShowHeader="true" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft" Layout="Fit">
|
||||
<Items>
|
||||
<f:ContentPanel ID="ContentPanel1" runat="server" ShowHeader="false" EnableCollapse="true" AutoScroll="true"
|
||||
BodyPadding="0px">
|
||||
<uc1:UnitProjectTControl ID="ucTree" runat="server" Onchange="changeTree" />
|
||||
</f:ContentPanel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
|
||||
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
|
@ -23,7 +39,7 @@
|
|||
<f:CheckBoxList runat="server" ID="cbIssue" ShowLabel="false" Width="150px" LabelAlign="Right"
|
||||
OnSelectedIndexChanged="Text_OnTextChanged" AutoPostBack="true">
|
||||
<f:CheckItem Text="不合格" Value="0" />
|
||||
<f:CheckItem Text="合格" Value="1" Selected="true"/>
|
||||
<f:CheckItem Text="合格" Value="1" Selected="true" />
|
||||
</f:CheckBoxList>
|
||||
<f:TextBox ID="txtPersonName" runat="server" Label="姓名"
|
||||
AutoPostBack="true" OnTextChanged="Text_OnTextChanged" LabelWidth="50px" Width="150px">
|
||||
|
@ -119,6 +135,10 @@
|
|||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -43,12 +43,14 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
//单位
|
||||
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
|
||||
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
|
||||
this.InitDropDownList();
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
|
||||
this.drpUnitId.Enabled = false;
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
//////权限按钮方法
|
||||
//this.GetButtonPower();
|
||||
}
|
||||
//培训类型
|
||||
BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true);
|
||||
|
@ -59,12 +61,44 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
BindGrid();
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
this.InitDropDownList();
|
||||
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 NEWID() AS ID, CardNo,PersonName,ProjectId,UnitId,UnitName,WorkPostName,TrainTitle ,TrainStartDate,TrainEndDate,TrainTypeId,TeachHour,TrainTypeName,CheckScore,CheckResult,TeachMan,UnitType,TrainLevelName" +
|
||||
@" FROM dbo.View_EduTrain_TrainFind" +
|
||||
@" WHERE 1=1";
|
||||
|
|
|
@ -7,10 +7,12 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.EduTrain {
|
||||
namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
|
||||
|
||||
public partial class TrainFind {
|
||||
public partial class TrainFind
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Head1 控件。
|
||||
|
@ -39,6 +41,51 @@ namespace FineUIPro.Web.HSSE.EduTrain {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel2;
|
||||
|
||||
/// <summary>
|
||||
/// panelLeftRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
/// <summary>
|
||||
/// ContentPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ContentPanel ContentPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// ucTree 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -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("你确定要删除选中的 <b><script>{0}</script></b> 行数据吗?", 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"])) ///是否文件柜查看页面传项目值
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="培训记录" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="TaskItemId" EnableColumnLines="true" DataIDField="TaskItemId" AllowSorting="true"
|
||||
AllowPaging="true" ForceFit="true"
|
||||
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
IsDatabasePaging="true" PageSize="20" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true"
|
||||
EnableTextSelection="True" EnableSummary="true" SummaryPosition="Flow">
|
||||
<Toolbars>
|
||||
|
|
|
@ -62,6 +62,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
strSql += " AND tp.TrainStartDate <= @EndDate ";
|
||||
listStr.Add(new SqlParameter("@EndDate", this.txtEndDate.Text.Trim()));
|
||||
}
|
||||
strSql += " ORDER BY tp.TrainStartDate DESC ";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
|
|
|
@ -333,7 +333,7 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
|||
|
||||
if (!string.IsNullOrWhiteSpace(model.ResponsibleMan) && !string.IsNullOrWhiteSpace(model.CompanyTrainingItemId))
|
||||
{//责任人和重修教材非空,生成培训计划
|
||||
Model.RetakeCourseProducePlanInfo info = new Model.RetakeCourseProducePlanInfo
|
||||
Model.ProducePlanInfo info = new Model.ProducePlanInfo
|
||||
{
|
||||
CurrProjectId = this.CurrUser.LoginProjectId,
|
||||
CurrUserId = this.CurrUser.UserId,
|
||||
|
|
|
@ -99,6 +99,8 @@
|
|||
</f:Button>
|
||||
<f:Button ID="btnQR" ToolTip="批量生成二维码" Icon="TableRefresh" runat="server" OnClick="btnQR_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSelectProducePlan" ToolTip="选择人员生成培训计划" Icon="ShapesManySelect" runat="server" OnClick="btnSelectProducePlan_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
|
|
|
@ -82,11 +82,11 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
//var personLists = BLL.PersonService.GetPersonList(project.ProjectId);
|
||||
|
||||
String strSql1 = @"select UnitId,count( * ) num from SitePerson_Person
|
||||
where ProjectId='"+ this.CurrUser.LoginProjectId +@"'
|
||||
where ProjectId='" + this.CurrUser.LoginProjectId + @"'
|
||||
group by UnitId";
|
||||
|
||||
String strSql2= @" select UnitId,count( * ) num from SitePerson_Person
|
||||
where ProjectId='" + this.CurrUser.LoginProjectId + @"' and IsUsed =1 and InTime<='" + DateTime.Now.ToString("yyyy-MM-dd")+"' and (OutTime is null or OutTime>'"+DateTime.Now.ToString("yyyy-MM-dd")+@"' )
|
||||
String strSql2 = @" select UnitId,count( * ) num from SitePerson_Person
|
||||
where ProjectId='" + this.CurrUser.LoginProjectId + @"' and IsUsed =1 and InTime<='" + DateTime.Now.ToString("yyyy-MM-dd") + "' and (OutTime is null or OutTime>'" + DateTime.Now.ToString("yyyy-MM-dd") + @"' )
|
||||
group by UnitId";
|
||||
|
||||
|
||||
|
@ -126,7 +126,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
}
|
||||
rootNode.Expanded = true;
|
||||
this.tvProjectAndUnit.Nodes.Add(rootNode);
|
||||
GetUnitLists(rootNode.Nodes, this.ProjectId, dt1,dt2);
|
||||
GetUnitLists(rootNode.Nodes, this.ProjectId, dt1, dt2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -350,6 +350,39 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 选择人员生成培训计划
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSelectProducePlan_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string personId = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
this.ProducePlan(personId, this.ProjectId);
|
||||
}
|
||||
ShowNotify("生成培训计划成功!", MessageBoxIcon.Success);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成计划
|
||||
/// </summary>
|
||||
/// <param name="personId">被选中的人员</param>
|
||||
/// <param name="projectId">项目</param>
|
||||
private void ProducePlan(string personId, string projectId)
|
||||
{
|
||||
Model.ProducePlanInfo info = new Model.ProducePlanInfo
|
||||
{
|
||||
CurrProjectId = projectId,
|
||||
CurrUserId = this.CurrUser.UserId,
|
||||
PersonId = personId,
|
||||
TrainEndDate = new DateTime(DateTime.Now.Year, 12, 31)
|
||||
};
|
||||
bool result = TrainingPlanService.SelectPersonProducePlan(info);
|
||||
}
|
||||
|
||||
#region 点击TreeView
|
||||
/// <summary>
|
||||
/// 点击TreeView
|
||||
|
@ -788,7 +821,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
|
||||
protected void drpIsUsedName_OnSelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (drpIsUsedName.SelectedValue== "否")
|
||||
if (drpIsUsedName.SelectedValue == "否")
|
||||
{
|
||||
ckIsBlackList.Hidden = false;
|
||||
}
|
||||
|
|
|
@ -257,6 +257,15 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnQR;
|
||||
|
||||
/// <summary>
|
||||
/// btnSelectProducePlan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSelectProducePlan;
|
||||
|
||||
/// <summary>
|
||||
/// lbI 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Model
|
||||
{
|
||||
public class RetakeCourseProducePlanInfo
|
||||
public class ProducePlanInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目Id
|
3013
SGGL/Model/Model.cs
3013
SGGL/Model/Model.cs
File diff suppressed because it is too large
Load Diff
|
@ -231,7 +231,7 @@
|
|||
<Compile Include="HJGL\SpRpNDTWeekReport.cs" />
|
||||
<Compile Include="HJGL\SpWeldingDailyItem.cs" />
|
||||
<Compile Include="HJGL\WelderEntrance.cs" />
|
||||
<Compile Include="HSSE\EduTrain\RetakeCourseProducePlanInfo.cs" />
|
||||
<Compile Include="HSSE\EduTrain\ProducePlanInfo.cs" />
|
||||
<Compile Include="HSSE\MonthReportCHSEDay.cs" />
|
||||
<Compile Include="HSSE\PageDataPersonInOutItem.cs" />
|
||||
<Compile Include="HSSE\PostTraining\PostTrainingStandardInfo.cs" />
|
||||
|
|
Loading…
Reference in New Issue