initial add
This commit is contained in:
51
Fab2ApprovalSystem/DMO/EventLogDMO.cs
Normal file
51
Fab2ApprovalSystem/DMO/EventLogDMO.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using Fab2ApprovalSystem.Models;
|
||||
using Dapper;
|
||||
using System.Transactions;
|
||||
using Fab2ApprovalSystem.ViewModels;
|
||||
using System.Reflection;
|
||||
using Fab2ApprovalSystem.Misc;
|
||||
|
||||
namespace Fab2ApprovalSystem.DMO
|
||||
{
|
||||
|
||||
public static class EventLogDMO
|
||||
{
|
||||
private static IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["FabApprovalConnection"].ConnectionString);
|
||||
|
||||
//public static void Add(WinEventLog eventLog)
|
||||
//{
|
||||
// var parameters = new DynamicParameters();
|
||||
// parameters.Add("@IssueID", eventLog.IssueID);
|
||||
// parameters.Add("@UserID", eventLog.UserID);
|
||||
// parameters.Add("@OperationType", eventLog.OperationType);
|
||||
// parameters.Add("@Comments", eventLog.Comments);
|
||||
|
||||
// db.Execute("InsertEventLog", parameters, commandType: CommandType.StoredProcedure);
|
||||
|
||||
//}
|
||||
|
||||
|
||||
public static void Add(WinEventLog eventLog)
|
||||
{
|
||||
var parameters = new DynamicParameters();
|
||||
parameters.Add("@IssueID", eventLog.IssueID);
|
||||
parameters.Add("@UserID", eventLog.UserID);
|
||||
parameters.Add("@DocumentType", eventLog.DocumentType);
|
||||
parameters.Add("@OperationType", eventLog.OperationType);
|
||||
parameters.Add("@Comments", eventLog.Comments);
|
||||
|
||||
db.Execute("InsertEventLogByDocument", parameters, commandType: CommandType.StoredProcedure);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user