0509
This commit is contained in:
parent
a041fdd85d
commit
ba518ac354
|
@ -0,0 +1,6 @@
|
||||||
|
alter TABLE [dbo].[Training_CompanyTrainingItem]add
|
||||||
|
[TestTrainingIds] [nvarchar](max) NULL
|
||||||
|
|
||||||
|
|
||||||
|
alter TABLE [dbo].[Training_TestRecord]add
|
||||||
|
[CompanyTrainingItemId] [nvarchar](50) NULL
|
|
@ -658,7 +658,7 @@ namespace BLL
|
||||||
}
|
}
|
||||||
List<Model.PersonItem> getTrainPersonList = new List<Model.PersonItem>();
|
List<Model.PersonItem> getTrainPersonList = new List<Model.PersonItem>();
|
||||||
var getTrainType = TrainTypeService.GetTrainTypeById(trainTypeId);
|
var getTrainType = TrainTypeService.GetTrainTypeById(trainTypeId);
|
||||||
if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat == false))
|
if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat.Value == false))
|
||||||
{
|
{
|
||||||
int score = 80;
|
int score = 80;
|
||||||
var sysTestRule = db.Sys_TestRule.FirstOrDefault();
|
var sysTestRule = db.Sys_TestRule.FirstOrDefault();
|
||||||
|
@ -699,7 +699,7 @@ namespace BLL
|
||||||
}
|
}
|
||||||
return getTrainPersonList;
|
return getTrainPersonList;
|
||||||
}
|
}
|
||||||
else if (getTrainType != null && getTrainType.IsRepeat.HasValue && getTrainType.IsRepeat == true)//重复的 过滤人员
|
else if (getTrainType != null && getTrainType.IsRepeat.HasValue && getTrainType.IsRepeat.Value == true)//重复的 过滤人员
|
||||||
{
|
{
|
||||||
foreach (var item in getPersons)
|
foreach (var item in getPersons)
|
||||||
{
|
{
|
||||||
|
|
|
@ -263,6 +263,164 @@ namespace BLL
|
||||||
return testRecordId;
|
return testRecordId;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public static string CreateTestRecordItem(Model.Training_CompanyTrainingItem getCompanyTraining, string testRecordId, Model.SitePerson_Person person, Model.Sys_User user)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||||
|
{
|
||||||
|
var trainingIds = getCompanyTraining.TestTrainingIds.Split(',');
|
||||||
|
var testTrainings= db.Training_TestTraining.Where(x => trainingIds.Contains(x.TrainingId));
|
||||||
|
var getTestRecord = db.Training_TestRecord.FirstOrDefault(x => x.TestRecordId == testRecordId);
|
||||||
|
if (getTestRecord != null && !getTestRecord.TestStartTime.HasValue)
|
||||||
|
{
|
||||||
|
////考试时长
|
||||||
|
getTestRecord.Duration =120;
|
||||||
|
getTestRecord.TestStartTime = DateTime.Now;
|
||||||
|
db.SubmitChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
////当前人考试记录 未加入考试计划的 当考试开始扫码时 不允许再参与考试
|
||||||
|
var item = db.Training_TestRecordItem.FirstOrDefault(x => x.TestRecordId == getTestRecord.TestRecordId);
|
||||||
|
if (item == null)
|
||||||
|
{
|
||||||
|
List<Model.Training_TestTrainingItem> getTestTrainingItemList = new List<Model.Training_TestTrainingItem>();
|
||||||
|
//var testPlanTrainings = from x in db.Training_TestPlanTraining
|
||||||
|
// where x.TestPlanId == getTestPlan.TestPlanId
|
||||||
|
// select x;
|
||||||
|
//// 计划考试中单选、多选、判断题总数
|
||||||
|
var sysTestRule = Funs.DB.Sys_TestRule.FirstOrDefault();
|
||||||
|
|
||||||
|
int sumTestType1Count = 0;// testPlanTrainings.Sum(x => x.TestType1Count) ?? 0;
|
||||||
|
int sumTestType2Count = 0;//testPlanTrainings.Sum(x => x.TestType2Count) ?? 0;
|
||||||
|
int sumTestType3Count = 0;//testPlanTrainings.Sum(x => x.TestType3Count) ?? 0;
|
||||||
|
if (sysTestRule != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
sumTestType1Count = sysTestRule.SCount;
|
||||||
|
sumTestType2Count = sysTestRule.MCount;
|
||||||
|
sumTestType3Count = sysTestRule.JCount;
|
||||||
|
}
|
||||||
|
////获取类型下适合岗位试题集合
|
||||||
|
List<Model.Training_TestTrainingItem> getTestTrainingItemALLs;
|
||||||
|
string WorkPostId = "";
|
||||||
|
string DepartId = "";
|
||||||
|
if (person != null)
|
||||||
|
{
|
||||||
|
WorkPostId = person.WorkPostId;
|
||||||
|
}
|
||||||
|
if (user != null)
|
||||||
|
{
|
||||||
|
DepartId = user.DepartId;
|
||||||
|
}
|
||||||
|
|
||||||
|
getTestTrainingItemALLs = (from x in db.Training_TestTrainingItem
|
||||||
|
where x.TrainingId != null && (x.WorkPostIds == null || string.IsNullOrEmpty(WorkPostId) || x.WorkPostIds.Contains(WorkPostId)) || (x.DepartIds == null || string.IsNullOrEmpty(DepartId) || x.DepartIds.Contains(DepartId))
|
||||||
|
select x).ToList();
|
||||||
|
foreach (var itemT in testTrainings)
|
||||||
|
{
|
||||||
|
//// 获取类型下的题目
|
||||||
|
var getTestTrainingItems = getTestTrainingItemALLs.Where(x => x.TrainingId == itemT.TrainingId).ToList();
|
||||||
|
if (getTestTrainingItems.Count() > 0)
|
||||||
|
{
|
||||||
|
////单选题
|
||||||
|
var getSItem = getTestTrainingItems.Where(x => x.TestType == "1").OrderBy(x => Guid.NewGuid());
|
||||||
|
if (getSItem.Count() > 0)
|
||||||
|
{
|
||||||
|
getTestTrainingItemList.AddRange(getSItem);
|
||||||
|
}
|
||||||
|
///多选题
|
||||||
|
var getMItem = getTestTrainingItems.Where(x => x.TestType == "2").OrderBy(x => Guid.NewGuid());
|
||||||
|
if (getMItem.Count() > 0)
|
||||||
|
{
|
||||||
|
getTestTrainingItemList.AddRange(getMItem);
|
||||||
|
}
|
||||||
|
///判断题
|
||||||
|
var getJItem = getTestTrainingItems.Where(x => x.TestType == "3").OrderBy(x => Guid.NewGuid());
|
||||||
|
if (getJItem.Count() > 0)
|
||||||
|
{
|
||||||
|
getTestTrainingItemList.AddRange(getJItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//// 获取得到的单选题、多选题、判断题 数量
|
||||||
|
int getDiffTestType1Count = sumTestType1Count - getTestTrainingItemList.Where(x => x.TestType == "1").Count();
|
||||||
|
int getDiffTestType2Count = sumTestType2Count - getTestTrainingItemList.Where(x => x.TestType == "2").Count();
|
||||||
|
int getDiffTestType3Count = sumTestType3Count - getTestTrainingItemList.Where(x => x.TestType == "3").Count();
|
||||||
|
if (getDiffTestType1Count > 0 || getDiffTestType2Count > 0 || getDiffTestType3Count > 0)
|
||||||
|
{
|
||||||
|
var getTestTrainingItemNulls = getTestTrainingItemALLs.Where(x => x.WorkPostIds == null).ToList();
|
||||||
|
if (getTestTrainingItemNulls.Count() > 0)
|
||||||
|
{
|
||||||
|
/// 通用且未选择的题目
|
||||||
|
var getTestTrainingItemDiffs = getTestTrainingItemNulls.Except(getTestTrainingItemList).ToList();
|
||||||
|
////单选题
|
||||||
|
if (getDiffTestType1Count > 0)
|
||||||
|
{
|
||||||
|
var getSItemD = getTestTrainingItemDiffs.Where(x => x.TestType == "1").OrderBy(x => Guid.NewGuid()).Take(getDiffTestType1Count);
|
||||||
|
if (getSItemD.Count() > 0)
|
||||||
|
{
|
||||||
|
getTestTrainingItemList.AddRange(getSItemD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
///多选题
|
||||||
|
if (getDiffTestType2Count > 0)
|
||||||
|
{
|
||||||
|
var getMItemD = getTestTrainingItemDiffs.Where(x => x.TestType == "2").OrderBy(x => Guid.NewGuid()).Take(getDiffTestType2Count);
|
||||||
|
if (getMItemD.Count() > 0)
|
||||||
|
{
|
||||||
|
getTestTrainingItemList.AddRange(getMItemD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
///判断题
|
||||||
|
if (getDiffTestType3Count > 0)
|
||||||
|
{
|
||||||
|
var getJItemD = getTestTrainingItemDiffs.Where(x => x.TestType == "3").OrderBy(x => Guid.NewGuid()).Take(getDiffTestType3Count);
|
||||||
|
if (getJItemD.Count() > 0)
|
||||||
|
{
|
||||||
|
getTestTrainingItemList.AddRange(getJItemD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getTestTrainingItemList.Count() > 0)
|
||||||
|
{
|
||||||
|
var getItems = from x in getTestTrainingItemList
|
||||||
|
select new Model.Training_TestRecordItem
|
||||||
|
{
|
||||||
|
TestRecordItemId = SQLHelper.GetNewID(),
|
||||||
|
TestRecordId = getTestRecord.TestRecordId,
|
||||||
|
TrainingItemName = x.TrainingItemName,
|
||||||
|
TrainingItemCode = x.TrainingItemCode,
|
||||||
|
Abstracts = x.Abstracts,
|
||||||
|
AttachUrl = x.AttachUrl,
|
||||||
|
TestType = x.TestType,
|
||||||
|
AItem = x.AItem,
|
||||||
|
BItem = x.BItem,
|
||||||
|
CItem = x.CItem,
|
||||||
|
DItem = x.DItem,
|
||||||
|
EItem = x.EItem,
|
||||||
|
AnswerItems = x.AnswerItems,
|
||||||
|
Score = x.TestType == "1" ? sysTestRule.SValue : (x.TestType == "2" ? sysTestRule.MValue : sysTestRule.JValue),
|
||||||
|
};
|
||||||
|
|
||||||
|
db.Training_TestRecordItem.InsertAllOnSubmit(getItems);
|
||||||
|
db.SubmitChanges();
|
||||||
|
BLL.RedisHelper redis = new BLL.RedisHelper();
|
||||||
|
redis.SetObjString(testRecordId, getItems);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return testRecordId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 根据PersonId、TestPlanId生成试卷 扫码生成试卷
|
#region 根据PersonId、TestPlanId生成试卷 扫码生成试卷
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据PersonId、TestPlanId生成试卷 扫码生成试卷
|
/// 根据PersonId、TestPlanId生成试卷 扫码生成试卷
|
||||||
|
|
|
@ -34,6 +34,7 @@ namespace BLL
|
||||||
newCompanyTrainingItem.CompileMan = companyTrainingItem.CompileMan;
|
newCompanyTrainingItem.CompileMan = companyTrainingItem.CompileMan;
|
||||||
newCompanyTrainingItem.CompileDate = companyTrainingItem.CompileDate;
|
newCompanyTrainingItem.CompileDate = companyTrainingItem.CompileDate;
|
||||||
newCompanyTrainingItem.LearningTime = companyTrainingItem.LearningTime;
|
newCompanyTrainingItem.LearningTime = companyTrainingItem.LearningTime;
|
||||||
|
newCompanyTrainingItem.TestTrainingIds = companyTrainingItem.TestTrainingIds;
|
||||||
db.Training_CompanyTrainingItem.InsertOnSubmit(newCompanyTrainingItem);
|
db.Training_CompanyTrainingItem.InsertOnSubmit(newCompanyTrainingItem);
|
||||||
db.SubmitChanges();
|
db.SubmitChanges();
|
||||||
}
|
}
|
||||||
|
@ -53,6 +54,9 @@ namespace BLL
|
||||||
newCompanyTrainingItem.CompileMan = companyTrainingItem.CompileMan;
|
newCompanyTrainingItem.CompileMan = companyTrainingItem.CompileMan;
|
||||||
newCompanyTrainingItem.CompileDate = companyTrainingItem.CompileDate;
|
newCompanyTrainingItem.CompileDate = companyTrainingItem.CompileDate;
|
||||||
newCompanyTrainingItem.LearningTime = companyTrainingItem.LearningTime;
|
newCompanyTrainingItem.LearningTime = companyTrainingItem.LearningTime;
|
||||||
|
newCompanyTrainingItem.TestTrainingIds = companyTrainingItem.TestTrainingIds;
|
||||||
|
|
||||||
|
|
||||||
db.SubmitChanges();
|
db.SubmitChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,20 @@
|
||||||
<f:NumberBox ID="txtLearningTime" Label="时长(分钟)" runat="server" DecimalPrecision="0" NoDecimal="true" NoNegative="true" ></f:NumberBox>
|
<f:NumberBox ID="txtLearningTime" Label="时长(分钟)" runat="server" DecimalPrecision="0" NoDecimal="true" NoNegative="true" ></f:NumberBox>
|
||||||
</Items>
|
</Items>
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
|
<f:FormRow>
|
||||||
|
<Items>
|
||||||
|
<f:DropDownBox runat="server" ID="ddTestTraining" Label="考试题库" EnableMultiSelect="true" CustomData="true">
|
||||||
|
<PopPanel>
|
||||||
|
<f:Tree ID="treeTestTraining" ShowHeader="false" Hidden="true" runat="server" EnableCheckBox="true" CascadeCheck="true">
|
||||||
|
|
||||||
|
</f:Tree>
|
||||||
|
</PopPanel>
|
||||||
|
<Listeners>
|
||||||
|
<f:Listener Event="poppanelshow" Handler="onPopPanelShow" />
|
||||||
|
</Listeners>
|
||||||
|
</f:DropDownBox>
|
||||||
|
</Items>
|
||||||
|
</f:FormRow>
|
||||||
</Rows>
|
</Rows>
|
||||||
<Toolbars>
|
<Toolbars>
|
||||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||||
|
@ -72,4 +86,46 @@
|
||||||
</f:Window>
|
</f:Window>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
|
<script>
|
||||||
|
var ddTestTraining = '<%= ddTestTraining.ClientID %>';
|
||||||
|
var treeTestTraining = '<%= treeTestTraining.ClientID %>';
|
||||||
|
|
||||||
|
function onPopPanelShow(event) {
|
||||||
|
var nodes = this.getValue();
|
||||||
|
|
||||||
|
F.noEvent(function () {
|
||||||
|
// 第二个参数true:是否递归调用子节点
|
||||||
|
F(treeTestTraining).checkNodes(nodes, true);
|
||||||
|
|
||||||
|
// 启用树控件的级联选择时,确保把树控件的选中值全部同步到下拉框
|
||||||
|
syncToDropDownBox();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将树控件的选中值同步到下拉框
|
||||||
|
function syncToDropDownBox() {
|
||||||
|
var values = [], texts = [];
|
||||||
|
var checkedNodes = F(treeTestTraining).getCheckedNodes(true);
|
||||||
|
$.each(checkedNodes, function (index, node) {
|
||||||
|
debugger;
|
||||||
|
values.push(node.id);
|
||||||
|
texts.push(node.text);
|
||||||
|
});
|
||||||
|
|
||||||
|
F(ddTestTraining).setValue(values, texts);
|
||||||
|
}
|
||||||
|
|
||||||
|
F.ready(function () {
|
||||||
|
|
||||||
|
F(treeTestTraining).on('nodecheck', function (event, nodeId, checked) {
|
||||||
|
// 加个延迟,等待复选框的级联选择完成
|
||||||
|
window.setTimeout(function () {
|
||||||
|
syncToDropDownBox();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Model;
|
using Model;
|
||||||
using BLL;
|
using BLL;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.Office.Interop.Excel;
|
||||||
|
|
||||||
namespace FineUIPro.Web.HSSE.EduTrain
|
namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
{
|
{
|
||||||
|
@ -46,7 +48,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
{
|
{
|
||||||
this.GetButtonPower();
|
this.GetButtonPower();
|
||||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||||
|
BoundTree(treeTestTraining.Nodes, "0");
|
||||||
this.CompanyTrainingItemId = Request.QueryString["CompanyTrainingItemId"];
|
this.CompanyTrainingItemId = Request.QueryString["CompanyTrainingItemId"];
|
||||||
this.CompanyTrainingId = Request.QueryString["CompanyTrainingId"];
|
this.CompanyTrainingId = Request.QueryString["CompanyTrainingId"];
|
||||||
if (!string.IsNullOrEmpty(this.CompanyTrainingItemId))
|
if (!string.IsNullOrEmpty(this.CompanyTrainingItemId))
|
||||||
|
@ -59,6 +61,21 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
txtCompanyTrainingItemName.Text = q.CompanyTrainingItemName;
|
txtCompanyTrainingItemName.Text = q.CompanyTrainingItemName;
|
||||||
txtCompileMan.Text = q.CompileMan;
|
txtCompileMan.Text = q.CompileMan;
|
||||||
hdCompileMan.Text = q.CompileMan;
|
hdCompileMan.Text = q.CompileMan;
|
||||||
|
if (!string.IsNullOrEmpty(q.TestTrainingIds))
|
||||||
|
{
|
||||||
|
ddTestTraining.Values = q.TestTrainingIds.Split(',');
|
||||||
|
string text = "";
|
||||||
|
var trains = Funs.DB.Training_TestTraining.ToList();
|
||||||
|
foreach (var ids in ddTestTraining.Values)
|
||||||
|
{
|
||||||
|
var t = trains.FirstOrDefault(x => x.TrainingId == ids);
|
||||||
|
if (t != null)
|
||||||
|
{
|
||||||
|
text += "[" + t.TrainingCode + "]" + t.TrainingName + ",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ddTestTraining.Text = text.TrimEnd(new char[] { ',' });
|
||||||
|
}
|
||||||
if (q.LearningTime.HasValue)
|
if (q.LearningTime.HasValue)
|
||||||
{
|
{
|
||||||
txtLearningTime.Text = (q.LearningTime.Value/60).ToString();
|
txtLearningTime.Text = (q.LearningTime.Value/60).ToString();
|
||||||
|
@ -81,10 +98,49 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
private List<Model.Training_TestTraining> GetNewTraining(string parentId)
|
||||||
|
{
|
||||||
|
return (from x in Funs.DB.Training_TestTraining
|
||||||
|
where x.SupTrainingId == parentId
|
||||||
|
orderby x.TrainingCode
|
||||||
|
select x).ToList();
|
||||||
|
}
|
||||||
|
private void BoundTree(TreeNodeCollection nodes, string parentId)
|
||||||
|
{
|
||||||
|
var dt = GetNewTraining(parentId);
|
||||||
|
if (dt.Count() > 0)
|
||||||
|
{
|
||||||
|
TreeNode tn = null;
|
||||||
|
foreach (var dr in dt)
|
||||||
|
{
|
||||||
|
string name = dr.TrainingName;
|
||||||
|
if (!string.IsNullOrEmpty(dr.TrainingCode))
|
||||||
|
{
|
||||||
|
name = "[" + dr.TrainingCode + "]" + dr.TrainingName;
|
||||||
|
}
|
||||||
|
tn = new TreeNode
|
||||||
|
{
|
||||||
|
|
||||||
|
Text = name,
|
||||||
|
NodeID = dr.TrainingId,
|
||||||
|
EnableClickEvent = true,
|
||||||
|
ToolTip = dr.TrainingName
|
||||||
|
};
|
||||||
|
nodes.Add(tn);
|
||||||
|
///是否存在下级节点
|
||||||
|
var sup = Funs.DB.Training_TestTraining.FirstOrDefault(x => x.SupTrainingId == tn.NodeID);
|
||||||
|
if (sup != null)
|
||||||
|
{
|
||||||
|
BoundTree(tn.Nodes, tn.NodeID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#region 保存
|
#region 保存
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保存数据
|
/// 保存数据
|
||||||
|
@ -97,6 +153,10 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
CompanyTrainingItemName = this.txtCompanyTrainingItemName.Text.Trim(),
|
CompanyTrainingItemName = this.txtCompanyTrainingItemName.Text.Trim(),
|
||||||
CompileMan = hdCompileMan.Text.Trim()
|
CompileMan = hdCompileMan.Text.Trim()
|
||||||
};
|
};
|
||||||
|
if (ddTestTraining.Values != null && ddTestTraining.Values.Length > 0)
|
||||||
|
{
|
||||||
|
newCompanyTrainItem.TestTrainingIds = string.Join(",", ddTestTraining.Values);
|
||||||
|
}
|
||||||
if (!string.IsNullOrEmpty(txtLearningTime.Text))
|
if (!string.IsNullOrEmpty(txtLearningTime.Text))
|
||||||
{
|
{
|
||||||
newCompanyTrainItem.LearningTime = int.Parse(txtLearningTime.Text)*60;
|
newCompanyTrainItem.LearningTime = int.Parse(txtLearningTime.Text)*60;
|
||||||
|
|
|
@ -86,6 +86,24 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.NumberBox txtLearningTime;
|
protected global::FineUIPro.NumberBox txtLearningTime;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ddTestTraining 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.DropDownBox ddTestTraining;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// treeTestTraining 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Tree treeTestTraining;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Toolbar1 控件。
|
/// Toolbar1 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -119,6 +119,7 @@
|
||||||
|
|
||||||
// 返回false,来阻止浏览器右键菜单
|
// 返回false,来阻止浏览器右键菜单
|
||||||
function onTreeNodeContextMenu(event, nodeId) {
|
function onTreeNodeContextMenu(event, nodeId) {
|
||||||
|
debugger
|
||||||
currentNodeId = nodeId;
|
currentNodeId = nodeId;
|
||||||
F(menuID).show();
|
F(menuID).show();
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -267,7 +267,7 @@ namespace FineUIPro.Web.ProjectData
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
protected void btnMenuAdd_Click(object sender, EventArgs e)
|
protected void btnMenuAdd_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (this.trProjects.SelectedNode != null)
|
if (this.trProjects.SelectedNode != null && this.trProjects.SelectedNode.CommandName == "project")
|
||||||
{
|
{
|
||||||
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectInstallationMenuId, BLL.Const.BtnAdd))
|
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectInstallationMenuId, BLL.Const.BtnAdd))
|
||||||
{
|
{
|
||||||
|
@ -289,6 +289,10 @@ namespace FineUIPro.Web.ProjectData
|
||||||
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (this.trProjects.SelectedNode != null && this.trProjects.SelectedNode.CommandName != "project")
|
||||||
|
{
|
||||||
|
ShowNotify("装置只能录入一级!", MessageBoxIcon.Warning);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||||
|
|
|
@ -34,15 +34,32 @@ namespace FineUIPro.Web.SysManage
|
||||||
// this.btnArrowRefresh.Hidden = false;
|
// this.btnArrowRefresh.Hidden = false;
|
||||||
//}
|
//}
|
||||||
/// TAB1加载页面方法
|
/// TAB1加载页面方法
|
||||||
|
try
|
||||||
|
{
|
||||||
this.LoadTab1Data();
|
this.LoadTab1Data();
|
||||||
|
}
|
||||||
|
catch (Exception e1) { }
|
||||||
|
|
||||||
ConstValue.InitConstValueDropDownList(this.drpSuperMenu, this.rblMenuType.SelectedValue, true);
|
ConstValue.InitConstValueDropDownList(this.drpSuperMenu, this.rblMenuType.SelectedValue, true);
|
||||||
/// TAB2加载页面方法
|
/// TAB2加载页面方法
|
||||||
|
try
|
||||||
|
{
|
||||||
this.LoadTab2Data();
|
this.LoadTab2Data();
|
||||||
|
}
|
||||||
|
catch (Exception e1) { }
|
||||||
/// TAB2加载页面方法
|
/// TAB2加载页面方法
|
||||||
|
try
|
||||||
|
{
|
||||||
this.LoadTab3Data();
|
this.LoadTab3Data();
|
||||||
|
}
|
||||||
|
catch (Exception e1) { }
|
||||||
///产值
|
///产值
|
||||||
|
try
|
||||||
|
{
|
||||||
this.LoadTab4Data();
|
this.LoadTab4Data();
|
||||||
}
|
}
|
||||||
|
catch (Exception e1) { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#region 多附件转换
|
#region 多附件转换
|
||||||
#region 附件路径多附件转化
|
#region 附件路径多附件转化
|
||||||
|
|
|
@ -365195,6 +365195,8 @@ namespace Model
|
||||||
|
|
||||||
private System.Nullable<int> _LearningTime;
|
private System.Nullable<int> _LearningTime;
|
||||||
|
|
||||||
|
private string _TestTrainingIds;
|
||||||
|
|
||||||
private EntitySet<Person_TrainingTask> _Person_TrainingTask;
|
private EntitySet<Person_TrainingTask> _Person_TrainingTask;
|
||||||
|
|
||||||
private EntityRef<Training_CompanyTraining> _Training_CompanyTraining;
|
private EntityRef<Training_CompanyTraining> _Training_CompanyTraining;
|
||||||
|
@ -365221,6 +365223,8 @@ namespace Model
|
||||||
partial void OnWorkPostIdsChanged();
|
partial void OnWorkPostIdsChanged();
|
||||||
partial void OnLearningTimeChanging(System.Nullable<int> value);
|
partial void OnLearningTimeChanging(System.Nullable<int> value);
|
||||||
partial void OnLearningTimeChanged();
|
partial void OnLearningTimeChanged();
|
||||||
|
partial void OnTestTrainingIdsChanging(string value);
|
||||||
|
partial void OnTestTrainingIdsChanged();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public Training_CompanyTrainingItem()
|
public Training_CompanyTrainingItem()
|
||||||
|
@ -365414,6 +365418,26 @@ namespace Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestTrainingIds", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
|
||||||
|
public string TestTrainingIds
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._TestTrainingIds;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._TestTrainingIds != value))
|
||||||
|
{
|
||||||
|
this.OnTestTrainingIdsChanging(value);
|
||||||
|
this.SendPropertyChanging();
|
||||||
|
this._TestTrainingIds = value;
|
||||||
|
this.SendPropertyChanged("TestTrainingIds");
|
||||||
|
this.OnTestTrainingIdsChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Person_TrainingTask_Training_CompanyTrainingItem", Storage="_Person_TrainingTask", ThisKey="CompanyTrainingItemId", OtherKey="CompanyTrainingItemId", DeleteRule="NO ACTION")]
|
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Person_TrainingTask_Training_CompanyTrainingItem", Storage="_Person_TrainingTask", ThisKey="CompanyTrainingItemId", OtherKey="CompanyTrainingItemId", DeleteRule="NO ACTION")]
|
||||||
public EntitySet<Person_TrainingTask> Person_TrainingTask
|
public EntitySet<Person_TrainingTask> Person_TrainingTask
|
||||||
{
|
{
|
||||||
|
@ -369018,6 +369042,8 @@ namespace Model
|
||||||
|
|
||||||
private string _Fingerprint;
|
private string _Fingerprint;
|
||||||
|
|
||||||
|
private string _CompanyTrainingItemId;
|
||||||
|
|
||||||
private EntityRef<Training_TestPlan> _Training_TestPlan;
|
private EntityRef<Training_TestPlan> _Training_TestPlan;
|
||||||
|
|
||||||
private EntitySet<Training_TestRecordItem> _Training_TestRecordItem;
|
private EntitySet<Training_TestRecordItem> _Training_TestRecordItem;
|
||||||
|
@ -369052,6 +369078,8 @@ namespace Model
|
||||||
partial void OnSignatureChanged();
|
partial void OnSignatureChanged();
|
||||||
partial void OnFingerprintChanging(string value);
|
partial void OnFingerprintChanging(string value);
|
||||||
partial void OnFingerprintChanged();
|
partial void OnFingerprintChanged();
|
||||||
|
partial void OnCompanyTrainingItemIdChanging(string value);
|
||||||
|
partial void OnCompanyTrainingItemIdChanged();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public Training_TestRecord()
|
public Training_TestRecord()
|
||||||
|
@ -369325,6 +369353,26 @@ namespace Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompanyTrainingItemId", DbType="NVarChar(50)")]
|
||||||
|
public string CompanyTrainingItemId
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._CompanyTrainingItemId;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._CompanyTrainingItemId != value))
|
||||||
|
{
|
||||||
|
this.OnCompanyTrainingItemIdChanging(value);
|
||||||
|
this.SendPropertyChanging();
|
||||||
|
this._CompanyTrainingItemId = value;
|
||||||
|
this.SendPropertyChanged("CompanyTrainingItemId");
|
||||||
|
this.OnCompanyTrainingItemIdChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Training_TestRecord_Training_TestPlan", Storage="_Training_TestPlan", ThisKey="TestPlanId", OtherKey="TestPlanId", IsForeignKey=true)]
|
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Training_TestRecord_Training_TestPlan", Storage="_Training_TestPlan", ThisKey="TestPlanId", OtherKey="TestPlanId", IsForeignKey=true)]
|
||||||
public Training_TestPlan Training_TestPlan
|
public Training_TestPlan Training_TestPlan
|
||||||
{
|
{
|
||||||
|
|
|
@ -308,5 +308,59 @@ namespace WebAPI.Controllers
|
||||||
return responeData;
|
return responeData;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public Model.ResponeData getTrainingPlanTestRecordItemByTestPlanIdPersonId(string companyTrainingItemId, string personId,string projectId)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||||
|
{
|
||||||
|
var getCompanyTraining = db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainingItemId );
|
||||||
|
if (getCompanyTraining != null)
|
||||||
|
{
|
||||||
|
var user = db.Sys_User.FirstOrDefault(x => x.UserId == personId);
|
||||||
|
Model.SitePerson_Person person;
|
||||||
|
if (user != null)
|
||||||
|
{
|
||||||
|
person = db.SitePerson_Person.FirstOrDefault(e => (e.PersonId == personId || e.IdentityCard == user.IdentityCard) && e.ProjectId == projectId);// PersonService.GetPersonByUserId(personId, getTestPlan.ProjectId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
person = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == personId && e.ProjectId == projectId);// PersonService.GetPersonByUserId(personId, getTestPlan.ProjectId);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (person != null || user != null)
|
||||||
|
{
|
||||||
|
var testRecord = db.Training_TestRecord.FirstOrDefault(x => x.CompanyTrainingItemId == getCompanyTraining.CompanyTrainingItemId && x.TestManId == personId && !x.TestEndTime.HasValue);
|
||||||
|
if (testRecord != null)
|
||||||
|
{
|
||||||
|
string testRecordId = APITestRecordService.CreateTestRecordItem(getCompanyTraining, testRecord.TestRecordId, person, user);
|
||||||
|
responeData.code = 2;
|
||||||
|
responeData.data = new { testRecordId };
|
||||||
|
}
|
||||||
|
else if (person != null)
|
||||||
|
{
|
||||||
|
var testRecord2 = db.Training_TestRecord.FirstOrDefault(x => x.CompanyTrainingItemId == getCompanyTraining.CompanyTrainingItemId && x.TestManId == person.PersonId && !x.TestEndTime.HasValue);
|
||||||
|
if (testRecord2 != null)
|
||||||
|
{
|
||||||
|
string testRecordId = APITestRecordService.CreateTestRecordItem(getCompanyTraining, testRecord2.TestRecordId, person, user);
|
||||||
|
responeData.code = 2;
|
||||||
|
responeData.data = new { testRecordId };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue