Example #1
0
 private void ListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         IBL bl;
         bl = FactoryBL.IBLInstance;
         UpdateWindow a;
         int          ID;
         ID = ((Nanny)((ListView)(sender)).SelectedItem).ID;
         Nanny nanny = bl.GetNannyById(ID);
         a = new UpdateWindow(1, nanny, false);
         a.Show();
     }
     catch { }
 }
 private void ListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         IBL bl;
         bl = FactoryBL.IBLInstance;
         UpdateWindow a;
         int          ID;
         ID = ((Contract)((ListView)(sender)).SelectedItem).Contract_ID;
         Contract contr = bl.GetContractById(ID);
         a = new UpdateWindow(3, contr, false);
         a.Show();
     }
     catch { }
 }
 private void nannysoptiongrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         Nanny        nanny = bl.GetNannyById((int)nannysoptiongrid.SelectedItem);
         UpdateWindow a     = new UpdateWindow(1, nanny, false);
         a.Show();
         fr.Hide();
         a.Closed += new EventHandler(openwindow);
     }
     catch (Exception d)
     {
         throw d;
     }
 }
        public void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                UpdateWindow a;
                switch (Choosen)
                {
                case 0:
                    Mother mother = bl.GetMotherById(((Mother)listofAll.SelectedItem).ID);
                    a = new UpdateWindow(Choosen, mother);
                    a.Show();
                    this.Hide();
                    a.Closed += new EventHandler(openwindow);
                    break;

                case 1:
                    Nanny nanny = bl.GetNannyById(((Nanny)listofAll.SelectedItem).ID);
                    a = new UpdateWindow(Choosen, nanny);
                    a.Show();
                    this.Hide();
                    a.Closed += new EventHandler(openwindow);
                    break;

                case 2:
                    Child chil = bl.GetChildById(((Child)listofAll.SelectedItem).ID);
                    a = new UpdateWindow(Choosen, chil);
                    a.Show();
                    this.Hide();
                    a.Closed += new EventHandler(openwindow);
                    break;

                case 3:
                    Contract contract = bl.GetContractById(((Contract)listofAll.SelectedItem).Contract_ID);
                    a = new UpdateWindow(Choosen, contract);
                    a.Show();
                    this.Hide();
                    a.Closed += new EventHandler(openwindow);
                    break;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("No line was choosen", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
 private void listofMothers_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (listofMothers.SelectedItem == null)
     {
         return;
     }
     try
     {
         Mother       mothers = bl.GetMotherById((int)listofMothers.SelectedValue);
         UpdateWindow a       = new UpdateWindow(0, mothers, false);
         a.Show();
         fr.Hide();
         a.Closed += new EventHandler(openwindow);
     }
     catch (Exception d)
     {
         throw d;
     }
 }
 private void listofChildren_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (listofChildren.SelectedItem == null)
     {
         return;
     }
     try
     {
         Child        child = bl.GetChildById((int)listofChildren.SelectedValue);
         UpdateWindow a     = new UpdateWindow(2, child, false);
         a.Show();
         fr.Hide();
         a.Closed += new EventHandler(openwindow);
     }
     catch (Exception d)
     {
         throw d;
     }
 }