public GuestRequestWindow(Guest guest)
        {
            InitializeComponent();

            bl            = SingletonFactoryBL.GetBL();
            errorMessages = new List <string>();

            entryDateDatePicker.SelectedDate = DateTime.Now;

            guestRequest = new GuestRequest();
            guestRequest.VacationProperties = new VacationProperties();
            guestRequest.Guest = guest;

            addGRGrid.DataContext = guestRequest;

            typeComboBox.ItemsSource   = Enum.GetValues(typeof(BE.VacationType));
            areaComboBox.ItemsSource   = Enum.GetValues(typeof(BE.Area));
            gardenComboBox.ItemsSource = Enum.GetValues(typeof(BE.Extension));
            bBQComboBox.ItemsSource    = Enum.GetValues(typeof(BE.Extension));
            childernAttractionsComboBox.ItemsSource = Enum.GetValues(typeof(BE.Extension));
            jacuzziComboBox.ItemsSource             = Enum.GetValues(typeof(BE.Extension));
            nearbyKosherFoodComboBox.ItemsSource    = Enum.GetValues(typeof(BE.Extension));
            nearbyRestaurantComboBox.ItemsSource    = Enum.GetValues(typeof(BE.Extension));
            nearbySynagogueComboBox.ItemsSource     = Enum.GetValues(typeof(BE.Extension));
            poolComboBox.ItemsSource = Enum.GetValues(typeof(BE.Extension));

            guestRequest.EntryDate   = DateTime.Today;
            guestRequest.ReleaseDate = DateTime.Today.AddDays(1);
        }
Exemplo n.º 2
0
        public Login()
        {
            InitializeComponent();

            Lang.ItemsSource = new List <string> {
                "English", "עברית"
            };

            if (ContainsEnglish(username.Text))
            {
                Lang.SelectedIndex = 0;
            }
            else
            {
                Lang.SelectedIndex = 1;
            }

            try
            {
                bl = SingletonFactoryBL.GetBL();
            }
            catch (BlFileErrorException)
            {
                MessageBox.Show("There was a problem with the files!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                Exit_Click(null, null);
            }

            bl.ActivateExpiredOrdersThread();
        }
Exemplo n.º 3
0
        public WatchOrdersWindow(Host host)
        {
            InitializeComponent();

            this.host = host;
            bl        = SingletonFactoryBL.GetBL();

            orderDataGrid.ItemsSource = bl.GetOrdersOfHost(this.host);
        }
Exemplo n.º 4
0
        public WatchHostingUnitWindow(Host host)
        {
            InitializeComponent();

            bl        = SingletonFactoryBL.GetBL();
            this.host = host;

            hostingUnitDataGrid.ItemsSource = bl.GetHostingUnitsOfHost(host);
        }
Exemplo n.º 5
0
        public AddOrderWindow(Host host)
        {
            InitializeComponent();

            this.host = host;
            bl        = SingletonFactoryBL.GetBL();

            HostingUnits.ItemsSource         = bl.GetHostingUnitsOfHost(host);
            guestRequestDataGrid.ItemsSource = GetRequestsSuitableHostingUnit();
        }
        public GuestRequestsStatsWindow()
        {
            InitializeComponent();

            bl = SingletonFactoryBL.GetBL();
            GroupByComboBox.ItemsSource = new List <string> {
                "None", "Area", "Number Of Vacationers", "Type", "Entry Date", "Release Date"
            };
            guestRequestsDataGrid.ItemsSource = bl.GetGuestRequests();
        }
Exemplo n.º 7
0
        public WatchOfferedHostingUnitWindow(Guest guest)
        {
            InitializeComponent();
            this.guest = guest;
            bl         = SingletonFactoryBL.GetBL();

            offers = new ObservableCollection <Order>(bl.GetOrders().FindAll(x =>
                                                                             bl.GetGuestRequests().FindAll(y => (y.GuestRequestKey == x.GuestRequestKey) && (y.Guest == guest)).FirstOrDefault() != null));
            OffersGrid.ItemsSource = offers;
        }
        public UsersStatsWindow()
        {
            InitializeComponent();

            bl = SingletonFactoryBL.GetBL();
            GroupByComboBox.ItemsSource = new List <string> {
                "None", "First Name", "Last Name", "Registration Date",
                "Type", "Finished Registration"
            };
            userDataGrid.ItemsSource = bl.GetUsers();
        }
        public OrdersStatsWindow()
        {
            InitializeComponent();

            bl = SingletonFactoryBL.GetBL();
            GroupByComboBox.ItemsSource = new List <string> {
                "None", "Hosting Unit Key", "Guest Request Key", "Status"
            };

            //ordersDataGrid.ItemsSource = bl.GetOrders();
        }
        public HostRegistrationWindow(Host host)
        {
            InitializeComponent();

            this.host     = host;
            bl            = SingletonFactoryBL.GetBL();
            errorMessages = new List <string>();

            HostGrid.DataContext    = this.host;
            phoneNumberTextBox.Text = ""; // erase default value
        }
Exemplo n.º 11
0
        public static bool IsUserExist(string username, string password)
        {
            var user = (from item in SingletonFactoryBL.GetBL().GetUsers()
                        where item.Username == username && item.Password == password
                        select item).ToList();

            if (user.Count > 0)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 12
0
        /// <summary>
        ///
        /// </summary>
        public RegisterWindow()
        {
            InitializeComponent();

            newUser = new User();
            bl      = SingletonFactoryBL.GetBL();

            userDetailsGrid.DataContext = newUser;

            List <UserType> comboBoxValues = new List <UserType>();

            comboBoxValues.Add(UserType.Guest);
            comboBoxValues.Add(UserType.Host);
            typeOfUser.ItemsSource = comboBoxValues;
        }
Exemplo n.º 13
0
        public HostsStatsWindow()
        {
            InitializeComponent();

            bl = SingletonFactoryBL.GetBL();
            hostDataGrid.ItemsSource = bl.GetHosts();
            List <string> SearchBy = new List <string> {
                "Registration Date", "Username", "First Name", "Last Name", "Mail Address",
                "Phone Number", "Collection Clearance", "Finished Registration",
                "Bank Name", "Bank Account Number"
            };

            SearchByComboBox.ItemsSource = SearchBy;
            TFSearch.ItemsSource         = new List <string> {
                "Yes", "No"
            };
        }
Exemplo n.º 14
0
        public AddHostingUnitWindow(Host host)
        {
            InitializeComponent();

            this.host     = host;
            bl            = SingletonFactoryBL.GetBL();
            errorMessages = new List <string>();

            hostingUnit = new HostingUnit();
            vacProp     = new VacationProperties();

            NewUnitGrid.DataContext           = hostingUnit;
            VcationPropertiesGrid.DataContext = vacProp;

            areaComboBox.ItemsSource = Enum.GetValues(typeof(Area));
            typeComboBox.ItemsSource = Enum.GetValues(typeof(BE.VacationType));
        }
Exemplo n.º 15
0
        private void UpdateOrder_Click(object sender, RoutedEventArgs e)
        {
            OrderStatus orderStatus = (OrderStatus)statusComboBox.SelectedItem;

            try
            {
                SingletonFactoryBL.GetBL().UpdateOrder(order.OrderKey, orderStatus);
                Back_Click(null, null);
                Close();
            }
            catch (BlDealClosedException)
            {
                MessageBox.Show("You can't update status of closed order.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            catch (BlInvalidKeyException)
            {
                MessageBox.Show("There was a problem. Please try again later.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            catch (BlKeyNotFoundException)
            {
                MessageBox.Show("There was a problem. Please try again later.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Exemplo n.º 16
0
        public MoneyStatsWindow()
        {
            InitializeComponent();

            bl    = SingletonFactoryBL.GetBL();
            hosts = bl.GetHosts();

            double TotalDebt = 0;

            foreach (var host in hosts)
            {
                TotalDebt += GetDebt(host);
            }

            if (ContainsEnglish(Header.Content.ToString()))
            {
                MoneyEarned.Text = "You Earned " + TotalDebt + "$.";
            }
            else
            {
                MoneyEarned.Text = "." + TotalDebt + "$ הרווחת";
            }
        }
Exemplo n.º 17
0
 public static Host GetHost(int Id)
 {
     return(SingletonFactoryBL.GetBL().GetHosts().Find(item => item.HostKey == Id));
 }
Exemplo n.º 18
0
 public static User GetUser(string user)
 {
     return(SingletonFactoryBL.GetBL().GetUsers().Find(item => item.Username == user));
 }
        public ForgotPasswordWindow()
        {
            InitializeComponent();

            bl = SingletonFactoryBL.GetBL();
        }