1试题导入优化
This commit is contained in:
parent
53230dc06f
commit
f9d9e124b6
|
|
@ -5,105 +5,78 @@
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head runat="server">
|
<head runat="server">
|
||||||
<title>导入考试试题</title>
|
<title>导入考试试题</title>
|
||||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form id="form1" runat="server">
|
<form id="form1" runat="server">
|
||||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
|
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
|
||||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||||
<Toolbars>
|
<Toolbars>
|
||||||
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
|
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
|
||||||
<Items>
|
<Items>
|
||||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
<f:Button ID="btnAudit" Icon="ApplicationEdit" runat="server" ToolTip="审核" ValidateForms="SimpleForm1"
|
||||||
<f:Button ID="btnAudit" Icon="ApplicationEdit" runat="server" ToolTip="数据导入" ValidateForms="SimpleForm1"
|
OnClick="btnAudit_Click">
|
||||||
OnClick="btnAudit_Click">
|
</f:Button>
|
||||||
</f:Button>
|
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1"
|
||||||
<f:Button ID="btnDownLoad" runat="server" Icon="ApplicationGo" ToolTip="下载模板" OnClick="btnDownLoad_Click">
|
OnClick="btnSave_Click">
|
||||||
</f:Button>
|
</f:Button>
|
||||||
</Items>
|
<f:Button ID="btnDownLoad" runat="server" Icon="ApplicationGo" ToolTip="下载模板" OnClick="btnDownLoad_Click">
|
||||||
</f:Toolbar>
|
</f:Button>
|
||||||
</Toolbars>
|
</Items>
|
||||||
<Rows>
|
</f:Toolbar>
|
||||||
<f:FormRow>
|
</Toolbars>
|
||||||
<Items>
|
<Rows>
|
||||||
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
|
<f:FormRow>
|
||||||
LabelWidth="150px">
|
<Items>
|
||||||
</f:FileUpload>
|
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
|
||||||
</Items>
|
LabelWidth="150px">
|
||||||
</f:FormRow>
|
</f:FileUpload>
|
||||||
<f:FormRow>
|
</Items>
|
||||||
<Items>
|
</f:FormRow>
|
||||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
|
<f:FormRow>
|
||||||
EnableColumnLines="true" BoxFlex="1" DataKeyNames="TrainingItemId" ForceFit="true"
|
<Items>
|
||||||
DataIDField="TrainingItemId" AllowSorting="true" SortField="TrainingCode,TrainingItemCode"
|
<f:Grid ID="gvErrorInfo" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="导入试题信息" EnableCollapse="true"
|
||||||
PageSize="50" Height="360px">
|
runat="server" BoxFlex="1" AllowCellEditing="true" ClicksToEdit="2" AllowSorting="true"
|
||||||
<Columns>
|
SortDirection="DESC" EnableColumnLines="true" ForceFit="true" AllowPaging="false" IsDatabasePaging="false" PageSize="10"
|
||||||
<f:TemplateField Width="55px" HeaderText="序号">
|
EnableRowDoubleClickEvent="true" AllowFilters="true" EnableTextSelection="True" Height="400">
|
||||||
<ItemTemplate>
|
<Columns>
|
||||||
<asp:Label ID="Label2" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
|
<f:TemplateField ColumnID="tfPageIndex" Width="40px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
|
||||||
</ItemTemplate>
|
EnableLock="true" Locked="False">
|
||||||
</f:TemplateField>
|
<ItemTemplate>
|
||||||
<f:RenderField Width="90px" ColumnID="TrainingCode" DataField="TrainingCode" FieldType="String"
|
<asp:Label ID="lblPageIndex" runat="server" Text='<%# gvErrorInfo.PageIndex * gvErrorInfo.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||||
HeaderText="类型编号" HeaderTextAlign="Center" TextAlign="Left">
|
</ItemTemplate>
|
||||||
</f:RenderField>
|
</f:TemplateField>
|
||||||
<f:RenderField Width="110px" ColumnID="TrainingName" DataField="TrainingName" FieldType="String"
|
<f:BoundField DataField="Row" HeaderText="错误行号" Width="50px">
|
||||||
HeaderText="试题类型" HeaderTextAlign="Center" TextAlign="Left">
|
</f:BoundField>
|
||||||
</f:RenderField>
|
<f:BoundField DataField="Column" HeaderText="错误列" Width="100px">
|
||||||
<f:RenderField Width="80px" ColumnID="TrainingItemCode" DataField="TrainingItemCode" FieldType="String"
|
</f:BoundField>
|
||||||
HeaderText="编号" HeaderTextAlign="Center" TextAlign="Left">
|
<f:BoundField DataField="Reason" HeaderText="错误类型" MinWidth="220px">
|
||||||
</f:RenderField>
|
</f:BoundField>
|
||||||
<f:RenderField Width="90px" ColumnID="TestTypeName" DataField="TestTypeName" FieldType="String"
|
</Columns>
|
||||||
HeaderText="题型" HeaderTextAlign="Center" TextAlign="Left">
|
</f:Grid>
|
||||||
</f:RenderField>
|
</Items>
|
||||||
<f:RenderField Width="140px" ColumnID="WorkPostNames" DataField="WorkPostNames" FieldType="String"
|
</f:FormRow>
|
||||||
HeaderText="适合岗位" HeaderTextAlign="Center" TextAlign="Left">
|
<f:FormRow>
|
||||||
</f:RenderField>
|
<Items>
|
||||||
<f:RenderField Width="200px" ColumnID="Abstracts" DataField="Abstracts" FieldType="String"
|
<f:HiddenField ID="hdFileName" runat="server">
|
||||||
HeaderText="试题内容" HeaderTextAlign="Center" TextAlign="Left">
|
</f:HiddenField>
|
||||||
</f:RenderField>
|
<f:HiddenField ID="hdCheckResult" runat="server">
|
||||||
<f:RenderField Width="80px" ColumnID="AItem" DataField="AItem" FieldType="String"
|
</f:HiddenField>
|
||||||
HeaderText="答案项A" HeaderTextAlign="Center" TextAlign="Left">
|
</Items>
|
||||||
</f:RenderField>
|
</f:FormRow>
|
||||||
<f:RenderField Width="80px" ColumnID="BItem" DataField="BItem" FieldType="String"
|
<f:FormRow>
|
||||||
HeaderText="答案项B" HeaderTextAlign="Center" TextAlign="Left">
|
<Items>
|
||||||
</f:RenderField>
|
<f:Label ID="lblBottom" runat="server" Text="说明:1 导入模板为.xls后缀的EXCEL文件,黑体字为必填项。2 对于导入信息中重复记录自动过滤插入一条记录。3 题型为单选题、多选题、判断题,多岗位时用,隔开。4 适合岗位空时为通用试题。 5 数据导入完成,成功后自动返回,如果有不成功数据页面弹出提示框,列表显示导入成功数据。">
|
||||||
<f:RenderField Width="80px" ColumnID="CItem" DataField="CItem" FieldType="String"
|
</f:Label>
|
||||||
HeaderText="答案项C" HeaderTextAlign="Center" TextAlign="Left">
|
</Items>
|
||||||
</f:RenderField>
|
</f:FormRow>
|
||||||
<f:RenderField Width="80px" ColumnID="DItem" DataField="DItem" FieldType="String"
|
</Rows>
|
||||||
HeaderText="答案项D" HeaderTextAlign="Center" TextAlign="Left">
|
</f:Form>
|
||||||
</f:RenderField>
|
<f:Window ID="Window1" Title="导入信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||||
<f:RenderField Width="80px" ColumnID="EItem" DataField="EItem" FieldType="String"
|
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="false"
|
||||||
HeaderText="答案项E" HeaderTextAlign="Center" TextAlign="Left">
|
CloseAction="HidePostBack" Width="900px" Height="600px">
|
||||||
</f:RenderField>
|
</f:Window>
|
||||||
<f:RenderField Width="90px" ColumnID="AnswerItems" DataField="AnswerItems" FieldType="String"
|
|
||||||
HeaderText="正确答案项" HeaderTextAlign="Center" TextAlign="Left">
|
|
||||||
</f:RenderField>
|
|
||||||
</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>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using BLL;
|
using BLL;
|
||||||
|
using Model;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
|
@ -24,7 +25,8 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 错误集合
|
/// 错误集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string errorInfos = string.Empty;
|
public static List<Model.ErrorInfo> errorInfos = new List<Model.ErrorInfo>();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 加载页面
|
#region 加载页面
|
||||||
|
|
@ -43,7 +45,10 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
{
|
{
|
||||||
viewTrainingItems.Clear();
|
viewTrainingItems.Clear();
|
||||||
}
|
}
|
||||||
errorInfos = string.Empty;
|
if (errorInfos != null)
|
||||||
|
{
|
||||||
|
errorInfos.Clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
@ -73,9 +78,9 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
{
|
{
|
||||||
viewTrainingItems.Clear();
|
viewTrainingItems.Clear();
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(errorInfos))
|
if (errorInfos != null)
|
||||||
{
|
{
|
||||||
errorInfos = string.Empty;
|
errorInfos.Clear();
|
||||||
}
|
}
|
||||||
string rootPath = Server.MapPath("~/");
|
string rootPath = Server.MapPath("~/");
|
||||||
string initFullPath = rootPath + initPath;
|
string initFullPath = rootPath + initPath;
|
||||||
|
|
@ -176,7 +181,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
string col1 = pds.Rows[i][1].ToString().Trim();
|
string col1 = pds.Rows[i][1].ToString().Trim();
|
||||||
if (string.IsNullOrEmpty(col1))
|
if (string.IsNullOrEmpty(col1))
|
||||||
{
|
{
|
||||||
result += "第" + (i + 2).ToString() + "行," + "导入试题类型" + "," + "此项为必填项!" + "|";
|
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "试题类型", Reason = "此项为必填项!" });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -200,11 +205,10 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
string col3 = pds.Rows[i][3].ToString().Trim();
|
string col3 = pds.Rows[i][3].ToString().Trim();
|
||||||
if (string.IsNullOrEmpty(col3))
|
if (string.IsNullOrEmpty(col3))
|
||||||
{
|
{
|
||||||
result += "第" + (i + 2).ToString() + "行," + "导入试题题型" + "," + "此项为必填项!" + "|";
|
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "试题题型", Reason = "此项为必填项!" });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (col3 == "单选题")
|
if (col3 == "单选题")
|
||||||
{
|
{
|
||||||
newViewTrainingItem.TestType = "1";
|
newViewTrainingItem.TestType = "1";
|
||||||
|
|
@ -250,14 +254,15 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
string ids = string.Empty;
|
string ids = string.Empty;
|
||||||
foreach (var item in WorkPostSels)
|
foreach (var item in WorkPostSels)
|
||||||
{
|
{
|
||||||
var wp = workPosts.FirstOrDefault(x => x.WorkPostName == item);
|
string workItem = item.Trim();
|
||||||
|
var wp = workPosts.FirstOrDefault(x => x.WorkPostName == workItem);
|
||||||
if (wp != null)
|
if (wp != null)
|
||||||
{
|
{
|
||||||
ids += wp.WorkPostId + ",";
|
ids += wp.WorkPostId + ",";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result += "第" + (i + 2).ToString() + "行," + "导入适合岗位" + item + "," + "此项基础表不存在!" + "|";
|
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "适合岗位", Reason = $"[{workItem}]不在岗位表中!" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(ids))
|
if (!string.IsNullOrEmpty(ids))
|
||||||
|
|
@ -272,7 +277,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
string col11 = pds.Rows[i][11].ToString().Trim();
|
string col11 = pds.Rows[i][11].ToString().Trim();
|
||||||
if (string.IsNullOrEmpty(col11))
|
if (string.IsNullOrEmpty(col11))
|
||||||
{
|
{
|
||||||
result += "第" + (i + 2).ToString() + "行," + "导入正确答案项" + "," + "为必填项!" + "|";
|
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "正确答案项", Reason = "此项为必填项!" });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -291,14 +296,14 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result += "第" + (i + 2).ToString() + "行," + "正确答案项只能输入ABCDE且用','隔开!" + "|";
|
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "正确答案项", Reason = "只能输入ABCDE且用','隔开!" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////试题内容
|
////试题内容
|
||||||
if (string.IsNullOrEmpty(newViewTrainingItem.Abstracts))
|
if (string.IsNullOrEmpty(newViewTrainingItem.Abstracts))
|
||||||
{
|
{
|
||||||
result += "第" + (i + 2).ToString() + "行," + "导入试题内容" + "," + "为必填项!" + "|";
|
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "试题内容", Reason = "此项为必填项!" });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -308,7 +313,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
{
|
{
|
||||||
Model.Training_TestTrainingItem newTrainingItem = new Model.Training_TestTrainingItem
|
Model.Training_TestTrainingItem newTrainingItem = new Model.Training_TestTrainingItem
|
||||||
{
|
{
|
||||||
TrainingItemId = newViewTrainingItem.TrainingItemId = SQLHelper.GetNewID(typeof(Model.Training_TestTraining)),
|
TrainingItemId = newViewTrainingItem.TrainingItemId = SQLHelper.GetNewID(typeof(Model.Training_TestTrainingItem)),
|
||||||
TrainingId = newViewTrainingItem.TrainingId,
|
TrainingId = newViewTrainingItem.TrainingId,
|
||||||
TrainingItemCode = newViewTrainingItem.TrainingItemCode,
|
TrainingItemCode = newViewTrainingItem.TrainingItemCode,
|
||||||
TrainingItemName = newViewTrainingItem.TrainingItemName,
|
TrainingItemName = newViewTrainingItem.TrainingItemName,
|
||||||
|
|
@ -336,41 +341,32 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
newTrainingItem.Abstracts = newViewTrainingItem.Abstracts + "( )";
|
newTrainingItem.Abstracts = newViewTrainingItem.Abstracts + "( )";
|
||||||
}
|
}
|
||||||
|
|
||||||
BLL.TestTrainingItemService.AddTestTrainingItem(newTrainingItem);
|
|
||||||
///加入培训试题库
|
///加入培训试题库
|
||||||
viewTrainingItems.Add(newViewTrainingItem);
|
viewTrainingItems.Add(newViewTrainingItem);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result += "第" + (i + 2).ToString() + "行," + "导入试题重复" + "|";
|
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "试题内容", Reason = "试题重复!" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (viewTrainingItems.Count > 0)
|
if (errorInfos.Any())
|
||||||
{
|
|
||||||
viewTrainingItems = viewTrainingItems.Distinct().ToList();
|
|
||||||
this.Grid1.Hidden = false;
|
|
||||||
this.Grid1.DataSource = viewTrainingItems;
|
|
||||||
this.Grid1.DataBind();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(result))
|
|
||||||
{
|
{
|
||||||
viewTrainingItems.Clear();
|
viewTrainingItems.Clear();
|
||||||
result = "数据导入完成,未成功数据:" + result.Substring(0, result.LastIndexOf("|"));
|
this.gvErrorInfo.DataSource = errorInfos;
|
||||||
errorInfos = result;
|
this.gvErrorInfo.DataBind();
|
||||||
Alert alert = new Alert
|
|
||||||
{
|
|
||||||
Message = result,
|
|
||||||
Target = Target.Self
|
|
||||||
};
|
|
||||||
alert.Show();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
errorInfos = string.Empty;
|
errorInfos.Clear();
|
||||||
ShowNotify("导入成功!", MessageBoxIcon.Success);
|
if (!viewTrainingItems.Any())
|
||||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
{
|
||||||
|
Alert.ShowInTop("导入数据为空!", MessageBoxIcon.Warning);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -381,6 +377,55 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#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_TestTrainingItem newModel = new Model.Training_TestTrainingItem
|
||||||
|
{
|
||||||
|
TrainingItemId = viewTrainingItems[i].TrainingItemId,
|
||||||
|
TrainingId = viewTrainingItems[i].TrainingId,
|
||||||
|
TrainingItemCode = viewTrainingItems[i].TrainingItemCode,
|
||||||
|
TestType = viewTrainingItems[i].TestType,
|
||||||
|
Abstracts = viewTrainingItems[i].Abstracts,
|
||||||
|
WorkPostIds = viewTrainingItems[i].WorkPostIds,
|
||||||
|
WorkPostNames = viewTrainingItems[i].WorkPostNames,
|
||||||
|
AItem = viewTrainingItems[i].AItem,
|
||||||
|
BItem = viewTrainingItems[i].BItem,
|
||||||
|
CItem = viewTrainingItems[i].CItem,
|
||||||
|
DItem = viewTrainingItems[i].DItem,
|
||||||
|
EItem = viewTrainingItems[i].EItem,
|
||||||
|
AnswerItems = viewTrainingItems[i].AnswerItems
|
||||||
|
};
|
||||||
|
BLL.TestTrainingItemService.AddTestTrainingItem(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 关闭弹出窗口
|
#region 关闭弹出窗口
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -396,9 +441,9 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
}
|
}
|
||||||
if (viewTrainingItems.Count > 0)
|
if (viewTrainingItems.Count > 0)
|
||||||
{
|
{
|
||||||
this.Grid1.Hidden = false;
|
this.gvErrorInfo.Hidden = false;
|
||||||
this.Grid1.DataSource = viewTrainingItems;
|
this.gvErrorInfo.DataSource = viewTrainingItems;
|
||||||
this.Grid1.DataBind();
|
this.gvErrorInfo.DataBind();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,13 @@
|
||||||
// </自动生成>
|
// </自动生成>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace FineUIPro.Web.HSSE.EduTrain {
|
namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
|
{
|
||||||
|
|
||||||
public partial class TestTrainingItemIn {
|
|
||||||
|
public partial class TestTrainingItemIn
|
||||||
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// form1 控件。
|
/// form1 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// PageManager1 控件。
|
/// PageManager1 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.PageManager PageManager1;
|
protected global::FineUIPro.PageManager PageManager1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// SimpleForm1 控件。
|
/// SimpleForm1 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Form SimpleForm1;
|
protected global::FineUIPro.Form SimpleForm1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Toolbar2 控件。
|
/// Toolbar2 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -47,16 +49,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Toolbar Toolbar2;
|
protected global::FineUIPro.Toolbar Toolbar2;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ToolbarFill1 控件。
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// 自动生成的字段。
|
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|
||||||
/// </remarks>
|
|
||||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// btnAudit 控件。
|
/// btnAudit 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -65,7 +58,16 @@ namespace FineUIPro.Web.HSSE.EduTrain {
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Button btnAudit;
|
protected global::FineUIPro.Button btnAudit;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnSave 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Button btnSave;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// btnDownLoad 控件。
|
/// btnDownLoad 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -74,7 +76,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Button btnDownLoad;
|
protected global::FineUIPro.Button btnDownLoad;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// fuAttachUrl 控件。
|
/// fuAttachUrl 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -83,25 +85,25 @@ namespace FineUIPro.Web.HSSE.EduTrain {
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.FileUpload fuAttachUrl;
|
protected global::FineUIPro.FileUpload fuAttachUrl;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Grid1 控件。
|
/// gvErrorInfo 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Grid Grid1;
|
protected global::FineUIPro.Grid gvErrorInfo;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Label2 控件。
|
/// lblPageIndex 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.Label Label2;
|
protected global::System.Web.UI.WebControls.Label lblPageIndex;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// hdFileName 控件。
|
/// hdFileName 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -110,7 +112,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.HiddenField hdFileName;
|
protected global::FineUIPro.HiddenField hdFileName;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// hdCheckResult 控件。
|
/// hdCheckResult 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -119,7 +121,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.HiddenField hdCheckResult;
|
protected global::FineUIPro.HiddenField hdCheckResult;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// lblBottom 控件。
|
/// lblBottom 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -128,7 +130,7 @@ namespace FineUIPro.Web.HSSE.EduTrain {
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Label lblBottom;
|
protected global::FineUIPro.Label lblBottom;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Window1 控件。
|
/// Window1 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue