示例#1
0
        public ColourCensus(string country, List <IDisplayColourCensus> reportList)
        {
            InitializeComponent();
            dgReportSheet.AutoGenerateColumns = false;
            ExtensionMethods.DoubleBuffered(dgReportSheet, true);
            this.country     = country;
            this.reportList  = new SortableBindingList <IDisplayColourCensus>(reportList);
            reportFormHelper = new ReportFormHelper(this, "Colour Census Report", dgReportSheet, this.ResetTable, "Colour Census");

            boldFont = new Font(dgReportSheet.DefaultCellStyle.Font, FontStyle.Bold);
            styles   = new Dictionary <int, DataGridViewCellStyle>();
            DataGridViewCellStyle notAlive = new DataGridViewCellStyle();

            notAlive.BackColor = notAlive.ForeColor = Color.DarkGray;
            styles.Add(0, notAlive);
            DataGridViewCellStyle missingCensus = new DataGridViewCellStyle();

            missingCensus.BackColor = missingCensus.ForeColor = Color.Red;
            styles.Add(1, missingCensus);
            DataGridViewCellStyle censusMissingLC = new DataGridViewCellStyle();

            censusMissingLC.BackColor = censusMissingLC.ForeColor = Color.Yellow;
            styles.Add(2, censusMissingLC);
            DataGridViewCellStyle notCensusEnterednotLCYear = new DataGridViewCellStyle();

            notCensusEnterednotLCYear.BackColor = notCensusEnterednotLCYear.ForeColor = Color.LawnGreen;
            styles.Add(3, notCensusEnterednotLCYear);
            DataGridViewCellStyle allEntered = new DataGridViewCellStyle();

            allEntered.BackColor = allEntered.ForeColor = Color.LawnGreen;
            styles.Add(4, allEntered);
            DataGridViewCellStyle lcNoCensus = new DataGridViewCellStyle();

            lcNoCensus.BackColor = lcNoCensus.ForeColor = Color.DarkOrange;
            styles.Add(5, lcNoCensus);
            DataGridViewCellStyle onOtherCensus = new DataGridViewCellStyle();

            onOtherCensus.BackColor = onOtherCensus.ForeColor = Color.DarkSlateGray;
            styles.Add(6, onOtherCensus);
            DataGridViewCellStyle outsideUKCensus = new DataGridViewCellStyle();

            outsideUKCensus.BackColor = outsideUKCensus.ForeColor = Color.DarkSlateGray;
            styles.Add(7, onOtherCensus);
            DataGridViewCellStyle knownMissing = new DataGridViewCellStyle();

            knownMissing.BackColor = knownMissing.ForeColor = Color.MediumSeaGreen;
            styles.Add(8, knownMissing);
            SetColumns(country);
            dgReportSheet.DataSource = this.reportList;
            reportFormHelper.LoadColumnLayout("ColourCensusLayout.xml");
            tsRecords.Text = Properties.Messages.Count + reportList.Count + " records listed.";
            string defaultProvider = (string)Application.UserAppDataRegistry.GetValue("Default Search Provider");

            if (defaultProvider == null)
            {
                defaultProvider = "FamilySearch";
            }
            cbCensusSearchProvider.Text = defaultProvider;
            cbFilter.Text = "All Individuals";
        }
示例#2
0
        public LostCousinsReferral(Individual referee, bool onlyInCommon)
        {
            InitializeComponent();
            Top += NativeMethods.TopTaskbarOffset;
            FamilyTree ft = FamilyTree.Instance;

            Text             = $"Lost Cousins Referral for {referee}";
            reportFormHelper = new ReportFormHelper(this, Text, dgLCReferrals, ResetTable, "Lost Cousins Referrals");
            dgLCReferrals.AutoGenerateColumns = false;
            ExtensionMethods.DoubleBuffered(dgLCReferrals, true);
            CensusSettingsUI.CompactCensusRefChanged += new EventHandler(RefreshCensusReferences);
            Predicate <Individual> lostCousinsFact  = new Predicate <Individual>(x => x.HasLostCousinsFact);
            List <Individual>      lostCousinsFacts = ft.AllIndividuals.Filter(lostCousinsFact).ToList <Individual>();

            referrals = new List <ExportReferrals>();
            foreach (Individual ind in lostCousinsFacts)
            {
                List <Fact> indLCFacts = new List <Fact>();
                indLCFacts.AddRange(ind.GetFacts(Fact.LOSTCOUSINS));
                indLCFacts.AddRange(ind.GetFacts(Fact.LC_FTA));
                foreach (Fact f in indLCFacts)
                {
                    if ((onlyInCommon && ind.IsBloodDirect) || !onlyInCommon)
                    {
                        referrals.Add(new ExportReferrals(ind, f));
                    }
                }
            }
            reportFormHelper.LoadColumnLayout("LCReferralsColumns.xml");
            tsRecords.Text = GetCountofRecords();
        }
示例#3
0
 private void SetupFacts(string extraText = "")
 {
     dgFacts.DataSource = facts;
     reportFormHelper.LoadColumnLayout("FactsColumns.xml");
     tsRecords.Text = facts.Count + " Records " + extraText;
     SetBackColour();
 }
示例#4
0
        public void SetupNoChildrenStatus()
        {
            SortableBindingList <IDisplayFamily> results  = new SortableBindingList <IDisplayFamily>();
            IEnumerable <CensusFamily>           toSearch = ft.GetAllCensusFamilies(CensusDate.UKCENSUS1911, true, true);

            foreach (Family fam in toSearch)
            {
                if (fam.On1911Census && !fam.HasAnyChildrenStatus && fam.BothParentsAlive(CensusDate.UKCENSUS1911) && fam.FamilyID != Family.PRE_MARRIAGE)
                {
                    results.Add(fam);
                }
            }
            reportType                     = ReportType.MissingChildrenStatus;
            dgFamilies.DataSource          = results;
            splitContainer.Panel1Collapsed = true;
            splitContainer.Panel2Collapsed = false;
            famReportFormHelper.LoadColumnLayout("ChildrenStatusFamColumns.xml");
            SetSaveButtonsStatus(true);
            this.Text = "Families with a 1911 census record but no Children Status record showing Children Alive/Dead";
            UpdateStatusCount();
        }
示例#5
0
 void AddSources(DisplayFact fact)
 {
     foreach (FactSource s in fact.Sources)
     {
         if (!sources.Contains(s))
         {
             sources.Add(s);
         }
     }
     dgSources.DataSource = sources;
     reportFormHelper.LoadColumnLayout("SourcesColumns.xml");
     tsRecords.Text = sources.Count + " Records";
 }
示例#6
0
        //void CompareLists(List<CensusIndividual> individuals, List<Individual> listToCheck)
        //{
        //    List<string> ids = individuals.Select(x => x.IndividualID).ToList();
        //    List<Individual> missing = new List<Individual>();
        //    foreach(Individual ind in listToCheck)
        //    {
        //        if (!ids.Contains(ind.IndividualID))
        //            missing.Add(ind);
        //    }
        //}

        void SetupDataGridView(bool censusDone, List <CensusIndividual> individuals)
        {
            dgCensus.DataSource = new SortableBindingList <IDisplayCensus>(individuals);
            if (!censusDone)
            {
                dgCensus.Columns["CensusReference"].Visible = false;
            }
            reportFormHelper.LoadColumnLayout("CensusColumns.xml");
            int numIndividuals = (from x in individuals select x.IndividualID).Distinct().Count();
            int numFamilies    = (from x in individuals select x.FamilyID).Distinct().Count();

            tsRecords.Text = $"{individuals.Count} Rows containing {numIndividuals} Individuals and {numFamilies} Families. {CensusProviderText()}";
        }
示例#7
0
        public void SetupChildrenStatusReport()
        {
            SortableBindingList <IDisplayChildrenStatus> results = new SortableBindingList <IDisplayChildrenStatus>();
            IEnumerable <CensusFamily> toSearch = ft.GetAllCensusFamilies(CensusDate.UKCENSUS1911, true, true);

            foreach (CensusFamily fam in toSearch)
            {
                if (fam.On1911Census && fam.HasGoodChildrenStatus && !fam.FamilyType.Equals(Family.SOLOINDIVIDUAL) && !fam.FamilyType.Equals(Family.PRE_MARRIAGE) &&
                    (fam.ExpectedTotal != fam.ChildrenTotal || fam.ExpectedAlive != fam.ChildrenAlive || fam.ExpectedDead != fam.ChildrenDead))
                {
                    results.Add(fam);
                }
            }
            reportType                     = ReportType.MismatchedChildrenStatus;
            dgFamilies.DataSource          = results;
            splitContainer.Panel1Collapsed = true;
            splitContainer.Panel2Collapsed = false;
            famReportFormHelper.LoadColumnLayout("ChildrenStatusFamColumns.xml");
            SetSaveButtonsStatus(true);
            Text = "1911 Census Families where the children status recorded doesn't match the children in tree";
            UpdateStatusCount();
        }
