Example #1
0
 public PersonSelector(Family siblings)
 {
     InitializeComponent();
     data = SedgeTreeMemoryCardEmulation.GetInstance().GetData();
     foreach (Person member in siblings)
     {
         comboBox1.Items.Add(member);
         comboBox1.SelectedItem = member;
     }
 }
Example #2
0
 public PersonSelector(Gender g)
 {
     InitializeComponent();
     data = SedgeTreeMemoryCardEmulation.GetInstance().GetData();
     foreach (Person member in data)
     {
         if (member.gender == g)
         {
             comboBox1.Items.Add(member);
             comboBox1.SelectedItem = member;
         }
     }
 }
Example #3
0
        public Editor(Person _t)
        {
            data = SedgeTreeMemoryCardEmulation.GetInstance().GetData();
            AzusaContext context = AzusaContext.GetInstance();

            target = _t;
            InitializeComponent();
            UpdateView(_t);


            byte[] buffer = context.DatabaseDriver.SedgeTree_GetPhotoByPerson(_t);
            if (buffer != null)
            {
                pictureBox1.Image = Image.FromStream(new System.IO.MemoryStream(buffer));
            }

            button2.Enabled = data.ContainsFemales;
            button3.Enabled = data.ConatinsMales;
        }
Example #4
0
        public Checker()
        {
            InitializeComponent();
            context   = AzusaContext.GetInstance();
            this.Text = "Konsistenzprüfung " + DateTime.Now;
            int       cons = 0;
            Bloodline data = SedgeTreeMemoryCardEmulation.GetInstance().GetData();

            foreach (Person p in data)
            {
                if (!p.consistent)
                {
                    if (p.birthplace == "")
                    {
                        AddEntry(p.FullName + " hat keinen Geburtsort!");
                    }
                    if (p.born == DateTime.MinValue)
                    {
                        AddEntry(p.FullName + " hat kein Geburtsdatum!");
                    }
                    else
                    {
                        DateTime maximumTheoreticalAge = DateTime.Now;
                        if (p.died != DateTime.MinValue)
                        {
                            maximumTheoreticalAge = p.died;
                        }
                        TimeSpan age_check = maximumTheoreticalAge - p.born;
                        int      year      = age_check.Days / 365;
                        if (year > 100)
                        {
                            AddEntry(p.FullName + " ist anscheinend " + year.ToString() + " Jahre alt. Stimmt das?");
                        }
                    }
                    if (p.father == null)
                    {
                        AddEntry(p.FullName + " hat keinen Vater!");
                    }
                    if (p.forename == "")
                    {
                        AddEntry(p.FullName + " hat keinen Vornamen!");
                    }
                    if (p.gender == Gender.DontCare)
                    {
                        AddEntry(p.FullName + " hat kein Geschlecht!");
                    }
                    if (p.mother == null)
                    {
                        AddEntry(p.FullName + " hat keine Mutter!");
                    }
                    if (p.surname == "")
                    {
                        AddEntry(p.FullName + " hat keinen Nachnamen!");
                    }
                    if (!CheckPhoto(p))
                    {
                        AddEntry(p.FullName + " hat kein Foto!");
                    }
                    cons++;
                }
            }
            if (cons == data.Count)
            {
                AddEntry("Es existiert kein konsistenter Datensatz!");
            }
            Person target   = null;
            int    branches = 0;

            foreach (Person p in data)
            {
                if (p.Generations > branches)
                {
                    target   = p;
                    branches = p.Generations;
                }
            }
            if (branches < 3)
            {
                AddEntry("Es gibt weniger als drei bekannte Generationen.");
            }
        }
Example #5
0
 public void OnLoad()
 {
     memoryCard = SedgeTreeMemoryCardEmulation.GetInstance();
     UpdateDate();
 }