This commit is contained in:
夏菊 2026-04-07 19:44:10 +08:00
parent 53eeca8eb3
commit 7ecbc2ebc0
46 changed files with 2694 additions and 992 deletions

View File

@ -3774,6 +3774,10 @@ namespace BLL
/// </summary>
public const string TrainRecordTemplateUrl = "File\\Excel\\DataIn\\人员培训导入模板.xls";
/// <summary>
/// 公司教材库模板文件原始的虚拟路径
/// </summary>
public const string CompanyTrainingTemplateUrl = "File\\Excel\\DataIn\\公司教材库导入模板.xls";
/// <summary>
/// 考试试题模版文件原始的虚拟路径
/// </summary>
public const string TestTrainingTemplateUrl = "File\\Excel\\DataIn\\考试试题模版.xls";

View File

@ -1853,6 +1853,7 @@
<Content Include="HSSE\EduTrain\SelectCompanyTrainingItemProducePlan.aspx" />
<Content Include="HSSE\EduTrain\TaskNotice.aspx" />
<Content Include="HSSE\EduTrain\TaskNoticeEdit.aspx" />
<Content Include="HSSE\EduTrain\CompanyTrainingItemIn.aspx" />
<Content Include="HSSE\EduTrain\TrainFindWorkPost.aspx" />
<Content Include="HSSE\EduTrain\Trainingrecords.aspx" />
<Content Include="HSSE\EduTrain\TrainTestRecordEdit.aspx" />
@ -12683,6 +12684,13 @@
<Compile Include="HSSE\EduTrain\TaskNoticeEdit.aspx.designer.cs">
<DependentUpon>TaskNoticeEdit.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\EduTrain\CompanyTrainingItemIn.aspx.cs">
<DependentUpon>CompanyTrainingItemIn.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HSSE\EduTrain\CompanyTrainingItemIn.aspx.designer.cs">
<DependentUpon>CompanyTrainingItemIn.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\EduTrain\TrainFindWorkPost.aspx.cs">
<DependentUpon>TrainFindWorkPost.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

View File

@ -63,6 +63,9 @@
<f:Button ID="btnNewDetail" ToolTip="新增" Icon="Add" runat="server" OnClick="btnNewDetail_Click"
Hidden="true">
</f:Button>
<f:Button ID="btnImport" ToolTip="导入" Icon="ApplicationGet" Hidden="true" runat="server"
OnClick="btnImport_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
@ -137,6 +140,10 @@
Target="Parent" EnableResize="false" runat="server" OnClose="Window2_Close" IsModal="true"
Width="700px" Height="600px">
</f:Window>
<f:Window ID="Window3" Title="导入信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" OnClose="Window3_Close" IsModal="false"
CloseAction="HidePostBack" Width="1200px" Height="700px">
</f:Window>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">

View File

@ -415,6 +415,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
this.btnImport.Hidden = false;
this.btnNewDetail.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
@ -431,6 +432,23 @@ namespace FineUIPro.Web.HSSE.EduTrain
}
#endregion
#region
/// <summary>
/// 导入按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("CompanyTrainingItemIn.aspx", "导入 - ")));
}
protected void Window3_Close(object sender, EventArgs e)
{
this.InitTreeMenu();
this.BindGrid();
}
#endregion
/// <summary>
/// 导出
/// </summary>

View File

@ -167,6 +167,15 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// </remarks>
protected global::FineUIPro.Button btnNewDetail;
/// <summary>
/// btnImport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// btnOut 控件。
/// </summary>
@ -248,6 +257,15 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Window3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window3;
/// <summary>
/// WindowAtt 控件。
/// </summary>

View File

@ -0,0 +1,86 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CompanyTrainingItemIn.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.CompanyTrainingItemIn" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>导入公司教材库</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
<Items>
<f:Button ID="btnAudit" Icon="ApplicationEdit" runat="server" ToolTip="审核" ValidateForms="SimpleForm1"
OnClick="btnAudit_Click">
</f:Button>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnDownLoad" runat="server" Icon="ApplicationGo" ToolTip="下载模板" OnClick="btnDownLoad_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Rows>
<f:FormRow>
<Items>
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
LabelWidth="150px">
</f:FileUpload>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Grid ID="gvErrorInfo" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="导入教材信息" EnableCollapse="true"
runat="server" BoxFlex="1" AllowCellEditing="true" ClicksToEdit="2" AllowSorting="true"
SortDirection="DESC" EnableColumnLines="true" ForceFit="true" AllowPaging="false" IsDatabasePaging="false" PageSize="10"
EnableRowDoubleClickEvent="true" AllowFilters="true" EnableTextSelection="True" Height="400">
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="40px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# gvErrorInfo.PageIndex * gvErrorInfo.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:BoundField DataField="Row" HeaderText="错误行号" Width="50px">
</f:BoundField>
<f:BoundField DataField="Column" HeaderText="错误列" Width="100px">
</f:BoundField>
<f:BoundField DataField="Reason" HeaderText="错误类型" MinWidth="220px">
</f:BoundField>
</Columns>
</f:Grid>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:HiddenField ID="hdFileName" runat="server">
</f:HiddenField>
<f:HiddenField ID="hdCheckResult" runat="server">
</f:HiddenField>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Label ID="lblBottom" runat="server" Text="说明1、导入模板为.xls后缀的EXCEL文件黄色背景为必填项
2、对于导入信息中重复记录自动过滤插入一条记录
3、掌握程度为掌握、熟悉、了解
4、适合岗位空时为通用多岗位时用,隔开,多选答案时用,隔开;
5、数据导入完成成功后自动返回如果有不成功数据页面弹出提示框列表显示导入成功数据。">
</f:Label>
</Items>
</f:FormRow>
</Rows>
</f:Form>
<f:Window ID="Window1" Title="导入信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="false"
CloseAction="HidePostBack" Width="900px" Height="600px">
</f:Window>
</form>
</body>
</html>

View File

@ -0,0 +1,419 @@
using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using System.Web.Util;
namespace FineUIPro.Web.HSSE.EduTrain
{
public partial class CompanyTrainingItemIn : PageBase
{
#region
/// <summary>
/// 上传预设的虚拟路径
/// </summary>
private string initPath = Const.ExcelUrl;
/// <summary>
/// 导入集合
/// </summary>
public static List<Model.Training_CompanyTrainingItem> viewTrainingItems = new List<Model.Training_CompanyTrainingItem>();
/// <summary>
/// 错误集合
/// </summary>
public static List<Model.ErrorInfo> errorInfos = new List<Model.ErrorInfo>();
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.hdFileName.Text = string.Empty;
this.hdCheckResult.Text = string.Empty;
if (viewTrainingItems != null)
{
viewTrainingItems.Clear();
}
if (errorInfos != null)
{
errorInfos.Clear();
}
}
}
#endregion
#region
/// <summary>
/// 数据导入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAudit_Click(object sender, EventArgs e)
{
try
{
if (this.fuAttachUrl.HasFile == false)
{
ShowNotify("请您选择Excel文件", MessageBoxIcon.Warning);
return;
}
string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower();
if (IsXls != ".xls")
{
ShowNotify("只可以选择Excel文件", MessageBoxIcon.Warning);
return;
}
if (viewTrainingItems != null)
{
viewTrainingItems.Clear();
}
if (errorInfos != null)
{
errorInfos.Clear();
}
string rootPath = Server.MapPath("~/");
string initFullPath = rootPath + initPath;
if (!Directory.Exists(initFullPath))
{
Directory.CreateDirectory(initFullPath);
}
this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls;
string filePath = initFullPath + this.hdFileName.Text;
this.fuAttachUrl.PostedFile.SaveAs(filePath);
ImportXlsToData(rootPath + initPath + this.hdFileName.Text);
}
catch (Exception ex)
{
ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning);
}
}
#region Excel提取数据
/// <summary>
/// 从Excel提取数据--》Dataset
/// </summary>
/// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData(string fileName)
{
try
{
viewTrainingItems.Clear();
string oleDBConnString = String.Empty;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source=";
oleDBConnString += fileName;
oleDBConnString += ";Extended Properties=Excel 8.0;";
OleDbConnection oleDBConn = null;
OleDbDataAdapter oleAdMaster = null;
DataTable m_tableName = new DataTable();
DataSet ds = new DataSet();
oleDBConn = new OleDbConnection(oleDBConnString);
oleDBConn.Open();
m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (m_tableName != null && m_tableName.Rows.Count > 0)
{
m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
}
string sqlMaster;
sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn);
oleAdMaster.Fill(ds, "m_tableName");
oleAdMaster.Dispose();
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL(ds.Tables[0]);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region Dataset的数据导入数据库
/// <summary>
/// 将Dataset的数据导入数据库
/// </summary>
/// <param name="pds">数据集</param>
/// <param name="Cols">数据集行数</param>
/// <returns></returns>
private bool AddDatasetToSQL(DataTable pds)
{
string result = string.Empty;
int ic, ir;
ic = pds.Columns.Count;
ir = pds.Rows.Count;
if (pds != null && ir > 0)
{
///教材库
var companyTrainingItems = from x in Funs.DB.Training_CompanyTrainingItem select x;
///类型
var trainings = from x in Funs.DB.Training_CompanyTraining select x;
///岗位
var workPosts = from x in Funs.DB.Base_WorkPost select x;
for (int i = 0; i < ir; i++)
{
Model.Training_CompanyTrainingItem newViewTrainingItem = new Model.Training_CompanyTrainingItem();
newViewTrainingItem.CompanyTrainingItemId = SQLHelper.GetNewID(typeof(Model.Training_CompanyTrainingItem));
//类型
string col1 = pds.Rows[i][0].ToString().Trim();
if (string.IsNullOrEmpty(col1))
{
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "教材类型", Reason = "此项为必填项!" });
}
else
{
var standard = trainings.FirstOrDefault(x => x.CompanyTrainingName == col1);
if (standard != null)
{
newViewTrainingItem.CompanyTrainingId = standard.CompanyTrainingId;
}
else
{
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "教材类别", Reason = $"不存在教材类别[{col1}]" });
}
}
if (!string.IsNullOrWhiteSpace(newViewTrainingItem.CompanyTrainingId))
{
//教材编号
string col2 = pds.Rows[i][1].ToString().Trim();
//教材名称
string col3 = pds.Rows[i][2].ToString().Trim();
if (!string.IsNullOrWhiteSpace(col2))
{
var items = companyTrainingItems.FirstOrDefault(x => x.CompanyTrainingItemCode == col2);
if (items != null)
{
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "教材编号", Reason = $"[{col1}]已存在编号[{col2}]" });
}
else
{
newViewTrainingItem.CompanyTrainingItemCode = col2;
}
}
else
{
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "教材编号", Reason = "不能为空!" });
}
if (!string.IsNullOrWhiteSpace(col3))
{
var item = companyTrainingItems.FirstOrDefault(x => x.CompanyTrainingItemName == col3);
if (item != null)
{
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "教材名称", Reason = $"[{col1}]已存在教材名称[{col3}]" });
}
else
{
newViewTrainingItem.CompanyTrainingItemName = col3;
}
}
else
{
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "教材名称", Reason = "不能为空!" });
}
}
//适合岗位
string col4 = pds.Rows[i][3].ToString().Trim();
if (!string.IsNullOrEmpty(col4))
{
List<string> WorkPostSels = Funs.GetStrListByStr(col4, ',');
if (WorkPostSels.Count() > 0)
{
string ids = string.Empty;
foreach (var item in WorkPostSels)
{
string workItem = item.Trim();
var wp = workPosts.FirstOrDefault(x => x.WorkPostName == workItem);
if (wp != null)
{
ids += wp.WorkPostId + ",";
}
else
{
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "适合岗位", Reason = $"[{workItem}]不在岗位表中!" });
}
}
if (!string.IsNullOrEmpty(ids))
{
newViewTrainingItem.WorkPostNames = col4;
newViewTrainingItem.WorkPostIds = ids.Substring(0, ids.LastIndexOf(","));
}
}
}
//时长(分钟)
string col5 = pds.Rows[i][4].ToString().Trim();
if (!string.IsNullOrWhiteSpace(col5))
{
newViewTrainingItem.LearningTime = int.Parse(col5) * 60;
}
//掌握程度
string col6 = pds.Rows[i][5].ToString().Trim();
if (!string.IsNullOrWhiteSpace(col6))
{
newViewTrainingItem.Outcome = col6 == "了解" ? 2 : col6 == "熟悉" ? 1 : 0;
}
else
{
newViewTrainingItem.Outcome = 0;
}
newViewTrainingItem.CompileDate = DateTime.Now;
newViewTrainingItem.CompileMan = this.CurrUser.UserName;
///加入公司教材库
viewTrainingItems.Add(newViewTrainingItem);
}
if (errorInfos.Any())
{
viewTrainingItems.Clear();
this.gvErrorInfo.DataSource = errorInfos;
this.gvErrorInfo.DataBind();
}
else
{
errorInfos.Clear();
if (!viewTrainingItems.Any())
{
Alert.ShowInTop("导入数据为空!", MessageBoxIcon.Warning);
}
else
{
ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success);
}
}
}
else
{
Alert.ShowInTop("导入数据为空!", MessageBoxIcon.Warning);
}
return true;
}
#endregion
#endregion
#region
/// <summary>
/// 保存
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (!errorInfos.Any())
{
int a = viewTrainingItems.Count();
int insertCount = 0;
int updateCount = 0;
for (int i = 0; i < a; i++)
{
Model.Training_CompanyTrainingItem newModel = new Model.Training_CompanyTrainingItem
{
CompanyTrainingId = viewTrainingItems[i].CompanyTrainingId,
CompanyTrainingItemId = viewTrainingItems[i].CompanyTrainingItemId,
CompanyTrainingItemCode = viewTrainingItems[i].CompanyTrainingItemCode,
CompanyTrainingItemName = viewTrainingItems[i].CompanyTrainingItemName,
WorkPostIds = viewTrainingItems[i].WorkPostIds,
WorkPostNames = viewTrainingItems[i].WorkPostNames,
LearningTime = viewTrainingItems[i].LearningTime,
CompileDate = viewTrainingItems[i].CompileDate,
CompileMan = viewTrainingItems[i].CompileMan,
Outcome = viewTrainingItems[i].Outcome
};
BLL.CompanyTrainingItemService.AddCompanyTrainingItem(newModel);
}
string rootPath = Server.MapPath("~/");
string initFullPath = rootPath + initPath;
string filePath = initFullPath + this.hdFileName.Text;
if (filePath != string.Empty && File.Exists(filePath))
{
File.Delete(filePath);//删除上传的XLS文件
}
ShowNotify("导入完成!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
Alert.ShowInTop("请先将错误数据修正,再重新导入保存!", MessageBoxIcon.Warning);
}
}
#endregion
#region
/// <summary>
/// 关闭导入弹出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
if (Session["trainingItem"] != null)
{
viewTrainingItems = Session["trainingItem"] as List<Model.Training_CompanyTrainingItem>;
}
if (viewTrainingItems.Count > 0)
{
this.gvErrorInfo.Hidden = false;
this.gvErrorInfo.DataSource = viewTrainingItems;
this.gvErrorInfo.DataBind();
}
}
#endregion
#region
/// <summary>
/// 下载模板按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDownLoad_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel")));
}
/// <summary>
/// 下载导入模板
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
{
if (e.EventArgument == "Confirm_OK")
{
string rootPath = Server.MapPath("~/");
string filePath = Const.CompanyTrainingTemplateUrl;
string uploadfilepath = rootPath + filePath;
string fileName = Path.GetFileName(filePath);
FileInfo info = new FileInfo(uploadfilepath);
long fileSize = info.Length;
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.ContentType = "excel/plain";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.AddHeader("Content-Length", fileSize.ToString().Trim());
Response.TransmitFile(uploadfilepath, 0, fileSize);
Response.End();
}
}
#endregion
}
}

View File

@ -0,0 +1,143 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.EduTrain
{
public partial class CompanyTrainingItemIn
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// btnAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAudit;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnDownLoad 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDownLoad;
/// <summary>
/// fuAttachUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FileUpload fuAttachUrl;
/// <summary>
/// gvErrorInfo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid gvErrorInfo;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPageIndex;
/// <summary>
/// hdFileName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdFileName;
/// <summary>
/// hdCheckResult 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdCheckResult;
/// <summary>
/// lblBottom 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lblBottom;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
}
}

View File

@ -1,7 +1,8 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Task.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.Task" %>
<!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" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>培训任务</title>
@ -10,8 +11,20 @@
<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:Panel ID="Panel1" 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="TaskId" EnableColumnLines="true" ForceFit="true"
@ -59,6 +72,8 @@
</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" OnClose="Window1_Close" IsModal="true"
Width="1000px" Height="560px">

View File

@ -9,6 +9,22 @@ namespace FineUIPro.Web.HSSE.EduTrain
{
public partial class Task : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@ -20,7 +36,20 @@ namespace FineUIPro.Web.HSSE.EduTrain
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
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();
}
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
BindGrid();
@ -34,17 +63,34 @@ namespace FineUIPro.Web.HSSE.EduTrain
}
}
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 Task.TaskId,Task.PlanId,Task.UserId,Task.TaskDate,(CASE Task.States WHEN '0' THEN '未响应' WHEN '1' THEN '已响应' WHEN '2' THEN '已完成' ELSE '' END) AS States,Plans.PlanName,Person.PersonName
FROM dbo.Training_Task AS Task
LEFT JOIN dbo.Training_Plan AS Plans ON Plans.PlanId=Task.PlanId
LEFT JOIN dbo.SitePerson_Person AS Person ON Person.PersonId = Task.UserId
WHERE Task.ProjectId='" + this.CurrUser.LoginProjectId + "'";
WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND Task.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
{
strSql += " AND (Plans.PlanName LIKE @name OR Person.PersonName LIKE @name)";
@ -195,7 +241,11 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectTrainingTaskMenuId);
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectTrainingTaskMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnDelete))

