Beispiel #1
0
        private void FinishGusetRequest_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MainWindow.IsEmpty(last_name_textbox.Text);
                MainWindow.IsEmpty(privte_Name_textbox.Text);

                MainWindow.IsEmpty(email_text_box.Text);
                MainWindow.IsValidEmailAddress(email_text_box.Text);

                //guestRequest.EndDate = this.calender.SelectedDates.Last;
                //guestRequest.GuestRequestKey = BE.Configuration.getNewGuestRequestKey();
                guestRequest.NumOfBeds = guestRequest.Adults + guestRequest.Children;
                ibl.NewGuestRequests(guestRequest);
                MessageBox.Show("guest request key is:" + guestRequest.GuestRequestKey.ToString());
                _myCollection.Add(guestRequest);

                guestRequest = new BE.GuestRequest();
                this.newGuestRequestGrid.DataContext = guestRequest;



                //++counter;
                //_myCollection.Add(new BE.GuestRequest() { FirstName = "item " + counter,
                //    LastName = "item " +  counter,
                //    IsLecturer = counter % 3 == 0 });
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
        }
        private void Add_Host_button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MainWindow.IsEmpty(familyNameTextBox.Text);
                MainWindow.IsValidEmailAddress(mailAddressTextBox.Text);
                MainWindow.IsEmpty(mailAddressTextBox.Text);
                MainWindow.IsEmpty(passwordTextBox.Text);
                MainWindow.IsEmpty(phoneNumberTextBox.Text);
                MainWindow.IsEmpty(privateNameTextBox.Text);

                bank.BankAccountNumber = Int32.Parse(Bank_Number_Textbox.Text);
                host.HostBankAccuont   = bank;
                host.HostKey           = BE.Configuration.getNewHostKey();
                myIBL.NewHost(host);
                MessageBox.Show("Host added Successfuly.  key: " + host.HostKey);
                this.Close();
                Window Manger_Hosts_win = new Manger_Hosts_win();
                Manger_Hosts_win.Show();
            }

            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
        }