Ejemplo n.º 1
0
        public static bool BatchProcessEnd(string processCode, int batchStatus, DateTime endTime, TimeSpan processTime, string detail)
        {
            IAuditLogFacade auditLogFacade = null;

            try
            {
                auditLogFacade = new AuditLogFacade();
                var proc = auditLogFacade.GetBatchProcessByCode(processCode);
                if (proc != null)
                {
                    proc.Status      = batchStatus;
                    proc.EndTime     = endTime;
                    proc.ProcessTime = processTime;
                    proc.Detail      = detail;

                    return(auditLogFacade.UpdateBatchProcess(proc));
                }

                return(false);
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
            }
            finally
            {
                if (auditLogFacade != null)
                {
                    auditLogFacade.Dispose();
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        public static bool BatchProcessStart(string processCode, DateTime startTime)
        {
            IAuditLogFacade auditLogFacade = null;

            try
            {
                auditLogFacade = new AuditLogFacade();
                var proc = auditLogFacade.GetBatchProcessByCode(processCode);
                if (proc != null && proc.Status != Constants.BatchProcessStatus.Processing)
                {
                    proc.Status      = Constants.BatchProcessStatus.Processing;
                    proc.StartTime   = startTime;
                    proc.EndTime     = null;
                    proc.ProcessTime = null;
                    proc.Detail      = null;

                    return(auditLogFacade.UpdateBatchProcess(proc));
                }

                return(false);
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
            }
            finally
            {
                if (auditLogFacade != null)
                {
                    auditLogFacade.Dispose();
                }
            }

            return(false);
        }
Ejemplo n.º 3
0
        public static void AuditLog(AuditLogEntity auditLog)
        {
            IAuditLogFacade auditLogFacade = null;

            try
            {
                auditLogFacade = new AuditLogFacade();
                auditLogFacade.AddLog(auditLog);
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
            }
            finally
            {
                if (auditLogFacade != null)
                {
                    auditLogFacade.Dispose();
                }
            }
        }
Ejemplo n.º 4
0
        public static void AuditLog(AuditLogEntity auditLog, LogStatus status, string detail)
        {
            IAuditLogFacade auditLogFacade = null;

            try
            {
                auditLogFacade  = new AuditLogFacade();
                auditLog.Status = status;
                auditLog.Detail = detail;
                auditLogFacade.AddLog(auditLog);
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
            }
            finally
            {
                if (auditLogFacade != null)
                {
                    auditLogFacade.Dispose();
                }
            }
        }