View File

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.EduTrain {
namespace FineUIPro.Web.HSSE.EduTrain
{
public partial class Task {
public partial class Task
{
/// <summary>
/// form1 控件。
@ -39,6 +41,42 @@ namespace FineUIPro.Web.HSSE.EduTrain {
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <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 控件。
/// </summary>

View File

@ -1,7 +1,8 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPlan.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.TestPlan" %>
<!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" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>考试计划</title>
@ -10,8 +11,20 @@
<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:Panel ID="Panel1" 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="TestPlanId" EnableColumnLines="true"
@ -24,7 +37,7 @@
<Items>
<f:RadioButtonList ID="ckStates" runat="server" AutoPostBack="true" Label="状态" LabelAlign="Right"
AutoColumnWidth="true" OnSelectedIndexChanged="TextBox_TextChanged">
<f:RadioItem Text="全部" Value="-2" Selected="true"/>
<f:RadioItem Text="全部" Value="-2" Selected="true" />
<f:RadioItem Text="未发布" Value="0" />
<f:RadioItem Text="已发布" Value="1" />
<%-- <f:RadioItem Text="考试中" Value="2" />
@ -95,6 +108,8 @@
</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"
Width="1000px" Height="500px">

View File

@ -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.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(CurrUser.ProjectId, null);
}
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))

View File

@ -41,6 +41,42 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <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 控件。
/// </summary>

View File

@ -1,5 +1,7 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestRecord.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.TestRecord" %>
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
@ -13,18 +15,29 @@
background-color: red;
}
.LabelColor
{
.LabelColor {
color: Red;
font-size:small;
font-size: small;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<f:Panel ID="Panel1" 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="TestRecordId" EnableColumnLines="true" DataIDField="TestRecordId" AllowSorting="true"
@ -115,6 +128,8 @@
</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"
Width="1200px" Height="560px">

View File

@ -1,5 +1,6 @@
using Aspose.Words;
using BLL;
using FineUIPro.Web.DataShow;
using System;
using System.Collections.Generic;
using System.Data;
@ -11,6 +12,22 @@ namespace FineUIPro.Web.HSSE.EduTrain
{
public partial class TestRecord : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@ -22,8 +39,21 @@ namespace FineUIPro.Web.HSSE.EduTrain
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
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();
}
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
GetButtonPower();
var sysTestRule = Funs.DB.Sys_TestRule.FirstOrDefault();
if (sysTestRule != null)
@ -40,8 +70,6 @@ namespace FineUIPro.Web.HSSE.EduTrain
else
{
this.lbPassScore.Text = "红色表示分数低于80分。";
}
///更新没有结束时间且超时的考试记录
@ -65,6 +93,10 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// </summary>
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = @"SELECT TestRecord.TestRecordId,TestRecord.TestPlanId, TestRecord.TestManId,TestRecord.TestStartTime,TestRecord.TestEndTime, TestRecord.TestScores,
(CASE WHEN TestPlan.PlanName IS NULL THEN Training.TrainingName ELSE TestPlan.PlanName END) AS PlanName,
ISNULL(TestPlan.Duration,90) AS Duration,ISNULL(TestPlan.TotalScore,100) AS TotalScore,TestPlan.TestPalce,ISNULL(TestPlan.QuestionCount,95) AS QuestionCount,TestRecord.TemporaryUser,Person.PersonName AS TestManName
@ -74,8 +106,10 @@ namespace FineUIPro.Web.HSSE.EduTrain
+ @" LEFT JOIN dbo.Training_TestTraining AS Training ON Training.TrainingId = TestRecord.TestType"
+ @" LEFT JOIN dbo.SitePerson_Person AS Person ON Person.PersonId = TestRecord.TestManId "
+ @" LEFT JOIN dbo.Base_Unit AS Unit ON Person.UnitId=Unit.UnitId"
+ @" WHERE TestRecord.TestStartTime is not null and (isFiled IS NULL OR isFiled = 0) and TestRecord.ProjectId = '" + this.CurrUser.LoginProjectId+"'";
+ @" WHERE TestRecord.TestStartTime is not null and (isFiled IS NULL OR isFiled = 0) ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND TestRecord.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
{
strSql += " AND (Person.PersonName LIKE @name OR TestPlan.PlanName LIKE @name OR Training.TrainingName LIKE @name OR Unit.UnitName like @name)";
@ -337,7 +371,11 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HSSETestRecordMenuId);
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HSSETestRecordMenuId);
if (buttonList.Count > 0)
{

View File

@ -41,6 +41,42 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <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 控件。
/// </summary>

View File

@ -1,7 +1,9 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestStatistics.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.TestStatistics" %>
<!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" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>考试统计</title>
@ -10,8 +12,20 @@
<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:Panel ID="Panel1" 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="PersonId" EnableColumnLines="true" ForceFit="true"
@ -23,9 +37,7 @@
<Items>
<f:TextBox ID="txtName" runat="server" Label="查询" EmptyText="输入查询条件" AutoPostBack="true"
OnTextChanged="TextBox_TextChanged" Width="350px" LabelWidth="80px" LabelAlign="Right">
</f:TextBox>
<f:CheckBox ID="cbNoPass" Text="<70"></f:CheckBox>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
@ -72,6 +84,8 @@
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
</form>
<script type="text/javascript">
// 返回false来阻止浏览器右键菜单

View File

@ -10,6 +10,22 @@ namespace FineUIPro.Web.HSSE.EduTrain
{
public partial class TestStatistics : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@ -21,6 +37,20 @@ namespace FineUIPro.Web.HSSE.EduTrain
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
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();
}
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
var sysTestRule = Funs.DB.Sys_TestRule.FirstOrDefault();
var passingScore = "60";
@ -41,11 +71,31 @@ 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;
}
var sysTestRule = Funs.DB.Sys_TestRule.FirstOrDefault();
var passingScore = "60";
if (sysTestRule != null)
@ -62,8 +112,11 @@ namespace FineUIPro.Web.HSSE.EduTrain
+ @" ON person.PersonId=TestCount.TestManId"
+ @" LEFT JOIN (SELECT COUNT(TestRecordId) AS TestQualifyCount,TestManId FROM Training_TestRecord WHERE TestScores>= "+ passingScore + " GROUP BY TestManId) AS TestQualifyCount"
+ @" ON person.PersonId=TestQualifyCount.TestManId"
+ @" WHERE PersonId <> '" + BLL.Const.sysglyId + "' and person.projectid='" + this.CurrUser.LoginProjectId + "'";
+ @" WHERE PersonId <> '" + BLL.Const.sysglyId + "' ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND person.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
{
strSql += " AND (PersonName LIKE @name OR CardNo LIKE @name OR Unit.UnitName LIKE @name OR Depart.DepartName LIKE @name OR WorkPostName LIKE @name)";

View File

@ -41,6 +41,42 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <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 控件。
/// </summary>

View File

@ -1,7 +1,8 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestTrainRecord.aspx.cs" Inherits="FineUIPro.Web.HSSE.Train.TestTrainRecord" %>
<!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" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>培训试题</title>
@ -10,8 +11,20 @@
<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:Panel ID="Panel1" 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="TrainingItemId" EnableColumnLines="true"
@ -25,7 +38,7 @@
<f:RadioButtonList ID="ckStates" runat="server" AutoPostBack="true" Label="状态" LabelAlign="Right"
AutoColumnWidth="true" OnSelectedIndexChanged="ckStates_SelectedIndexChanged">
<f:RadioItem Text="全部" Value="0" />
<f:RadioItem Text="未响应" Value="1" Selected="true"/>
<f:RadioItem Text="未响应" Value="1" Selected="true" />
<f:RadioItem Text="已响应" Value="2" />
</f:RadioButtonList>
</Items>
@ -65,6 +78,8 @@
</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"
Width="900px" Height="500px">

View File

@ -8,6 +8,22 @@ namespace FineUIPro.Web.HSSE.Train
{
public partial class TestTrainRecord : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@ -18,6 +34,20 @@ namespace FineUIPro.Web.HSSE.Train
{
if (!IsPostBack)
{
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();
}
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
this.BindGrid();
}
@ -29,6 +59,24 @@ namespace FineUIPro.Web.HSSE.Train
}
}
}
/// <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;
//}
}
#endregion
#region
@ -37,6 +85,10 @@ namespace FineUIPro.Web.HSSE.Train
/// </summary>
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = @"SELECT Task.TaskId,Task.TaskDate,person.PersonName,TrainingItem.TrainingId,TrainingItem.TrainingItemId,Training.TrainingCode,Training.TrainingName"
+ @",TrainingItem.TrainingItemCode,TrainingItem.TrainingItemName "
+ @" FROM Training_Task AS Task"
@ -44,7 +96,8 @@ namespace FineUIPro.Web.HSSE.Train
+ @" LEFT JOIN SitePerson_Person AS person ON Task.UserId =person.PersonId "
+ @" LEFT JOIN Training_TrainingItem AS TrainingItem ON PlanItem.TrainingEduItemId =TrainingItem.TrainingItemId"
+ @" LEFT JOIN Training_Training AS Training ON TrainingItem.TrainingId=Training.TrainingId"
+ @" WHERE Task.UserId=@UserId ";
+ @" WHERE 1=1 ";
strSql += " AND Task.UserId=@UserId ";
List<SqlParameter> listStr = new List<SqlParameter>
{
new SqlParameter("@UserId", this.CurrUser.UserId)

View File

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Train {
namespace FineUIPro.Web.HSSE.Train
{
public partial class TestTrainRecord {
public partial class TestTrainRecord
{
/// <summary>
/// form1 控件。
@ -39,6 +41,42 @@ namespace FineUIPro.Web.HSSE.Train {
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <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 控件。
/// </summary>

View File

@ -64,7 +64,7 @@
<f:Button ID="btnNewDetail" ToolTip="新增" Icon="Add" runat="server" OnClick="btnNewDetail_Click"
Hidden="true">
</f:Button>
<f:Button ID="btnImport" ToolTip="导入" Icon="PageExcel" Hidden="true" runat="server"
<f:Button ID="btnImport" ToolTip="导入" Icon="ApplicationGet" Hidden="true" runat="server"
OnClick="btnImport_Click">
</f:Button>
<f:Button ID="Button1" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"

View File

@ -67,10 +67,10 @@
</f:FormRow>
<f:FormRow>
<Items>
<f:Label ID="lblBottom" runat="server" Text="说明1、导入模板为.xls后缀的EXCEL文件黑体字为必填项;
<f:Label ID="Label1" runat="server" Text="说明1、导入模板为.xls后缀的EXCEL文件黄色背景为必填项;
2、对于导入信息中重复记录自动过滤插入一条记录
3、题型为单选题、多选题、判断题,多岗位时用,隔开,多选答案时用,隔开
4、适合岗位空时为通用试题
3、题型为单选题、多选题、判断题
4、适合岗位空时为通用试题,多岗位时用,隔开,多选答案时用,隔开
5、数据导入完成成功后自动返回如果有不成功数据页面弹出提示框列表显示导入成功数据。">
</f:Label>
</Items>

View File

@ -123,13 +123,13 @@ namespace FineUIPro.Web.HSSE.EduTrain
protected global::FineUIPro.HiddenField hdCheckResult;
/// <summary>
/// lblBottom 控件。
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lblBottom;
protected global::FineUIPro.Label Label1;
/// <summary>
/// Window1 控件。

View File

@ -1,5 +1,7 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrainTestRecord.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.TrainTestRecord" %>
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
@ -13,25 +15,35 @@
background-color: red;
}
.LabelColor
{
.LabelColor {
color: Red;
font-size:small;
font-size: small;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<f:Panel ID="Panel1" 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="TrainingTestRecordId" EnableColumnLines="true" DataIDField="TrainingTestRecordId" AllowSorting="true"
SortField="DateA" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true" ForceFit="true"
IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True"
>
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
<Items>
@ -45,8 +57,7 @@
EnableEdit="true" Label="至" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
</f:DatePicker>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server"
>
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server">
</f:Button>
<f:Button ID="btnOut" OnClick="btnMenuOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
@ -63,21 +74,18 @@
<f:RenderField Width="110px" ColumnID="TrainingName" DataField="TrainingName" FieldType="String"
HeaderText="考试名称" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:TemplateField ColumnID="UnitId" Width="200px" HeaderText="单位" HeaderTextAlign="Center" TextAlign="Left"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# ConvertUnit(Eval("UnitId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="145px" ColumnID="DateA" DataField="DateA" FieldType="String"
HeaderText="考试开始时间" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="145px" ColumnID="DateZ" DataField="DateZ" FieldType="String"
HeaderText="考试结束时间" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:TemplateField ColumnID="TrainingType" Width="200px" HeaderText="培训类型" HeaderTextAlign="Center" TextAlign="Left"
EnableLock="true" Locked="False">
<ItemTemplate>
@ -87,7 +95,6 @@
<f:RenderField Width="70px" ColumnID="PeopleNum" DataField="PeopleNum" FieldType="String"
HeaderText="人数" HeaderTextAlign="Center" TextAlign="Right">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
@ -104,6 +111,8 @@
</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" OnClose="Window1_Close"
Width="800px" Height="350px">
@ -119,8 +128,7 @@
runat="server" Text="归档" Icon="FolderPage">
</f:MenuButton>--%>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
Icon="Delete" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除"
>
Icon="Delete" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
</f:MenuButton>
</f:Menu>
</form>

View File

@ -11,6 +11,22 @@ namespace FineUIPro.Web.HSSE.EduTrain
{
public partial class TrainTestRecord : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@ -22,6 +38,21 @@ namespace FineUIPro.Web.HSSE.EduTrain
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
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();
}
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
this.btnMenuDelete.Hidden = false;
@ -40,6 +71,22 @@ 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;
}
}
#endregion
#region
@ -48,23 +95,22 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// </summary>
private void BindGrid()
{
string strSql = @"select TrainingTestRecordId,
TrainingName,
UnitId,
DateA,
DateZ,
TrainingType,
PeopleNum
from Training_TrainTestRecord where ProjectId = '" + this.CurrUser.LoginProjectId+"' ";
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
List<SqlParameter> listStr = new List<SqlParameter>();
string strSql = @"SELECT TrainingTestRecordId,TrainingName,UnitId,DateA,DateZ,TrainingType,PeopleNum
FROM Training_TrainTestRecord AS TestRecord
WHERE 1=1 ";
strSql += " AND ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
{
strSql += " AND TrainingName LIKE @name ";
listStr.Add(new SqlParameter("@name", "%" + this.txtName.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtStartDate.Text))
{
strSql += " AND TestRecord.TestStartTime >= @StartDate";

View File

@ -41,6 +41,42 @@ namespace FineUIPro.Web.HSSE.EduTrain
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <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 控件。
/// </summary>

View File

@ -1,5 +1,7 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BonusScoreSelfManagement.aspx.cs" Inherits="FineUIPro.Web.HSSE.Examine.BonusScoreSelfManagement" %>
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
@ -17,8 +19,20 @@
<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:Panel ID="Panel1" 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" EnableColumnLines="true" DataKeyNames="Id"
@ -125,6 +139,8 @@
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="自主管理加分项" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="true" runat="server" IsModal="true" Width="1024px"
Height="500px">

View File

@ -43,8 +43,16 @@ namespace FineUIPro.Web.HSSE.Examine
}
BonusScoreTypeService.InitBonusScoreTypeDropDownList(this.drpBonusScoreType, true);
////权限按钮方法
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
this.GetButtonPower();
}
this.btnNew.OnClientClick = Window1.GetShowReference("BonusScoreSelfManagementEdit.aspx") + "return false;";
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
{
@ -56,6 +64,22 @@ namespace FineUIPro.Web.HSSE.Examine
}
}
/// <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>
@ -229,6 +253,10 @@ namespace FineUIPro.Web.HSSE.Examine
/// <returns></returns>
private void GetButtonPower()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
if (Request.Params["value"] == "0")
{
return;

View File

@ -41,6 +41,42 @@ namespace FineUIPro.Web.HSSE.Examine
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <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 控件。
/// </summary>

View File

@ -1,7 +1,8 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BonusScoreSituation.aspx.cs" Inherits="FineUIPro.Web.HSSE.Examine.BonusScoreSituation" %>
<!DOCTYPE html>
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@ -17,8 +18,20 @@
<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:Panel ID="Panel1" 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" EnableColumnLines="true" DataKeyNames="Id"
@ -133,6 +146,8 @@
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="考核加分情况" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="true" runat="server" IsModal="true" Width="1024px"
Height="500px">

View File

@ -9,9 +9,9 @@ namespace FineUIPro.Web.HSSE.Examine
{
public partial class BonusScoreSituation : PageBase
{
#region
#region
/// <summary>
/// 主键
/// 项目主键
/// </summary>
public string ProjectId
{
@ -42,8 +42,15 @@ namespace FineUIPro.Web.HSSE.Examine
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();
}
this.btnNew.OnClientClick = Window1.GetShowReference("BonusScoreSituationEdit.aspx") + "return false;";
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
{
@ -55,6 +62,23 @@ namespace FineUIPro.Web.HSSE.Examine
}
}
/// <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>
@ -228,6 +252,10 @@ namespace FineUIPro.Web.HSSE.Examine
/// <returns></returns>
private void GetButtonPower()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
if (Request.Params["value"] == "0")
{
return;

View File

@ -41,6 +41,42 @@ namespace FineUIPro.Web.HSSE.Examine
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <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 控件。
/// </summary>

View File

@ -1,5 +1,7 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MinusScoreSituation.aspx.cs" Inherits="FineUIPro.Web.HSSE.Examine.MinusScoreSituation" %>
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
@ -17,8 +19,20 @@
<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:Panel ID="Panel1" 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" EnableColumnLines="true" DataKeyNames="Id"
@ -134,6 +148,8 @@
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="考核扣分情况" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="true" runat="server" IsModal="true" Width="1024px"
Height="500px">

View File

@ -42,8 +42,15 @@ namespace FineUIPro.Web.HSSE.Examine
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();
}
this.btnNew.OnClientClick = Window1.GetShowReference("MinusScoreSituationEdit.aspx") + "return false;";
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
{
@ -55,6 +62,21 @@ namespace FineUIPro.Web.HSSE.Examine
}
}
/// <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>
@ -228,6 +250,10 @@ namespace FineUIPro.Web.HSSE.Examine
/// <returns></returns>
private void GetButtonPower()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
if (Request.Params["value"] == "0")
{
return;

View File

@ -41,6 +41,42 @@ namespace FineUIPro.Web.HSSE.Examine
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <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 控件。
/// </summary>

View File

@ -1,7 +1,8 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OnePersonPerFile.aspx.cs" Inherits="FineUIPro.Web.HSSE.Examine.OnePersonPerFile" %>
<!DOCTYPE html>
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>员工HSE信息档案</title>
@ -22,6 +23,16 @@
<f:Panel ID="Panel1" 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="Left" RegionSplit="true"
EnableCollapse="true" Width="250" Title="员工HSE信息档案" TitleToolTip="员工HSE信息档案" ShowBorder="true"
ShowHeader="false" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft" Layout="Fit">
<Items>
@ -30,7 +41,7 @@
</f:Tree>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" Layout="Fit" IFrameUrl="" EnableIFrame="True"
<f:Panel runat="server" ID="panelRightRegion" RegionPosition="Center" Layout="Fit" IFrameUrl="" EnableIFrame="True"
Title="右侧面板" ShowBorder="False" ShowHeader="false" BodyPadding="10px" IconFont="_RoundPlus">
</f:Panel>

View File

@ -98,18 +98,37 @@ namespace FineUIPro.Web.HSSE.Examine
{
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.InitTreeMenu();
}
}
/// <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.InitTreeMenu();
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
panelCenterRegion.IFrameUrl = $"./StaffHSEInfoArchivesOld.aspx?UserId={this.UserId}&&PersonId={this.PersonId}";
panelRightRegion.IFrameUrl = $"./StaffHSEInfoArchivesOld.aspx?UserId={this.UserId}&&PersonId={this.PersonId}";
}
#endregion

View File

@ -51,13 +51,22 @@ namespace FineUIPro.Web.HSSE.Examine
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// tvProjectAndUnitAndPerson 控件。
/// ContentPanel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tree tvProjectAndUnitAndPerson;
protected global::FineUIPro.ContentPanel ContentPanel1;
/// <summary>
/// ucTree 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree;
/// <summary>
/// panelCenterRegion 控件。
@ -67,5 +76,23 @@ namespace FineUIPro.Web.HSSE.Examine
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// tvProjectAndUnitAndPerson 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tree tvProjectAndUnitAndPerson;
/// <summary>
/// panelRightRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelRightRegion;
}
}

View File

@ -1,6 +1,8 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TeamGroup.aspx.cs" Inherits="FineUIPro.Web.ProjectData.TeamGroup" %>
<!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" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>班组信息</title>
@ -9,8 +11,20 @@
<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:Panel ID="Panel1" 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" EnableColumnLines="true" DataKeyNames="TeamGroupId"
@ -88,6 +102,8 @@
</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" OnClose="Window1_Close" IsModal="true"
Width="800px" Height="370px">

View File

@ -11,6 +11,22 @@ namespace FineUIPro.Web.ProjectData
{
public partial class TeamGroup : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@ -21,9 +37,22 @@ namespace FineUIPro.Web.ProjectData
{
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
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();
Funs.DropDownPageSize(this.ddlPageSize);
}
this.btnNew.OnClientClick = Window1.GetShowReference("TeamGroupEdit.aspx") + "return false;";
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
{
@ -35,29 +64,51 @@ namespace FineUIPro.Web.ProjectData
}
}
/// <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 TeamGroupId,ProjectId,UnitId,TeamGroupCode,TeamGroupName,Remark,TeamTypeId,GroupLeaderId FROM ProjectData_TeamGroup WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值
{
//if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值
//{
// strSql += " AND ProjectId = @ProjectId";
// listStr.Add(new SqlParameter("@ProjectId", Request.Params["projectId"]));
//}
//else
//{
// strSql += " AND ProjectId = @ProjectId";
// listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
//}
strSql += " AND ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", Request.Params["projectId"]));
}
else
{
strSql += " AND ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
}
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (!string.IsNullOrEmpty(this.txtTeamGroupName.Text.Trim()))
{
strSql += " AND TeamGroupName LIKE @TeamGroupName";
listStr.Add(new SqlParameter("@TeamGroupName", "%" + this.txtTeamGroupName.Text.Trim() + "%"));
}
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId))
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
{
strSql += " AND UnitId =@unitId";
listStr.Add(new SqlParameter("@unitId", this.CurrUser.UnitId));
@ -293,11 +344,15 @@ namespace FineUIPro.Web.ProjectData
/// <returns></returns>
private void GetButtonPower()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
if (Request.Params["value"] == "0") ///文件柜时 没有操作权限
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.TeamGroupMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.TeamGroupMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))

View File

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.ProjectData {
namespace FineUIPro.Web.ProjectData
{
public partial class TeamGroup {
public partial class TeamGroup
{
/// <summary>
/// form1 控件。
@ -39,6 +41,42 @@ namespace FineUIPro.Web.ProjectData {
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <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 控件。
/// </summary>