55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
using System;
|
|
using System.Data;
|
|
using System.Configuration;
|
|
using System.Data.Common;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Wellan.Data;
|
|
using Wellan.Common;
|
|
using System.Transactions;
|
|
using System.ComponentModel;
|
|
|
|
/// <summary>
|
|
/// RlogDAC 的摘要描述
|
|
/// </summary>
|
|
public class RlogDAC : Wellan.Data.WDAC
|
|
{
|
|
//private string _select =
|
|
// @" SELECT RLDAT, RLTIM, RLUSR, RLPRG, RLCIP, RLCNT, TRDAT, TRMOD, TRUSR FROM RLOG ";
|
|
|
|
private string _insert =
|
|
@"INSERT INTO RLOG
|
|
(RLDAT, RLTIM, RLUSR, RLPRG, RLCIP, RLCNT, TRDAT, TRMOD, TRUSR)
|
|
VALUES
|
|
(@RLDAT, @RLTIM, @RLUSR, @RLPRG, @RLCIP, @RLCNT, GETDATE(), 'INSERT', @TRUSR)";
|
|
|
|
public RlogDAC()
|
|
{
|
|
}
|
|
|
|
public RlogDAC(WQuery query)
|
|
: this()
|
|
{
|
|
this._query = query;
|
|
}
|
|
|
|
public RlogDAC(string connectionConfig, string connectionConfigName)
|
|
: this()
|
|
{
|
|
this._connectionConfig = connectionConfig;
|
|
this._connectionConfigName = connectionConfigName;
|
|
}
|
|
|
|
public void InsertOne(string RLUSR, string RLPRG, string RLCIP, string RLCNT)
|
|
{
|
|
DbCommand cmdInsert = Query.NewCommand(_insert);
|
|
Query.AddParam(cmdInsert, "RLDAT", DateTime.UtcNow.AddHours(8).Date);
|
|
Query.AddParam(cmdInsert, "RLTIM", DateTime.UtcNow.AddHours(8).ToString("HH:mm:ss"));
|
|
Query.AddParam(cmdInsert, "RLUSR", RLUSR);
|
|
Query.AddParam(cmdInsert, "RLPRG", RLPRG);
|
|
Query.AddParam(cmdInsert, "RLCIP", RLCIP);
|
|
Query.AddParam(cmdInsert, "RLCNT", RLCNT);
|
|
Query.AddParam(cmdInsert, "TRUSR", RLUSR);
|
|
Query.ExecuteNonQuery(cmdInsert);
|
|
}
|
|
} |