Esempio n. 1
0
 private void DgCensus_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && dgCensus.CurrentRow != null && !CensusDate.VALUATIONROLLS.Contains(CensusDate))
     {
         CensusIndividual ds = (CensusIndividual)dgCensus.CurrentRow.DataBoundItem;
         FamilyTree       ft = FamilyTree.Instance;
         if (Control.ModifierKeys.Equals(Keys.Shift))
         {
             Facts factForm = new Facts(ds);
             MainForm.DisposeDuplicateForms(factForm);
             factForm.Show();
         }
         else
         {
             try
             {
                 ft.SearchCensus(censusCountry, CensusDate.StartDate.Year, ds, cbCensusSearchProvider.SelectedIndex);
             }
             catch (CensusSearchException ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
     }
 }
Esempio n. 2
0
 private void dgFamilies_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
     {
         string famID = (string)dgFamilies.CurrentRow.Cells["FamilyID"].Value;
         Family fam   = ft.GetFamily(famID);
         if (fam != null)
         {
             if ((reportType == ReportType.MismatchedChildrenStatus || reportType == ReportType.MissingChildrenStatus) && ModifierKeys.Equals(Keys.Shift))
             {
                 List <IDisplayColourCensus> list = fam.Members.ToList <IDisplayColourCensus>();
                 ColourCensus rs = new ColourCensus(Countries.UNITED_KINGDOM, list);
                 MainForm.DisposeDuplicateForms(rs);
                 rs.Show();
                 rs.Focus();
             }
             else
             {
                 Facts factForm = new Facts(fam);
                 MainForm.DisposeDuplicateForms(factForm);
                 factForm.Show();
             }
         }
     }
 }
Esempio n. 3
0
 void DgSources_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
     {
         FactSource source   = (FactSource)dgSources.CurrentRow.DataBoundItem;
         Facts      factForm = new Facts(source);
         MainForm.DisposeDuplicateForms(factForm);
         factForm.Show();
     }
 }
Esempio n. 4
0
 private void mnuViewFacts_Click(object sender, EventArgs e)
 {
     if (dgCensus.CurrentRow != null)
     {
         CensusIndividual ds       = (CensusIndividual)dgCensus.CurrentRow.DataBoundItem;
         Facts            factForm = new Facts(ds);
         MainForm.DisposeDuplicateForms(factForm);
         factForm.Show();
     }
 }
Esempio n. 5
0
 private void MnuViewFacts_Click(object sender, EventArgs e)
 {
     if (dgBMDReportSheet.CurrentRow != null)
     {
         IDisplayColourBMD ds       = (IDisplayColourBMD)dgBMDReportSheet.CurrentRow.DataBoundItem;
         Individual        ind      = FamilyTree.Instance.GetIndividual(ds.IndividualID);
         Facts             factForm = new Facts(ind);
         MainForm.DisposeDuplicateForms(factForm);
         factForm.Show();
     }
 }
Esempio n. 6
0
 private void dgIndividuals_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
     {
         string     indID    = (string)dgIndividuals.CurrentRow.Cells["IndividualID"].Value;
         Individual ind      = ft.GetIndividual(indID);
         Facts      factForm = new Facts(ind);
         MainForm.DisposeDuplicateForms(factForm);
         factForm.Show();
     }
 }
