Ejemplo n.º 1
0
        private void DeleteHost_Click(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            BO.Host host = (BO.Host)(button.DataContext);
            if (host.Status == BO.Status.INACTIVE)
            {
                MessageBox.Show("המארח כבר נמחק מהמערכת");
                return;
            }
            MessageBoxResult mbr = MessageBox.Show("אתה בטוח שברצונך למחוק?", "הודעה", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No, MessageBoxOptions.RtlReading);

            if (mbr == MessageBoxResult.No)
            {
                return;
            }
            try
            {
                host.Status = BO.Status.INACTIVE;
                bl.UpdateHost(host);
                Hosts = bl.GetHosts().ToList();
                HsotsList.ItemsSource = Hosts;
            }
            catch (MissingMemberException exp)
            {
                MessageBox.Show(exp.Message);
            }
            catch (InvalidOperationException exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Ejemplo n.º 2
0
 public HostingUnisPage(BlApi.IBl bl, BO.Host host)
 {
     InitializeComponent();
     this.bl   = bl;
     this.Host = host;
     HostId    = Host.Person.Id;
     MainListBox.ItemsSource = Host.HostingUnits;
 }
Ejemplo n.º 3
0
 public NewHostPage(BlApi.IBl bl, BO.Host host)
 {
     InitializeComponent();
     this.bl                 = bl;
     this.Host               = host;
     this.DataContext        = Host;
     NewHostGrid.DataContext = Host;
     CreateXMLBankFiles();
     bankNameComboBox.ItemsSource = BankNumberDictionary.Values;
     host.BankBranch = new BO.BankBranch();
 }
Ejemplo n.º 4
0
 public MainOrdrerPage(BlApi.IBl bl, BO.Host host)
 {
     InitializeComponent();
     this.host = host;
     this.bl   = bl;
     myListview.ItemsSource = this.host.Orders;
     mailSend                     = new BackgroundWorker();
     hostID                       = this.host.Person.Id;
     mailSend.DoWork             += MailSend_DoWork;
     mailSend.RunWorkerCompleted += MailSend_RunWorkerCompleted;
 }
Ejemplo n.º 5
0
 public OrdersPage(BlApi.IBl bl, BO.Host host, ListView MyOrderListView)
 {
     InitializeComponent();
     this.bl   = bl;
     this.host = host;
     Requests  = bl.GetGetGuestRequestsExceptHostGr(host.Person.Id).ToList();
     this.host = host;
     hostID    = this.host.Person.Id;
     MainListBox.ItemsSource = Requests;
     mailSend   = new BackgroundWorker();
     myListview = MyOrderListView;
 }
Ejemplo n.º 6
0
 public AddHostingUnitPage(BlApi.IBl bl, BO.Host host, ListBox listBox)
 {
     InitializeComponent();
     Host                  = host;
     HostingUnit           = new BO.HostingUnit();
     HostingUnit.Diary     = new bool[12, 31];
     AddHUGrid.DataContext = HostingUnit;
     LB      = listBox;
     this.bl = bl;
     // areaComboBox.ItemsSource = BO.MyDictionary.Locations.Select(x=>BO.MyDictionary.TranslateE(x));
     areaComboBox.ItemsSource = MyDictionary.Locations.Select(x => MyDictionary.TranslateEnumToString(x));
 }
Ejemplo n.º 7
0
 private void HostButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         currentHost = bl.GetHost(CurrentPerson.Id);
         NavigationService.Navigate(new MainHostPage(bl, currentHost));
     }
     catch (MissingMemberException ex)
     {
         MessageBox.Show("עלייך להשלים פרטים אם הינך מעוניין להמשיך כמארח", "הודעה", MessageBoxButton.OK, MessageBoxImage.Information);
         currentHost        = new BO.Host();
         currentHost.Person = CurrentPerson;
         NavigationService.Navigate(new NewHostPage(bl, currentHost));
     }
 }
Ejemplo n.º 8
0
 public MainHostPage(BlApi.IBl bl, BO.Host host)
 {
     InitializeComponent();
     this.bl   = bl;
     this.Host = host;
     UpdateHostGrid.DataContext = Host;
     HostId = Host.Person.Id;
     try
     {
         this.Host.HostingUnits = bl.GetHostingUnitsOfHost(HostId);
         this.Host.Orders       = bl.GetOrdersOfHost(HostId);
     }
     catch
     {
         this.Host.HostingUnits = new List <BO.HostingUnit>();
         this.Host.Orders       = new List <BO.Order>();
     }
 }