예제 #1
0
        public MotherOptions(int id)
        {
            InitializeComponent();
            instance    = BL_imp.GetInstance();//singelton
            r           = new Random();
            tofunctions = instance.getMother().Find(x => x.ID == id);
            idM         = tofunctions.ID;
            Selected    = instance.getNanny();

            Element_of_Nanny_Detailes = new NannyDetailes();
            foreach (Nanny item in Selected)
            {
                Grid_Detailes.Children.Add(Element_of_Nanny_Detailes.AddNannyDetailesGrid(item));
            }

            Number_of_nannies.Text += String.Format("We Find " + Selected.Count + " Nannies suit for you");
            lastClicked             = new Button();

            detailes.Content = String.Format(tofunctions.name.FirstName + " " + tofunctions.name.LastName);
        }
예제 #2
0
        private void suitableSort()
        {
            var toList = Grid_Detailes.Children.OfType <NannyDetailes>();

            Grid_Detailes.Children.RemoveRange(1, toList.Count());
            Number_of_nannies.ClearValue(TextBlock.TextProperty);
            if (Selected.Count != 0)
            {
                List <KeyValuePair <Nanny, int> > t = BLSorting.GetInstance().sortBySuitableDays(Selected, tofunctions);//why?
                Number_of_nannies.Text += String.Format("We Find " + Selected.Count + " Nannies suit for you");
                for (int i = 0; i < t.Count; i++)
                {
                    Grid_Detailes.Children.Add(Element_of_Nanny_Detailes.AddNannyDetailesGrid(t[i].Key));
                }
            }
            else
            {
                Number_of_nannies.Text += String.Format("Sorry, but there no Nannies suit for you");
            }
        }