Esempio n. 1
0
 public void SubmitNormalReport(string version, string action, string mac,
     string ip, string os, string hostName)
 {
     // Add report
     var report = new NormalReport
     {
         Version = version,
         Action = action,
         Date = DateTime.Now,
         MAC = mac,
         IP = ip,
         OS = os,
         HostName = hostName
     };
     db.NormalReports.AddObject(report);
     
     // Update statistics
     var statisticsEntry = db.Statistics.FirstOrDefault(s => s.Version == version && s.Type == action);
     if (statisticsEntry != null)
     {
         statisticsEntry.Count++;
     }
     else
     {
         var statistic = new Statistic
         {
             Version = version,
             Type = action,
             Count = 1
         };
         db.Statistics.AddObject(statistic);
     }
     
     // Save changes
     try
     {
         db.SaveChanges();
     }
     catch { }
 }
Esempio n. 2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the NormalReports EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToNormalReports(NormalReport normalReport)
 {
     base.AddObject("NormalReports", normalReport);
 }
Esempio n. 3
0
 /// <summary>
 /// Create a new NormalReport object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="version">Initial value of the Version property.</param>
 /// <param name="action">Initial value of the Action property.</param>
 /// <param name="date">Initial value of the Date property.</param>
 /// <param name="mAC">Initial value of the MAC property.</param>
 /// <param name="iP">Initial value of the IP property.</param>
 /// <param name="oS">Initial value of the OS property.</param>
 /// <param name="hostName">Initial value of the HostName property.</param>
 public static NormalReport CreateNormalReport(global::System.Int32 id, global::System.String version, global::System.String action, global::System.DateTime date, global::System.String mAC, global::System.String iP, global::System.String oS, global::System.String hostName)
 {
     NormalReport normalReport = new NormalReport();
     normalReport.Id = id;
     normalReport.Version = version;
     normalReport.Action = action;
     normalReport.Date = date;
     normalReport.MAC = mAC;
     normalReport.IP = iP;
     normalReport.OS = oS;
     normalReport.HostName = hostName;
     return normalReport;
 }