///<summary>Take a SecurityLog object to save to the database. Creates a SecurityLogHash object as well.</summary> public static void MakeLogEntry(SecurityLog secLog) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), secLog); return; } secLog.SecurityLogNum = SecurityLogs.Insert(secLog); SecurityLogHashes.InsertSecurityLogHash(secLog.SecurityLogNum); //uses db date/time if (secLog.PermType == Permissions.AppointmentCreate) { EntryLogs.Insert(new EntryLog(secLog.UserNum, EntryLogFKeyType.Appointment, secLog.FKey, secLog.LogSource)); } }
///<summary>Takes a foreign key to a table associated with that PermType. PatNum can be 0.</summary> public static void MakeLogEntry(Permissions permType, long patNum, string logText, long fKey) { //No need to check RemotingRole; no call to db. SecurityLog securityLog = new SecurityLog(); securityLog.PermType = permType; if (Security.CurUser != null) //if this is generated by Patient Portal web service then we won't have a CurUser set { securityLog.UserNum = Security.CurUser.UserNum; } securityLog.LogText = logText; //"From: "+Environment.MachineName+" - "+logText; securityLog.CompName = Environment.MachineName; securityLog.PatNum = patNum; securityLog.FKey = fKey; securityLog.SecurityLogNum = SecurityLogs.Insert(securityLog); //Create a hash of the security log. SecurityLogHashes.InsertSecurityLogHash(securityLog.SecurityLogNum); //uses db date/time }