77 lines
2.2 KiB
C#
77 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using WMS.DBUtility;
|
|
using WMS.Model;
|
|
using WMS.Model.Base;
|
|
using System.Data;
|
|
using Oracle.ManagedDataAccess.Client;
|
|
|
|
namespace WMS.SqlServerData.BaseData
|
|
{
|
|
/// <summary>
|
|
/// 错误日志的记录
|
|
/// </summary>
|
|
public class LogBaseOracleData : WMS.IData.IBase.ILogBaseData
|
|
{
|
|
/// <summary>
|
|
/// 数据操作日志的处理
|
|
/// </summary>
|
|
/// <param name="log">日志实体类</param>
|
|
public string InsertLog(List<LogDataModel> logData)
|
|
{
|
|
|
|
string errText = string.Empty;
|
|
string sqlStr = string.Empty;
|
|
try
|
|
{
|
|
foreach (LogDataModel log in logData)
|
|
{
|
|
InsertLog(log);
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
errText = "可能数据链接有问题,异常内容" + ex.Message;
|
|
}
|
|
return errText;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 数据操作日志的处理
|
|
/// </summary>
|
|
/// <param name="log">日志实体类</param>
|
|
public string InsertLog(LogDataModel log)
|
|
{
|
|
string errText = string.Empty;
|
|
string sqlStr = string.Empty;
|
|
try
|
|
{
|
|
|
|
sqlStr = " insert into t_base_datalog"
|
|
+ " (OPERATOR, sqlstr, [content], [function], parameters, ip, id,ACTORNAME)"
|
|
+ " values ("
|
|
+ " '" + log.Operator_id + "', :sqlstr, "
|
|
+ " '" + log.Content + "', '" + log.Function + "', "
|
|
+ " '" + log.Parameter + "', '" + log.Ip + "', '','" + log.Operator + "')";
|
|
OracleParameter[] parameters = {
|
|
new OracleParameter(":sqlstr",OracleDbType.Varchar2) };
|
|
parameters[0].Value = log.SqlStr;
|
|
|
|
|
|
OracleHelper.ExecuteNonQuery(CommandType.Text, sqlStr,parameters);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
errText = "可能数据链接有问题,异常内容" + ex.Message;
|
|
}
|
|
return errText;
|
|
}
|
|
}
|
|
}
|