培训类型
This commit is contained in:
@@ -1511,3 +1511,21 @@ IP地址:::1
|
||||
|
||||
出错时间:05/25/2023 07:44:21
|
||||
|
||||
|
||||
错误信息开始=====>
|
||||
错误类型:NullReferenceException
|
||||
错误信息:未将对象引用设置到对象的实例。
|
||||
错误堆栈:
|
||||
在 FineUIPro.Web.HSSE.EduTrain.TestTraining.GetButtonPower() 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\EduTrain\TestTraining.aspx.cs:行号 345
|
||||
在 FineUIPro.Web.HSSE.EduTrain.TestTraining.Page_Load(Object sender, EventArgs e) 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\EduTrain\TestTraining.aspx.cs:行号 22
|
||||
在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
|
||||
在 System.EventHandler.Invoke(Object sender, EventArgs e)
|
||||
在 System.Web.UI.Control.OnLoad(EventArgs e)
|
||||
在 System.Web.UI.Control.LoadRecursive()
|
||||
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
|
||||
出错时间:05/25/2023 16:49:49
|
||||
出错文件:http://localhost:1295/HSSE/EduTrain/TestTraining.aspx
|
||||
IP地址:::1
|
||||
|
||||
出错时间:05/25/2023 16:49:49
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
public partial class TestTrainingItemIn : PageBase
|
||||
{
|
||||
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 上传预设的虚拟路径
|
||||
@@ -162,16 +161,15 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
var trainings = from x in Funs.DB.Training_TestTraining select x;
|
||||
///岗位
|
||||
var workPosts = from x in Funs.DB.Base_WorkPost select x;
|
||||
var departs = from x in Funs.DB.Base_Depart select x;
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
Model.View_Training_TestTrainingItem newViewTrainingItem = new Model.View_Training_TestTrainingItem
|
||||
{
|
||||
TrainingCode = pds.Rows[i][0].ToString().Trim(),
|
||||
TrainingItemCode = pds.Rows[i][2].ToString().Trim(),
|
||||
Abstracts = pds.Rows[i][6].ToString().Trim(),
|
||||
AItem = pds.Rows[i][7].ToString().Trim(),
|
||||
BItem = pds.Rows[i][8].ToString().Trim(),
|
||||
Abstracts = pds.Rows[i][5].ToString().Trim(),
|
||||
AItem = pds.Rows[i][6].ToString().Trim(),
|
||||
BItem = pds.Rows[i][7].ToString().Trim(),
|
||||
};
|
||||
|
||||
////试题类型
|
||||
@@ -211,8 +209,8 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
newViewTrainingItem.TestType = "1";
|
||||
//newViewTrainingItem.Score = SValue;
|
||||
newViewTrainingItem.CItem = pds.Rows[i][9].ToString().Trim();
|
||||
newViewTrainingItem.DItem = pds.Rows[i][10].ToString().Trim();
|
||||
newViewTrainingItem.CItem = pds.Rows[i][8].ToString().Trim();
|
||||
newViewTrainingItem.DItem = pds.Rows[i][9].ToString().Trim();
|
||||
//if (string.IsNullOrEmpty(newViewTrainingItem.AItem) || string.IsNullOrEmpty(newViewTrainingItem.BItem) || string.IsNullOrEmpty(newViewTrainingItem.CItem) || string.IsNullOrEmpty(newViewTrainingItem.DItem))
|
||||
//{
|
||||
// result += "第" + (i + 2).ToString() + "行," + "单选题ABCD都不能为空!" + "|";
|
||||
@@ -223,9 +221,9 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
newViewTrainingItem.TestType = "2";
|
||||
//newViewTrainingItem.Score = MValue;
|
||||
newViewTrainingItem.CItem = pds.Rows[i][9].ToString().Trim();
|
||||
newViewTrainingItem.DItem = pds.Rows[i][10].ToString().Trim();
|
||||
newViewTrainingItem.EItem = pds.Rows[i][11].ToString().Trim();
|
||||
newViewTrainingItem.CItem = pds.Rows[i][8].ToString().Trim();
|
||||
newViewTrainingItem.DItem = pds.Rows[i][9].ToString().Trim();
|
||||
newViewTrainingItem.EItem = pds.Rows[i][10].ToString().Trim();
|
||||
//if (string.IsNullOrEmpty(newViewTrainingItem.AItem) || string.IsNullOrEmpty(newViewTrainingItem.BItem) || string.IsNullOrEmpty(newViewTrainingItem.CItem) || string.IsNullOrEmpty(newViewTrainingItem.DItem))
|
||||
//{
|
||||
// result += "第" + (i + 2).ToString() + "行," + "多选题ABCD都不能为空!" + "|";
|
||||
@@ -268,46 +266,18 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
newViewTrainingItem.WorkPostIds = ids.Substring(0, ids.LastIndexOf(","));
|
||||
}
|
||||
}
|
||||
} ////适合部门
|
||||
string col5 = pds.Rows[i][5].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(col5))
|
||||
{
|
||||
|
||||
List<string> DepartSels = Funs.GetStrListByStr(col5, ',');
|
||||
if (DepartSels.Count() > 0)
|
||||
{
|
||||
string ids = string.Empty;
|
||||
foreach (var item in DepartSels)
|
||||
{
|
||||
var wp = departs.FirstOrDefault(x => x.DepartName == item);
|
||||
if (wp != null)
|
||||
{
|
||||
ids += wp.DepartId + ",";
|
||||
}
|
||||
else
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "导入适合部门" + item + "," + "此项基础表不存在!" + "|";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(ids))
|
||||
{
|
||||
newViewTrainingItem.DepartNames = col5;
|
||||
newViewTrainingItem.DepartIds = ids.Substring(0, ids.LastIndexOf(","));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////正确答案
|
||||
string col12 = pds.Rows[i][12].ToString().Trim();
|
||||
if (string.IsNullOrEmpty(col12))
|
||||
string col11 = pds.Rows[i][11].ToString().Trim();
|
||||
if (string.IsNullOrEmpty(col11))
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "导入正确答案项" + "," + "为必填项!" + "|";
|
||||
}
|
||||
else
|
||||
{
|
||||
int icount = 0;
|
||||
List<string> selecItem = Funs.GetStrListByStr(col12, ',');
|
||||
List<string> selecItem = Funs.GetStrListByStr(col11, ',');
|
||||
foreach (var item in selecItem)
|
||||
{
|
||||
if (item != "A" && item != "a" && item != "B" && item != "b" && item != "C" && item != "c" && item != "D" && item != "d" && item != "E" && item != "e")
|
||||
@@ -317,7 +287,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
}
|
||||
if (icount == 0)
|
||||
{
|
||||
newViewTrainingItem.AnswerItems = col12.Replace("a", "A").Replace("b", "B").Replace("c", "C").Replace("d", "D").Replace("e", "E");
|
||||
newViewTrainingItem.AnswerItems = col11.Replace("a", "A").Replace("b", "B").Replace("c", "C").Replace("d", "D").Replace("e", "E");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -471,4 +441,4 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user