示例#8
0
        public ColourBMD(List <IDisplayColourBMD> reportList)
        {
            InitializeComponent();
            dgBMDReportSheet.AutoGenerateColumns = false;

            this.reportList  = new SortableBindingList <IDisplayColourBMD>(reportList);
            reportFormHelper = new ReportFormHelper(this, "Colour BMD Report", dgBMDReportSheet, this.ResetTable, "Colour BMD");
            ExtensionMethods.DoubleBuffered(dgBMDReportSheet, true);

            boldFont = new Font(dgBMDReportSheet.DefaultCellStyle.Font, FontStyle.Bold);
            styles   = new Dictionary <BMDColour, DataGridViewCellStyle>();
            DataGridViewCellStyle notRequired = new DataGridViewCellStyle();

            notRequired.BackColor = notRequired.ForeColor = Color.DarkGray;
            styles.Add(BMDColour.EMPTY, notRequired);
            DataGridViewCellStyle missingData = new DataGridViewCellStyle();

            missingData.BackColor = missingData.ForeColor = Color.Red;
            styles.Add(BMDColour.UNKNOWN_DATE, missingData);
            DataGridViewCellStyle openEndedDateRange = new DataGridViewCellStyle();

            openEndedDateRange.BackColor = openEndedDateRange.ForeColor = Color.OrangeRed;
            styles.Add(BMDColour.OPEN_ENDED_DATE, openEndedDateRange);
            DataGridViewCellStyle verywideDateRange = new DataGridViewCellStyle();

            verywideDateRange.BackColor = verywideDateRange.ForeColor = Color.Tomato;
            styles.Add(BMDColour.VERY_WIDE_DATE, verywideDateRange);
            DataGridViewCellStyle wideDateRange = new DataGridViewCellStyle();

            wideDateRange.BackColor = wideDateRange.ForeColor = Color.Orange;
            styles.Add(BMDColour.WIDE_DATE, wideDateRange);
            DataGridViewCellStyle narrowDateRange = new DataGridViewCellStyle();

            narrowDateRange.BackColor = narrowDateRange.ForeColor = Color.Yellow;
            styles.Add(BMDColour.NARROW_DATE, narrowDateRange);
            DataGridViewCellStyle justYearDateRange = new DataGridViewCellStyle();

            justYearDateRange.BackColor = justYearDateRange.ForeColor = Color.YellowGreen;
            styles.Add(BMDColour.JUST_YEAR_DATE, justYearDateRange);
            DataGridViewCellStyle approxDate = new DataGridViewCellStyle();

            approxDate.BackColor = approxDate.ForeColor = Color.PaleGreen;
            styles.Add(BMDColour.APPROX_DATE, approxDate);
            DataGridViewCellStyle exactDate = new DataGridViewCellStyle();

            exactDate.BackColor = exactDate.ForeColor = Color.LawnGreen;
            styles.Add(BMDColour.EXACT_DATE, exactDate);
            DataGridViewCellStyle noSpouse = new DataGridViewCellStyle();

            noSpouse.BackColor = noSpouse.ForeColor = Color.LightPink;
            styles.Add(BMDColour.NO_SPOUSE, noSpouse);
            DataGridViewCellStyle hasChildren = new DataGridViewCellStyle();

            hasChildren.BackColor = hasChildren.ForeColor = Color.LightCoral;
            styles.Add(BMDColour.NO_PARTNER, hasChildren);
            DataGridViewCellStyle noMarriage = new DataGridViewCellStyle();

            noMarriage.BackColor = noMarriage.ForeColor = Color.Firebrick;
            styles.Add(BMDColour.NO_MARRIAGE, noMarriage);
            DataGridViewCellStyle isLiving = new DataGridViewCellStyle();

            isLiving.BackColor = isLiving.ForeColor = Color.WhiteSmoke;
            styles.Add(BMDColour.ISLIVING, isLiving);
            DataGridViewCellStyle over90 = new DataGridViewCellStyle();

            over90.BackColor = over90.ForeColor = Color.DarkGray;
            styles.Add(BMDColour.OVER90, over90);

            birthColumnIndex            = dgBMDReportSheet.Columns["Birth"].Index;
            burialColumnIndex           = dgBMDReportSheet.Columns["CremBuri"].Index;
            dgBMDReportSheet.DataSource = this.reportList;
            reportFormHelper.LoadColumnLayout("ColourBMDColumns.xml");
            tsRecords.Text = Properties.Messages.Count + reportList.Count + " records listed.";
            string defaultProvider = (string)Application.UserAppDataRegistry.GetValue("Default Search Provider");

            if (defaultProvider == null)
            {
                defaultProvider = "FamilySearch";
            }
            if (defaultProvider.Equals("FreeCen"))
            {
                defaultProvider = "FreeBMD";
            }
            cbBMDSearchProvider.Text = defaultProvider;
            cbFilter.Text            = "All Individuals";
        }