public static trackerlogentrysmall[] Logon(string Username, string Computer, string DomainName, string IP, string LogonServer, string OS) { sql2linqDataContext sdc = new sql2linqDataContext(ConfigurationManager.ConnectionStrings[hapConfig.Current.Tracker.Provider].ConnectionString); if (sdc.TrackerEvents.Count(t => t.Username == Username && t.domainname == DomainName && !t.LogoffDateTime.HasValue && t.ComputerName == Computer) > 0) { Clear(Computer, DomainName); } TrackerEvent newe = new TrackerEvent(); newe.LogonDateTime = DateTime.Now; newe.logonserver = LogonServer; newe.ip = IP; newe.ComputerName = Computer; newe.Username = Username; newe.domainname = DomainName; newe.os = OS; sdc.TrackerEvents.InsertOnSubmit(newe); sdc.SubmitChanges(); return(Poll(Username, Computer, DomainName)); }
public static void UpgradeFromXML() { sql2linqDataContext sdc = new sql2linqDataContext(ConfigurationManager.ConnectionStrings[hapConfig.Current.Tracker.Provider].ConnectionString); foreach (trackerlogentry tle in HAP.Data.Tracker.xml.GetLogs(true).OrderBy(t => t.LogOnDateTime)) { TrackerEvent newe = new TrackerEvent(); newe.LogonDateTime = tle.LogOnDateTime; newe.logonserver = tle.LogonServer; newe.ip = tle.IP; newe.ComputerName = tle.ComputerName; newe.Username = tle.UserName; newe.domainname = tle.DomainName; newe.os = tle.OS; if (tle.LogOffDateTime != null) { newe.LogoffDateTime = tle.LogOffDateTime; } sdc.TrackerEvents.InsertOnSubmit(newe); } sdc.SubmitChanges(); xml.DeleteAll(); }
partial void DeleteTrackerEvent(TrackerEvent instance);
partial void UpdateTrackerEvent(TrackerEvent instance);
partial void InsertTrackerEvent(TrackerEvent instance);