12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Bowin.Common.Linq.Entity;
- using EMIS.Entities.Log;
- using System.Data.SqlClient;
- using System.Data;
- using System.Data.Entity;
- using System.Data.Entity.Validation;
- using System.Diagnostics;
- using System.Data.Entity.Core.Objects;
- using System.Data.Entity.Core.Metadata.Edm;
- using System.Data.Entity.Infrastructure;
- using System.Linq.Expressions;
- using System.Reflection;
- using System.Threading;
- using Bowin.Common.Linq;
- namespace EMIS.DataLogic
- {
- public class LogUnitOfWork : EMISNewLogContext, IDisposable
- {
- public LogUnitOfWork()
- : base("EMISNewLogContext")
- {
- }
- void IDisposable.Dispose()
- {
- Dispose();
- }
- private static void WriteLogsThreading(object logList)
- {
- if (logList is IList<Log_Operate>)
- {
- try
- {
- (logList as List<Log_Operate>).ExecuteBulkCopy("EMISNewLogContext", "Log_Operate");
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- }
- public static void WriteLogs(IList<Log_Operate> logList)
- {
- Thread logThread = new Thread(WriteLogsThreading);
- logThread.Start(logList);
- }
- public void RemoveLogs(IList<Guid?> operateLogIDList)
- {
- this.Delete<Log_Operate>(x => operateLogIDList.Contains(x.OperateID));
- }
- }
- }
|