示例#1
0
 public EventManagementReportController
 (
     DataContext context,
     IEmployee employee,
     IWorkOrderParent work,
     IEventSetup setup,
     IEventService service,
     IEventMiscellaneous miscellaneous,
     IWorkOrderManpower manpower,
     IWorkOrderSetup orderSetup,
     IWorkOrderService orderService,
     IWorkOrderMiscellaneous orderMiscellaneous,
     IDefaultSetting setting,
     IAttendance attendance,
     ITransaction transaction,
     IEventReport report
 )
 {
     _context            = context;
     _employee           = employee;
     _work               = work;
     _setup              = setup;
     _service            = service;
     _miscellaneous      = miscellaneous;
     _manpower           = manpower;
     _orderSetup         = orderSetup;
     _orderService       = orderService;
     _orderMiscellaneous = orderMiscellaneous;
     _setting            = setting;
     _attendance         = attendance;
     _transaction        = transaction;
     _report             = report;
 }
示例#2
0
        /// <summary>
        /// Save report with given identifier on disk
        /// </summary>
        /// <param name="id">NUnit test unique identifier</param>
        /// <param name="report">Instance of action report</param>
        public void Save(string id, IEventReport report)
        {
            var outputFile = GetReportFile(id);

            if (outputFile.Exists)
            {
                throw new IOException($"Cannot save report to disk because file already exist: {outputFile.FullName}");
            }

            using (var writer = outputFile.CreateText())
            {
                _serializer.Serialize(writer, report);
            }
        }
        private static void ReportAndProceed(IInvocation invocation, IEventReport report)
        {
            String actionGuid = report.RecordActivityStarted(FormatInvocationName(invocation), invocation.Arguments);

            try
            {
                invocation.Proceed();
            }
            catch (Exception ex)
            {
                report.RecordError(ex);
                throw;
            }
            finally
            {
                if (!String.IsNullOrEmpty(actionGuid))
                {
                    report.RecordActivityFinished(actionGuid);
                }
            }
        }