302 lines
10 KiB
C#
302 lines
10 KiB
C#
/** 版本信息模板在安装目录下,可自行修改。
|
|
* pow_user_exam.cs
|
|
*
|
|
* 功 能: N/A
|
|
* 类 名: pow_user_exam
|
|
*
|
|
* Ver 变更日期 负责人 变更内容
|
|
* ───────────────────────────────────
|
|
* V0.01 2022/8/3 11:04:16 N/A 初版
|
|
*
|
|
* Copyright (c) 2012 Maticsoft Corporation. All rights reserved.
|
|
*┌──────────────────────────────────┐
|
|
*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │
|
|
*│ 版权所有:动软卓越(北京)科技有限公司 │
|
|
*└──────────────────────────────────┘
|
|
*/
|
|
using System;
|
|
using System.Data;
|
|
using System.Collections.Generic;
|
|
using Maticsoft.Common;
|
|
using Competition.Mysql.Model;
|
|
namespace Competition.Mysql.BLL
|
|
{
|
|
/// <summary>
|
|
/// pow_user_exam
|
|
/// </summary>
|
|
public partial class pow_user_exam
|
|
{
|
|
private readonly Competition.Mysql.DAL.pow_user_exam dal = new Competition.Mysql.DAL.pow_user_exam();
|
|
public pow_user_exam()
|
|
{ }
|
|
#region BasicMethod
|
|
/// <summary>
|
|
/// 是否存在该记录
|
|
/// </summary>
|
|
public bool Exists(string UserExamId)
|
|
{
|
|
return dal.Exists(UserExamId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 增加一条数据
|
|
/// </summary>
|
|
public bool Add(Competition.Mysql.Model.pow_user_exam model)
|
|
{
|
|
return dal.Add(model);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新一条数据
|
|
/// </summary>
|
|
public bool Update(Competition.Mysql.Model.pow_user_exam model)
|
|
{
|
|
return dal.Update(model);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除一条数据
|
|
/// </summary>
|
|
public bool Delete(string UserExamId)
|
|
{
|
|
|
|
return dal.Delete(UserExamId);
|
|
}
|
|
/// <summary>
|
|
/// 删除一条数据
|
|
/// </summary>
|
|
public bool DeleteList(string UserExamIdlist)
|
|
{
|
|
return dal.DeleteList(UserExamIdlist);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 得到一个对象实体
|
|
/// </summary>
|
|
public Competition.Mysql.Model.pow_user_exam GetModel(string UserExamId)
|
|
{
|
|
|
|
return dal.GetModel(UserExamId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 得到一个对象实体,从缓存中
|
|
/// </summary>
|
|
public Competition.Mysql.Model.pow_user_exam GetModelByCache(string UserExamId)
|
|
{
|
|
|
|
string CacheKey = "pow_user_examModel-" + UserExamId;
|
|
object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
|
|
if (objModel == null)
|
|
{
|
|
try
|
|
{
|
|
objModel = dal.GetModel(UserExamId);
|
|
if (objModel != null)
|
|
{
|
|
int ModelCache = Maticsoft.Common.ConfigHelper.GetConfigInt("ModelCache");
|
|
Maticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
|
|
}
|
|
}
|
|
catch { }
|
|
}
|
|
return (Competition.Mysql.Model.pow_user_exam)objModel;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获得数据列表
|
|
/// </summary>
|
|
public DataSet GetList(string strWhere)
|
|
{
|
|
return dal.GetList(strWhere);
|
|
}
|
|
/// <summary>
|
|
/// 获得数据列表
|
|
/// </summary>
|
|
public List<Competition.Mysql.Model.pow_user_exam> GetModelList(string strWhere)
|
|
{
|
|
DataSet ds = dal.GetList(strWhere);
|
|
return DataTableToList(ds.Tables[0]);
|
|
}
|
|
/// <summary>
|
|
/// 获得数据列表
|
|
/// </summary>
|
|
public List<Competition.Mysql.Model.pow_user_exam> DataTableToList(DataTable dt)
|
|
{
|
|
List<Competition.Mysql.Model.pow_user_exam> modelList = new List<Competition.Mysql.Model.pow_user_exam>();
|
|
int rowsCount = dt.Rows.Count;
|
|
if (rowsCount > 0)
|
|
{
|
|
Competition.Mysql.Model.pow_user_exam model;
|
|
for (int n = 0; n < rowsCount; n++)
|
|
{
|
|
model = dal.DataRowToModel(dt.Rows[n]);
|
|
if (model != null)
|
|
{
|
|
modelList.Add(model);
|
|
}
|
|
}
|
|
}
|
|
return modelList;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获得数据列表
|
|
/// </summary>
|
|
public DataSet GetAllList()
|
|
{
|
|
return GetList("");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 分页获取数据列表
|
|
/// </summary>
|
|
public int GetRecordCount(string strWhere)
|
|
{
|
|
return dal.GetRecordCount(strWhere);
|
|
}
|
|
/// <summary>
|
|
/// 分页获取数据列表
|
|
/// </summary>
|
|
public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
|
|
{
|
|
return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
|
|
}
|
|
/// <summary>
|
|
/// 分页获取数据列表
|
|
/// </summary>
|
|
//public DataSet GetList(int PageSize,int PageIndex,string strWhere)
|
|
//{
|
|
//return dal.GetList(PageSize,PageIndex,strWhere);
|
|
//}
|
|
|
|
#endregion BasicMethod
|
|
#region ExtensionMethod
|
|
/// <summary>
|
|
/// 更新一条数据
|
|
/// </summary>
|
|
public bool UpdateExaminationDuration(string UserExamId, string ExaminationDuration)
|
|
{
|
|
return dal.UpdateExaminationDuration(UserExamId, ExaminationDuration);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新场景设备状态
|
|
/// </summary>
|
|
public bool UpdateRestoreSceneMsg(string UserExamId, string RestoreSceneMsg)
|
|
{
|
|
return dal.UpdateRestoreSceneMsg(UserExamId, RestoreSceneMsg);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新考试时间
|
|
/// </summary>
|
|
public bool UpdateUserExamTime(string UserExamId)
|
|
{
|
|
return dal.UpdateUserExamTime(UserExamId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新考试环节
|
|
/// </summary>
|
|
/// <param name="UserExamId">用户考试id</param>
|
|
/// <param name="ExaminationLink">考试环节</param>
|
|
/// <returns></returns>
|
|
public bool UpdateExaminationLink(string UserExamId, string ExaminationLink)
|
|
{
|
|
return dal.UpdateExaminationLink(UserExamId, ExaminationLink);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新巡线验电结果
|
|
/// </summary>
|
|
/// <param name="UserExamId">用户考试id</param>
|
|
/// <returns></returns>
|
|
public bool UpdateExamLineElectricity(string UserExamId)
|
|
{
|
|
return dal.UpdateExamLineElectricity(UserExamId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新排故验电结果
|
|
/// </summary>
|
|
/// <param name="UserExamId">用户考试id</param>
|
|
/// <returns></returns>
|
|
public bool UpdateExamFaultElectricity(string UserExamId)
|
|
{
|
|
return dal.UpdateExamFaultElectricity(UserExamId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新巡检爬杆结果
|
|
/// </summary>
|
|
/// <param name="UserExamId">用户考试id</param>
|
|
/// <returns></returns>
|
|
public bool UpdateClimbrod(string UserExamId)
|
|
{
|
|
return dal.UpdateClimbrod(UserExamId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新未分闸状态拉合熔芯结果
|
|
/// </summary>
|
|
/// <param name="UserExamId">用户考试id</param>
|
|
/// <returns></returns>
|
|
public bool UpdateExamFusibleCore(string UserExamId)
|
|
{
|
|
return dal.UpdateExamFusibleCore(UserExamId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新围栏结果
|
|
/// </summary>
|
|
/// <param name="UserExamId">用户考试id</param>
|
|
/// <returns></returns>
|
|
public bool UpdateExamEnclosure(string UserExamId, string EnclosureIsScore)
|
|
{
|
|
return dal.UpdateExamEnclosure(UserExamId, EnclosureIsScore);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 使用事务批量操作新增
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public int OperationAddAllData(Competition.Mysql.Model.pow_user_exam user_exam_model, List<Competition.Mysql.Model.pow_exam_tool> tool_list, Competition.Mysql.Model.pow_achievement achievement_model, List<Competition.Mysql.Model.pow_exam_fault> exam_fault_list, List<Competition.Mysql.Model.pow_exam_operation_ticket> list_operation_ticket)
|
|
{
|
|
return dal.OperationAddAllData(user_exam_model, tool_list, achievement_model, exam_fault_list, list_operation_ticket);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 使用事务批量操作新增
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public int OperationUpdateAllData(DateTime end_time, string status, string user_exam_id, string achievement_id, decimal? total_score, List<Competition.Mysql.Model.pow_achievement_details> details_list, Competition.Mysql.Model.pow_train_record record_model)
|
|
{
|
|
return dal.OperationUpdateAllData(end_time, status, user_exam_id, achievement_id, total_score, details_list, record_model);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 使用事务批量操作删除
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public int OperationDelAllData()
|
|
{
|
|
return dal.OperationDelAllData();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 使用事务批量操作删除
|
|
/// </summary>
|
|
/// <param name="exam_id">考试id</param>
|
|
/// <param name="user_id">考生id</param>
|
|
/// <param name="achievement_id">成绩id</param>
|
|
/// <returns></returns>
|
|
public int OperationDelData(string exam_id, string user_id, string achievement_id)
|
|
{
|
|
return dal.OperationDelData(exam_id, user_id, achievement_id);
|
|
}
|
|
#endregion ExtensionMethod
|
|
}
|
|
}
|
|
|