private void UpdateRate(int numStars)//rating stars function
        {
            ImpBL bl  = ImpBL.Instance;
            int   Key = int.Parse(idLable.Content.ToString());

            HostingUnit hu = bl.GetHostingUnit(Key);

            hu.amountOfRaters++;
            hu.RateAmount += numStars;
            hu.RateStars   = hu.RateAmount / hu.amountOfRaters;
            bl.UpdateHostingUnit(hu);
            oneStarBTN.Visibility    = Visibility.Collapsed;
            twoStarBTN.Visibility    = Visibility.Collapsed;
            threeStarBTN.Visibility  = Visibility.Collapsed;
            FOURsTARbtn.Visibility   = Visibility.Collapsed;
            fiveStarBTN.Visibility   = Visibility.Collapsed;
            Thankyoulable.Visibility = Visibility.Visible;
        }
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            ImpBL       bl = ImpBL.Instance;
            HostingUnit hu = m_hostingUnit == null ? new HostingUnit() : m_hostingUnit;

            try
            {
                hu.HostingUnitName = HostinUnitNameTextBox.Text;
                if (hu.HostingUnitName == "")
                {
                    throw new TzimerException("Must enter a name for the unit!");
                }
                hu.Area    = (BE.Areas)AreaComboBox.SelectedIndex;
                hu.Type    = (BE.UnitType)AreaComboBox.SelectedIndex;
                hu.SubArea = SubAreaTextBox.Text;


                hu.AirConditoiner    = (bool)AirConditionerCheckBox.IsChecked;
                hu.FreeParking       = (bool)FreeParkingCheckBox.IsChecked;
                hu.breakfastIncluded = (bool)BreakFastIncludedcheckBox.IsChecked;
                hu.RoomService       = (bool)RoomServiceCheckBox.IsChecked;

                if (hu.SubArea == "")
                {
                    throw new TzimerException("Must enter a sub area for your unit!");
                }
                switch (AreaComboBox.SelectedIndex)
                {
                case 0:
                    hu.Area = Areas.Jerusalem;
                    break;

                case 1:
                    hu.Area = Areas.Center;

                    break;

                case 2:
                    hu.Area = Areas.North;
                    break;

                case 3:
                    hu.Area = Areas.South;

                    break;

                default:
                    break;
                }
                switch (UnitTypeComboBox.SelectedIndex)
                {
                case 0:
                    hu.Type = UnitType.Tzimer;
                    break;

                case 1:
                    hu.Type = UnitType.HostingUnit;

                    break;

                case 2:
                    hu.Type = UnitType.HotelRoom;

                    break;

                case 3:
                    hu.Type = UnitType.Tent;

                    break;

                default:
                    break;
                }

                hu.Pool   = (bool)HasPoolCheckBox.IsChecked;
                hu.Jacuzz = (bool)HasJacuzzCheckBox.IsChecked;
                hu.Garden = (bool)HasGardanCheckBox.IsChecked;
                hu.ChildrensAttractions = (bool)HasChildrenAttractionsCheckBox.IsChecked;
                hu.Owner = m_Owner;

                if (m_isEdit)
                {
                    int hostingUnitKey = int.Parse(HostingUnitKeyLable.Content.ToString().Substring(1));
                    hu.HostingUnitKey = hostingUnitKey;
                    bl.UpdateHostingUnit(hu);
                    HostinUnitListPage obj = new HostinUnitListPage(hu.Owner, this.NavigationService);
                    this.NavigationService.Navigate(obj);
                }

                else
                {
                    bl.AddHostingUnit(hu);

                    HostinUnitListPage obj = new HostinUnitListPage(hu.Owner, this.NavigationService);
                    this.NavigationService.Navigate(obj);
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }