コード例 #1
0
        protected override void OnClosed(EventArgs e)
        {
            Child           c   = BL_imp.GetInstance().getChild().Find(x => x.ID == (Detailes.DataContext as Child).ID);
            List <Contract> t   = BL_imp.GetInstance().getContract();
            Contract        con = t.Find(x => x.idChild == c.ID);
            Mother          m   = BL_imp.GetInstance().getMother().Find(x => x.ID == c.idMother);
            Nanny           n   = BL_imp.GetInstance().getNanny().Find(x => x.ID == con.idNanny);

            n.Stars = BeforeUpdate + c.stars;
            if (c.stars > 0 && childStars == 0)
            {
                n.peopleThatRating++;
            }
            if (c.stars == 0 && childStars != 0)
            {
                n.peopleThatRating--;
            }
            BL_imp.GetInstance().updateNanny(n);
            BL_imp.GetInstance().updateChild(c);
            Window w = Application.Current.Windows.OfType <MotherOptions>().First();

            Application.Current.Windows.OfType <DetailesWindow>().First().Close();
            Application.Current.Windows.OfType <MotherOptions>().First().Close();
            Window MotherOptions = new MotherOptions(m.ID);

            MotherOptions.Show();
            Window DetailesWindow = new DetailesWindow(m);

            DetailesWindow.Show();
        }
コード例 #2
0
        private void enter_Click(object sender, RoutedEventArgs e)
        {
            Window MotherOptions = new MotherOptions();

            MotherOptions.Show();
        }