Esempio n. 7
0
 void DgReportSheet_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         FamilyTree ft = FamilyTree.Instance;
         if (e.ColumnIndex >= birthColumnIndex && e.ColumnIndex <= burialColumnIndex)
         {
             DataGridViewCell cell  = dgBMDReportSheet.Rows[e.RowIndex].Cells[e.ColumnIndex];
             BMDColours       value = (BMDColours)cell.Value;
             if (value != BMDColours.EXACT_DATE)
             {
                 IDisplayColourBMD person = (IDisplayColourBMD)dgBMDReportSheet.Rows[e.RowIndex].DataBoundItem;
                 Individual        ind    = ft.GetIndividual(person.IndividualID);
                 if (e.ColumnIndex == birthColumnIndex || e.ColumnIndex == birthColumnIndex + 1)
                 {
                     ft.SearchBMD(FamilyTree.SearchType.BIRTH, ind, ind.BirthDate, cbBMDSearchProvider.SelectedIndex, cbRegion.Text, null);
                 }
                 else if (e.ColumnIndex >= birthColumnIndex + 2 && e.ColumnIndex <= birthColumnIndex + 4)
                 {
                     FactDate   marriageDate = FactDate.UNKNOWN_DATE;
                     Individual spouse       = null;
                     if (e.ColumnIndex == birthColumnIndex + 2)
                     {
                         marriageDate = ind.FirstMarriageDate;
                         spouse       = ind.FirstSpouse;
                     }
                     if (e.ColumnIndex == birthColumnIndex + 3)
                     {
                         marriageDate = ind.SecondMarriageDate;
                         spouse       = ind.SecondSpouse;
                     }
                     if (e.ColumnIndex == birthColumnIndex + 4)
                     {
                         marriageDate = ind.ThirdMarriageDate;
                         spouse       = ind.ThirdSpouse;
                     }
                     ft.SearchBMD(FamilyTree.SearchType.MARRIAGE, ind, marriageDate, cbBMDSearchProvider.SelectedIndex, cbRegion.Text, spouse);
                 }
                 else if (e.ColumnIndex == burialColumnIndex || e.ColumnIndex == burialColumnIndex - 1)
                 {
                     ft.SearchBMD(FamilyTree.SearchType.DEATH, ind, ind.DeathDate, cbBMDSearchProvider.SelectedIndex, cbRegion.Text, null);
                 }
             }
         }
         else if (e.ColumnIndex >= 0)
         {
             string     indID    = (string)dgBMDReportSheet.CurrentRow.Cells["IndividualID"].Value;
             Individual ind      = ft.GetIndividual(indID);
             Facts      factForm = new Facts(ind);
             factForm.Show();
         }
     }
 }
Esempio n. 8
0
 private void DgFacts_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
     {
         DisplayFact f = dgFacts.Rows[e.RowIndex].DataBoundItem as DisplayFact;
         if (f.Fact.FactType == Fact.REPORT)
         {
             Facts person = new Facts(f.Ind);
             person.Show();
         }
         else
         {
             Sources sourceForm = new Sources(f);
             sourceForm.Show();
         }
     }
 }
Esempio n. 9
0
 private void dgReportSheet_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         FamilyTree ft = FamilyTree.Instance;
         if (e.ColumnIndex >= startColumnIndex && e.ColumnIndex <= endColumnIndex)
         {
             DataGridViewCell cell = dgReportSheet.Rows[e.RowIndex].Cells[e.ColumnIndex];
             int value             = (int)cell.Value;
             if (value >= 1 && value <= 7) // allows any type of record to search census
             {
                 IDisplayColourCensus person = (IDisplayColourCensus)dgReportSheet.Rows[e.RowIndex].DataBoundItem;
                 int censusYear;
                 if (country.Equals(Countries.UNITED_STATES))
                 {
                     censusYear = (1790 + (e.ColumnIndex - startColumnIndex) * 10);
                 }
                 else if (country.Equals(Countries.CANADA))
                 {
                     if (e.ColumnIndex <= dgReportSheet.Columns["Can1901"].Index)
                     {
                         censusYear = (1851 + (e.ColumnIndex - startColumnIndex) * 10);
                     }
                     else
                     {
                         censusYear = (1901 + (e.ColumnIndex - dgReportSheet.Columns["Can1901"].Index) * 5);
                     }
                 }
                 else if (country.Equals(Countries.IRELAND))
                 {
                     censusYear = (1901 + (e.ColumnIndex - startColumnIndex) * 10);
                 }
                 else
                 {
                     if (e.ColumnIndex == C1939.Index)
                     {
                         censusYear = 1939;
                     }
                     else
                     {
                         censusYear = (1841 + (e.ColumnIndex - startColumnIndex) * 10);
                     }
                 }
                 string censusCountry = person.BestLocation(new FactDate(censusYear.ToString())).CensusCountry;
                 if (censusYear == 1939 && !cbCensusSearchProvider.SelectedItem.Equals("Find My Past"))
                 {
                     MessageBox.Show("Unable to search the 1939 National Register on " + cbCensusSearchProvider.SelectedItem + ".", "FTAnalyzer");
                 }
                 else
                 {
                     ft.SearchCensus(censusCountry, censusYear, ft.GetIndividual(person.IndividualID), cbCensusSearchProvider.SelectedIndex);
                 }
             }
         }
         else if (e.ColumnIndex >= 0)
         {
             string     indID    = (string)dgReportSheet.CurrentRow.Cells["IndividualID"].Value;
             Individual ind      = ft.GetIndividual(indID);
             Facts      factForm = new Facts(ind);
             factForm.Show();
         }
     }
 }