175 lines
		
	
	
		
			6.3 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			175 lines
		
	
	
		
			6.3 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using AIMSDAL;
 | |
| using AIMSModel;
 | |
| using System.Collections;
 | |
| using System.Collections.Generic;
 | |
| using DrawGraph;
 | |
| using System.Data.SqlClient;
 | |
| 
 | |
| namespace AIMSBLL
 | |
| {
 | |
|     public partial class BOperationRecord
 | |
|     {
 | |
|         #region 插入实体操作部份
 | |
|         /// <summary>
 | |
|         /// 插入实体
 | |
|         /// </summary>
 | |
|         /// <param name="operationRecord">实体类对象</param>
 | |
|         /// <returns>标识列值或影响的记录行数</returns>
 | |
|         public static int Insert(OperationRecord operationRecord)
 | |
|         {
 | |
|             return DOperationRecord.Insert(operationRecord);
 | |
|         }
 | |
|         #endregion
 | |
| 
 | |
|         #region 删除实体操作
 | |
|         /// <summary>
 | |
|         /// 删除实体
 | |
|         /// </summary>
 | |
|         /// <param name="operationRecord">实体类对象</param>
 | |
|         /// <returns>影响的记录行数</returns>
 | |
|         public static int Delete(OperationRecord operationRecord)
 | |
|         {
 | |
|             return DOperationRecord.Delete(operationRecord);
 | |
|         }
 | |
|         /// <summary>
 | |
|         /// 根据对象查询语句删除
 | |
|         /// </summary>
 | |
|         /// <param name="oql">对象查询语句</param>
 | |
|         /// <param name="parameters">参数列表</param>
 | |
|         /// <returns>影响的记录行数</returns>
 | |
|         public static int Delete(string oql, ParameterList parameters)
 | |
|         {
 | |
|             return DOperationRecord.Delete(oql, parameters);
 | |
|         }
 | |
|         #endregion
 | |
| 
 | |
|         #region 更新实体操作
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 更新实体
 | |
|         /// </summary>
 | |
|         /// <param name="operationRecord">实体类对象</param>
 | |
|         /// <returns>影响的记录行数</returns>
 | |
|         public static int Update(OperationRecord operationRecord)
 | |
|         {
 | |
|             return DOperationRecord.Update(operationRecord);
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 根据对象查询语句更新实体
 | |
|         /// </summary>
 | |
|         /// <param name="oql">对象查询语句</param>
 | |
|         /// <param name="parameters">参数列表</param>
 | |
|         /// <returns>影响的记录行数</returns>
 | |
|         public static int Update(string oql, ParameterList parameters)
 | |
|         {
 | |
|             int Result = DOperationRecord.Update(oql, parameters);
 | |
|             if (Result > 0 && parameters != null && oql.Contains("Time") && parameters.Keys.Count > 0)
 | |
|             {
 | |
|                 foreach (string key in parameters.Keys)
 | |
|                 {
 | |
|                     if (key.ToUpper() == "@ID")
 | |
|                     {
 | |
|                         DOperationRecord.UpdateTimeSpan(int.Parse(parameters[key].ToString()));
 | |
|                         break; 
 | |
|                     }
 | |
|                 }
 | |
|             }
 | |
|             return Result;
 | |
|         }
 | |
|         #endregion
 | |
| 
 | |
|         #region 查询实体集合
 | |
|         /// <summary>
 | |
|         /// \查询实体集合
 | |
|         /// </summary>
 | |
|         /// <returns>实体类对象集合</returns>
 | |
|         public static List<OperationRecord> Select()
 | |
|         {
 | |
|             return DOperationRecord.Select();
 | |
|         }
 | |
|         /// <summary>
 | |
|         /// 递归查询实体集合
 | |
|         /// </summary>
 | |
|         /// <param name="recursiveType">递归类型</param>
 | |
|         /// <param name="recursiveDepth">递归深度</param>
 | |
|         /// <returns>实体类对象集合</returns>
 | |
|         public static List<OperationRecord> Select(RecursiveType recursiveType, int recursiveDepth)
 | |
|         {
 | |
|             return DOperationRecord.Select(recursiveType, recursiveDepth);
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 根据对象查询语句查询实体集合
 | |
|         /// </summary>
 | |
|         /// <param name="oql">对象查询语句</param>
 | |
|         /// <param name="parameters">参数列表</param>
 | |
|         /// <returns>实体类对象集合</returns>
 | |
|         public static List<OperationRecord> Select(string oql, ParameterList parameters)
 | |
|         {
 | |
|             return DOperationRecord.Select(oql, parameters);
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 根据对象查询语句递归查询实体集合
 | |
|         /// </summary>
 | |
|         /// <param name="oql">对象查询语句</param>
 | |
|         /// <param name="parameters">参数列表</param>
 | |
|         /// <param name="recursiveType">递归类型</param>
 | |
|         /// <param name="recursiveDepth">递归深度</param>
 | |
|         /// <returns>实体类对象集合</returns>
 | |
|         public static List<OperationRecord> Select(string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth)
 | |
|         {
 | |
|             return DOperationRecord.Select(oql, parameters, recursiveType, recursiveDepth);
 | |
|         }
 | |
|         #endregion
 | |
| 
 | |
|         #region 查询单个实体
 | |
|         /// <summary>
 | |
|         /// 更据对象查询语句查询单个实体
 | |
|         /// </summary>
 | |
|         /// <param name="oql">对象查询语句</param>
 | |
|         /// <param name="parameters">参数列表</param>
 | |
|         /// <returns>实体对象</returns>
 | |
|         public static OperationRecord SelectSingle(string oql, ParameterList parameters)
 | |
|         {
 | |
|             return DOperationRecord.SelectSingle(oql, parameters);
 | |
|         }
 | |
|         /// <summary>
 | |
|         /// 更据对象查询语句递归查询单个实体
 | |
|         /// </summary>
 | |
|         /// <param name="oql">对象查询语句</param>
 | |
|         /// <param name="parameters">参数列表</param>
 | |
|         /// <param name="recursiveType">递归类型</param>
 | |
|         /// <param name="recursiveDepth">递归深度</param>
 | |
|         /// <returns>实体对象</returns>
 | |
|         public static OperationRecord SelectSingle(string oql, ParameterList parameters, RecursiveType recursiveType, int recursiveDepth)
 | |
|         {
 | |
|             return DOperationRecord.SelectSingle(oql, parameters, recursiveType, recursiveDepth);
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 按主键字段查询特定实体
 | |
|         /// </summary>
 | |
|         /// <param name="id">主键值</param>
 | |
|         /// <returns>实体类对象</returns>
 | |
|         public static OperationRecord SelectSingle(int? id)
 | |
|         {
 | |
|             return DOperationRecord.SelectSingle(id);
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 更据主键递归查询单个实体
 | |
|         /// </summary>
 | |
|         /// <param name="recursiveType">递归类型</param>
 | |
|         /// <param name="recursiveDepth">递归深度</param>
 | |
|         /// <returns>实体对象</returns>
 | |
|         public static OperationRecord SelectSingle(int? id, RecursiveType recursiveType, int recursiveDepth)
 | |
|         {
 | |
|             return DOperationRecord.SelectSingle(id, recursiveType, recursiveDepth);
 | |
|         }
 | |
|         #endregion
 | |
|     }
 | |
| }
 |