示例#1
0
 public static void WriteSystemLog(VMGlobal.LOG_ACTION action, string memo, Guid Id)
 {
     using (RPM_Logs rpmLogs = new RPM_Logs())
         rpmLogs.LogSystem(new SystemLog()
         {
             Action = action.ToString(),
             Memo   = memo
         });
 }
示例#2
0
 public static void Log(SystemLog log)
 {
     try
     {
         log.DomainName     = Environment.UserDomainName;
         log.LogTimestamp   = new DateTime?(DateTime.Now);
         log.MachineAccount = Environment.UserName;
         log.MachineName    = Environment.MachineName;
         log.MachineID      = Global.MachineID;
         using (RPM_Logs rpmLogs = new RPM_Logs())
             rpmLogs.LogSystem(log);
     }
     catch
     {
     }
 }
示例#3
0
        public static void WriteAccountLog(VMGlobal.LOG_ACTION action, string memo, Guid Id)
        {
            if (Id != Guid.Empty)
            {
                using (RPM_Account rpmAccount = new RPM_Account())
                {
                    Account account = rpmAccount.GetAccount(Id);
                    memo = string.Format("{0} [{1}]\n", account.ToString(), account.BadgeNumber) + memo;
                }
            }
            AccountLog log = new AccountLog();

            log.Action = action.ToString();
            log.Memo   = memo;
            using (RPM_Logs rpmLogs = new RPM_Logs())
                rpmLogs.LogAccount(log);
        }
示例#4
0
 public static void Log(AccountLog log)
 {
     try
     {
         log.DomainName     = Environment.UserDomainName;
         log.LogTimestamp   = new DateTime?(DateTime.Now);
         log.MachineAccount = Environment.UserName;
         log.MachineName    = Environment.MachineName;
         log.AccountId      = new Guid?(GlobalAccount.Id);
         log.AccountName    = GlobalAccount.ToString();
         log.BadgeNumber    = GlobalAccount.BadgeNumber;
         log.IPAddress      = IPAddress;
         log.MachineID      = MachineID;
         using (RPM_Logs rpmLogs = new RPM_Logs())
             rpmLogs.LogAccount(log);
     }
     catch
     {
     }
 }