InsertReportMaster() public abstract method

public abstract InsertReportMaster ( System.DateTime submit_date, string ip, string definitions, string reported_by, string email, string organization, string homepage, string comment, string guid ) : int
submit_date System.DateTime
ip string
definitions string
reported_by string
email string
organization string
homepage string
comment string
guid string
return int
Ejemplo n.º 1
0
        static void LoadReport(string filename)
        {
            DateTime webparts_date = new DateTime(2008, 1, 1);
            Loader   loader        = null;

            try {
                loader = new XmlFileLoader(filename);
            } catch {
            }

            if (loader == null)
            {
                loader = new TextFileLoader(filename);
            }

            DataAccess da = GetDataAccess();

            da.BeginTransaction();
            try {
                bool have_wpf;
                int  report_id;
                using (loader) {
                    have_wpf  = false;
                    report_id = da.InsertReportMaster(loader.ReportDate, loader.IPAddress.ToString(),
                                                      loader.Definitions, loader.UserName,
                                                      loader.Email, loader.Organization,
                                                      loader.HomePage, loader.Comments, loader.Guid);
                    foreach (Issue issue in loader.GetIssues())
                    {
                        if (issue.IssueType == IssueType.PInvoke)
                        {
                            PInvokeIssue p = (PInvokeIssue)issue;
                            da.InsertOrUpdatePInvoke(report_id, p.Library, p.Function);
                        }
                        else
                        {
                            MemberIssue m = (MemberIssue)issue;
                            bool        is_missing, is_todo, is_niex;
                            GetAsBooleans(m.IssueType, out is_missing, out is_todo, out is_niex);
                            // Ignore most of the WPF types
                            if (!IsWpf(m.Name))
                            {
                                // Ignore reports submitted prior to 2008-01-01 that are using WebParts.
                                if (loader.ReportDate < webparts_date && m.Name.IndexOf(" System.Web.UI.WebControls.WebParts") != -1)
                                {
                                    Console.WriteLine("Ignoring report {0} (uses WebParts and older than 2008-01-01)", loader.Guid);
                                    da.Rollback();
                                    return;
                                }

                                da.InsertOrUpdateMember(report_id, m.Name, is_missing, is_todo, is_niex, m.Comment);
                            }
                            else
                            {
                                have_wpf = true;
                            }
                        }
                    }
                }
                da.InitReportCounts(report_id);
                if (have_wpf)
                {
                    da.SetWpf(report_id);
                }
                da.Commit();
            } catch (Exception) {
                if (da.InTransaction)
                {
                    da.Rollback();
                }
                throw;
                //Console.WriteLine (exc);
                //Environment.Exit (1);
            }
        }