示例#1
0
 private void Button_Click_3(object sender, RoutedEventArgs e)//remove unit
 {
     try
     {
         HostingUnit unit = (HostingUnit)(unitCB.SelectedItem);
         if (unit == null)
         {
             throw new NullReferenceException("לא נבחרה יחידת אירוח");
         }
         myBL.removeHostingUnit(unit.HostingUnitKey);
         hostWin win = new hostWin(myHost);
         this.Close();
         win.ShowDialog();
         unitCB.ItemsSource = myBL.getUnitsForHost(myHost);
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
示例#2
0
 private void Button_Click_2(object sender, RoutedEventArgs e)//enter
 {
     try
     {
         Host host = (Host)(lv.SelectedItem);
         if (host == null)
         {
             throw new NullReferenceException("לא נבחר מארח");
         }
         if (!host.CheckPassword(password.Password))
         {
             throw new wrongPasswordException("סיסמא שגויה");
         }
         hostWin win = new hostWin(host);
         this.Close();
         win.ShowDialog();
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }