public void SubmitBugReport(string version, string mac, string ip, string os, string hostName, string bugStackTrace, string bugType, string bugMessage, string bugUserInput, string bugTargetSite, string bugSource) { // Add bug report var report = new BugReport { Version = version, Date = DateTime.Now, MAC = mac, IP = ip, OS = os, HostName = hostName, BugStackTrace = GZipStreamStringHelper.UnZip(bugStackTrace), BugType = bugType, BugMessage = bugMessage, BugUserInput = bugUserInput, BugTargetSite = bugTargetSite, BugSource = bugSource }; db.BugReports.AddObject(report); // Update statistics var statisticsEntry = db.Statistics.FirstOrDefault(s => s.Version == version && s.Type == "Bug"); if (statisticsEntry != null) { statisticsEntry.Count++; } else { var statistic = new Statistic { Version = version, Type = "Bug", Count = 1 }; db.Statistics.AddObject(statistic); } // Save changes db.SaveChanges(); }
/// <summary> /// Create a new BugReport object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="version">Initial value of the Version 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> /// <param name="bugStackTrace">Initial value of the BugStackTrace property.</param> /// <param name="bugType">Initial value of the BugType property.</param> /// <param name="bugMessage">Initial value of the BugMessage property.</param> /// <param name="bugUserInput">Initial value of the BugUserInput property.</param> /// <param name="bugTargetSite">Initial value of the BugTargetSite property.</param> /// <param name="bugSource">Initial value of the BugSource property.</param> public static BugReport CreateBugReport(global::System.Int32 id, global::System.String version, global::System.DateTime date, global::System.String mAC, global::System.String iP, global::System.String oS, global::System.String hostName, global::System.String bugStackTrace, global::System.String bugType, global::System.String bugMessage, global::System.String bugUserInput, global::System.String bugTargetSite, global::System.String bugSource) { BugReport bugReport = new BugReport(); bugReport.Id = id; bugReport.Version = version; bugReport.Date = date; bugReport.MAC = mAC; bugReport.IP = iP; bugReport.OS = oS; bugReport.HostName = hostName; bugReport.BugStackTrace = bugStackTrace; bugReport.BugType = bugType; bugReport.BugMessage = bugMessage; bugReport.BugUserInput = bugUserInput; bugReport.BugTargetSite = bugTargetSite; bugReport.BugSource = bugSource; return bugReport; }
/// <summary> /// Deprecated Method for adding a new object to the BugReports EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToBugReports(BugReport bugReport) { base.AddObject("BugReports", bugReport); }