Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 partial void DeleteTrackerEvent(TrackerEvent instance);
Ejemplo n.º 4
0
 partial void UpdateTrackerEvent(TrackerEvent instance);
Ejemplo n.º 5
0
 partial void InsertTrackerEvent(TrackerEvent instance);