示例#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);
            }
        }
示例#2
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     MainWindow.IsEmpty(Commission_textbok.Text);
     MainWindow.IsInt(Commission_textbok.Text);
     BE.Configuration.Commission = Int32.Parse(Commission_textbok.Text);
     this.Close();
 }
        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);
            }
        }
        private void ___FinedGuestRequest_Button__Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MainWindow.IsEmpty(___GuestRequest_key_textbox_.Text);
                MainWindow.IsInt(___GuestRequest_key_textbox_.Text);

                myIBL = BL.Factory.GetBL();
                int temp = Int32.Parse(___GuestRequest_key_textbox_.Text);
                guestRequest = myIBL.SearchGetGuestRequestByKey(temp);
                if (MessageBox.Show("Are you sure you want to delete?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
                {
                    this.Close();
                }
                else
                {
                    myIBL.DeleteGuestRequests(guestRequest);
                    this.Close();
                    MessageBox.Show("the guest Request have beet deleted");
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MainWindow.IsEmpty(HostNum.Text);
                MainWindow.IsEmpty(Passward.Password);
                MainWindow.IsInt(HostNum.Text);
                MainWindow.IsInt(Passward.Password);
                ibl = BL.Factory.GetBL();
                // BE.Host host = new BE.Host();
                Window HostEntryWindow = new HostEntryWindow();
                host             = ibl.SearchForHostByKey(Int32.Parse(HostNum.Text));
                this.DataContext = host;
                if (host.password == Int32.Parse(Passward.Password))
                {
                    HostEntryWindow.Show();
                    this.Close();
                }

                else
                {
                    MessageBox.Show("One of the detalis is not corect");
                }
            }
            catch (Exception E) { MessageBox.Show(E.Message); }
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         double Commission;
         if (MainWindow.IsEmpty(guestRequestKeyTextBox.Text))
         {
             if (MainWindow.IsEmpty(hostingUnitKeyTextBox.Text))
             {
                 bl = BL.Factory.GetBL();
             }
         }
         bl.CheakDatesAreFree(bl.GetHostingUnitFromOrder(order), bl.GetGuestRequestFromOrder(order).EntryDate, bl.GetGuestRequestFromOrder(order).EndDate);
         if ((int)this.statusComboBox.SelectedItem == 2)
         {
             Commission = bl.updateStatusOfOrder(order, (int)this.statusComboBox.SelectedItem);
             MessageBox.Show("your details update successfully ." +
                             "Commission is:" + Commission);
         }
         else
         {
             MessageBox.Show("your details update successfully .");
         }
     }
     catch (Exception E) { MessageBox.Show(E.Message); }
 }
示例#7
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                bl = BL.Factory.GetBL();
                MainWindow.IsEmpty(guestRequestCB.Text);

                bl.UpdateHostingUnit(hostingUnit);
                MessageBox.Show("your detail have been update  ");
            }
            catch (Exception E) { MessageBox.Show(E.ToString()); }
        }
        private void ___FinedGuestRequest_Button__Click(object sender, RoutedEventArgs e)
        {
            try
            {
                myIBL = BL.Factory.GetBL();

                MainWindow.IsEmpty(___GuestRequest_key_textbox_.Text);
                MainWindow.IsInt(___GuestRequest_key_textbox_.Text);

                int temp = Int32.Parse(___GuestRequest_key_textbox_.Text);
                guestRequest = myIBL.SearchGetGuestRequestByKey(temp);

                Window Update_Guest_Request = new Update_Guest_Request();
                Update_Guest_Request.Show();
                this.Close();
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
        }
示例#9
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (MainWindow.IsEmpty(Delete_Textbox.Text))
                {
                    if (MainWindow.IsInt(Delete_Textbox.Text))
                    {
                        myIBL.DeleteHost(myIBL.SearchForHostByKey(Int32.Parse(Delete_Textbox.Text)));
                    }
                }
                MessageBox.Show("Deleted successfully.");
                this.Close();

                Window Manger_Hosts_win = new Manger_Hosts_win();
                Manger_Hosts_win.Show();
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
        }
示例#10
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MainWindow.IsEmpty(Password_box.Password);



                if (BE.Configuration.getMangerPassword() == (Password_box.Password))
                {
                    Window MangerEntryWindow = new MangerEntryWindow();
                    MangerEntryWindow.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Password incorrect.");
                    Password_box.Clear();
                }
            }
            catch (Exception E) { MessageBox.Show(E.ToString()); }
        }