コード例 #1
0
        public HostSingIn()
        {
            try
            {
                InitializeComponent();

                HostingUnit hostingUnit = new HostingUnit();
                hostingUnit.Owner = new Host();
                hostingUnit.Owner.BankBranchDetails = new Bankdetails();

                HostDetails_UserControl hostDetails_UserControl = new HostDetails_UserControl(hostingUnit);
                UcGrid.Children.Add(hostDetails_UserControl);
                UcGrid.DataContext = hostingUnit.Owner;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
コード例 #2
0
 public UnitToUpdateWindow(HostingUnit currentUnit)
 {
     BL.IBL myBL = BlFactory.GetBL();
     this.updateUnit = currentUnit;
     InitializeComponent();
     HostingUnitNameTextBox.Text  = updateUnit.HostingUnitName;
     AreaTextBlock.Text           = currentUnit.Area.ToString();
     SubAreaTextBlock.Text        = currentUnit.SubArea.ToString();
     AdultSlider.Value            = currentUnit.Adults;
     ChildrenSlider.Value         = updateUnit.Children;
     AttractionCheckBox.IsChecked = updateUnit.ChildrensAttractions;
     GardenCheckBox.IsChecked     = updateUnit.Garden;
     PoolCheckBox.IsChecked       = updateUnit.Pool;
     JacuzziCheckBox.IsChecked    = updateUnit.Jacuzzi;
     TypeComboBox.SelectedItem    = currentUnit.Area;
 }
コード例 #3
0
        public Mail(Order order)
        {
            InitializeComponent();

            ord = order;
            foreach (HostingUnit u in MainWindow.ibl.GetAllHostingUnits())
            {
                WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
                if (u.HostingUnitKey == ord.HostingUnitKey)
                {
                    hu = u;
                    break;
                }
            }
            starttextbox();
        }
コード例 #4
0
        public UpdateUnitWindow2(HostingUnit unit)
        {
            InitializeComponent();
            double screenWidth  = System.Windows.SystemParameters.PrimaryScreenWidth;
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
            double windowWidth  = this.Width;
            double windowHeight = this.Height;

            this.Left = (screenWidth / 2) - (windowWidth / 2);
            this.Top  = (screenHeight / 2) - (windowHeight / 2);

            unitToUpdate     = unit;
            this.DataContext = unit;
            bl = FactoryBL.getBL();


            this.areaComboBox.ItemsSource = Enum.GetValues(typeof(Enums.area));
            if (unitToUpdate.area == "צפון")
            {
                this.areaComboBox.SelectedIndex = 0;
            }
            if (unitToUpdate.area == "דרום")
            {
                this.areaComboBox.SelectedIndex = 1;
            }
            if (unitToUpdate.area == "מרכז")
            {
                this.areaComboBox.SelectedIndex = 2;
            }
            if (unitToUpdate.area == "ירושלים")
            {
                this.areaComboBox.SelectedIndex = 3;
            }
            this.typeComboBox.ItemsSource = Enum.GetValues(typeof(Enums.hostingUnitType));
            if (unitToUpdate.type == "צימר")
            {
                this.typeComboBox.SelectedIndex = 0;
            }
            if (unitToUpdate.type == "מלון")
            {
                this.typeComboBox.SelectedIndex = 1;
            }
            if (unitToUpdate.type == "קמפינג")
            {
                this.typeComboBox.SelectedIndex = 2;
            }
        }
コード例 #5
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (HostingUnitNameTextBox.Text == "" || AreaComboBox.SelectedItem == null || SubAreaTextBox.Text == "")
            {
                if (HostingUnitNameTextBox.Text == "")
                {
                    HostingUnitNameLabel.Foreground = Brushes.Red;
                    HostingUnitNameLabel.Content    = "Empty field !";
                }
                else
                {
                    HostingUnitNameLabel.Content = "";
                }
                if (AreaComboBox.SelectedItem == null)
                {
                    AreaLabel.Foreground = Brushes.Red;
                    AreaLabel.Content    = "Empty field !";
                }
                if (TypeComboBox.SelectedItem == null)
                {
                    TypeLabel.Foreground = Brushes.Red;
                    TypeLabel.Content    = "Empty field !";
                }


                MessageBox.Show("Please fill all the fields !", "ERROR", MessageBoxButton.OK, MessageBoxImage.Warning);
            }

            //If he filled all the details
            else
            {
                BL.IBL      myBL           = BlFactory.GetBL();
                HostingUnit newHostingUnit = new HostingUnit();
                newHostingUnit.HostingUnitName      = HostingUnitNameTextBox.Text;
                newHostingUnit.Owner                = currentHost;
                newHostingUnit.Adults               = int.Parse(AdultTextBox.Text);
                newHostingUnit.Area                 = (Area)AreaComboBox.SelectedItem;
                newHostingUnit.Children             = int.Parse(ChildrenTextBox.Text);
                newHostingUnit.ChildrensAttractions = (bool)AttractionCheckBox.IsChecked;
                newHostingUnit.Garden               = (bool)GardenCheckBox.IsChecked;
                newHostingUnit.Jacuzzi              = (bool)JacuzziCheckBox.IsChecked;
                newHostingUnit.Pool                 = (bool)PoolCheckBox.IsChecked;
                myBL.Add_Hosting_Unit(newHostingUnit);
                MessageBox.Show("Added with success!", "Thank you !", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                Close();
            }
        }
コード例 #6
0
 private void Button_Click_6(object sender, RoutedEventArgs e)//דחיית הזמנה
 {
     try
     {
         HostingUnit unit  = (HostingUnit)(unitCB.SelectedItem);
         Order       order = (Order)(orderLV.SelectedItem);
         if (order == null)
         {
             throw new NullReferenceException("לא נבחרה הזמנה");
         }
         myBL.rejectOrderSp(order);
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
        public OrdersListHostingUnit(HostingUnit unit, Grid ThisGrid, int index)
        {
            InitializeComponent();
            textBox.DataContext      = unit;
            textBox_Copy.DataContext = unit;
            this.ThisGrid            = ThisGrid;
            this.unit  = unit;
            this.index = index;
            var listOrder = from item in bl.GetOrders()
                            where item.HostingUnitKey == unit.HostingUnitKey && item.Status != OrderStatus.CLIENTNOCARE
                            select item;

            foreach (var order in listOrder)
            {
                listView.Items.Add(new OrderView(order, listOrder.ToList(), listView));
            }
        }
コード例 #8
0
        public HostingUnitWindow(HostingUnit Unit)
        {
            sendMailWorker         = new BackgroundWorker();
            sendMailWorker.DoWork += sendMail;
            InitializeComponent();
            this.hostingUnit = Unit;
            bl = BL.FactoryBL.GetBL();
            //hostingUnit = new HostingUnit();
            //hostingUnit = getHostingUnit();
            //bl.addHostingUnit(hostingUnit);

            guests = new ObservableCollection <Guest>(bl.getAllGuests());
            orders = new ObservableCollection <Order>(bl.getAllOrders(x => x.HostingUnitKey == hostingUnit.HostingUnitKey));

            bankAccunts = new List <BankAccunt>();
            try
            {
                bankAccunts = bl.getAllBankBranches();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }


            List <string> bankNames = (from bank in bankAccunts select bank.BankName).Distinct().ToList();

            BankNameComboBox.ItemsSource = bankNames;

            this.filterStatusCb.ItemsSource = Enum.GetValues(typeof(enums.OrderStatus));

            this.filterStatusGuest.ItemsSource  = Enum.GetValues(typeof(enums.GuestStatus));
            this.filterAreaGuest.ItemsSource    = Enum.GetValues(typeof(enums.CountryAreas));
            this.filterJacuzziGuest.ItemsSource = Enum.GetValues(typeof(enums.LuxusOption));
            this.filterPoolGuest.ItemsSource    = Enum.GetValues(typeof(enums.LuxusOption));
            filterGuest = new Guest();
            filterGuestStackPanel.DataContext = filterGuest;

            //   Enum.GetValues(typeof(enums.HostingUnitType));

            SetBlackOutDates();

            HostingUnitGrid.DataContext = hostingUnit;
            guestListView.ItemsSource   = guests;
            orderListView.ItemsSource   = orders;
        }
コード例 #9
0
 private void mouseUpdateClick(object sender, RoutedEventArgs e)
 {
     try
     {
         hostingUnit = (HostingUnit)HostingUnitsList.SelectedItem;
         //hostingUnit.Owner = hostingUnitList.FirstOrDefault().Owner;
         //hostingUnit.HostingUnitKey = hostingUnitList.FirstOrDefault().HostingUnitKey;
         //hostingUnit.HostingUnitName = hostingUnitList.FirstOrDefault().HostingUnitName;
         UpdateHostingUnit window = new UpdateHostingUnit(hostingUnit);
         Close();
         window.ShowDialog();
     }
     catch (Exception exp)
     {
         MessageBox.Show(exp.Message, "exception", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
コード例 #10
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));
        }
コード例 #11
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if ((firstName.Text.Length == 0) || !(firstName.Text.All(x => x == ' ' || char.IsLetter(x))) ||
                    (lastName.Text.Length == 0) || !(lastName.Text.All(x => x == ' ' || char.IsLetter(x))) ||
                    (price.Text.Length == 0) || !(price.Text.All(x => x == ' ' || char.IsDigit(x))) ||
                    (phoneNumber.Text.Length < 9) || (phoneNumber.Text.Length > 10) || !(phoneNumber.Text.All(x => x == ' ' || char.IsDigit(x))) ||
                    !(bankAccount.Text.All(x => x == ' ' || char.IsDigit(x))) ||
                    (hostKey.Text.Length != 9) || !(ID(((int.Parse(hostKey.Text))))) || (password.Text.Length != 8) || (name.Text.Length == 0) || (int.Parse(price.Text) <= 0))
                {
                    MessageBox.Show("Please enter all details");
                    return;
                }
                BankBranch  t        = MainWindow.myBl.GetBranches().Find(x => x.BankName == Bname.SelectedValue.ToString() && x.BranchNumber == int.Parse(Bnum.SelectedValue.ToString()));
                HostingUnit hostUnit = new HostingUnit
                {
                    HostingUnitkey  = long.Parse(unitKey.Text),
                    HostingUnitName = name.Text,

                    price = int.Parse(price.Text),
                    Owner = new Host
                    {
                        BankAccountNumber   = int.Parse(bankAccount.Text),
                        BankBranchDetails   = t,
                        CollectionClearance = (bool)clearance.IsChecked,
                        FamilyName          = lastName.Text,
                        FhoneNumber         = long.Parse(phoneNumber.Text),
                        HostKey             = long.Parse(hostKey.Text),
                        MailAddress         = mail.Text,
                        Password            = long.Parse(password.Text),
                        PrivateName         = firstName.Text
                    }
                };
                MainWindow.myBl.UpdateHostingUnit(hostUnit);

                MessageBox.Show(hostUnit.Owner.PrivateName + " " + hostUnit.Owner.FamilyName + " " + "your hospitality unit updated successfully in the system, your password is:  " + hostUnit.Owner.Password + "thank you", "success", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            catch (BlException ex)
            {
                MessageBox.Show(ex.Message, "", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            this.Close();
        }
コード例 #12
0
 public HostingUnitUserControl(HostingUnit myHostingUnit)
 {
     InitializeComponent();
     hostingUnitGrid.DataContext = myHostingUnit;
     if (myHostingUnit.Garden)
     {
         txt0.Text = "גינה ";
     }
     else
     {
         img0.Visibility = Visibility.Hidden;
     }
     if (myHostingUnit.Pool)
     {
         txt1.Text = " בריכה";
     }
     else
     {
         img1.Visibility = Visibility.Hidden;
     }
     if (myHostingUnit.Jacuzzi)
     {
         txt2.Text = " ג'קוזי";
     }
     else
     {
         img2.Visibility = Visibility.Hidden;
     }
     if (myHostingUnit.Wifi)
     {
         txt3.Text = " Wifi";
     }
     else
     {
         img3.Visibility = Visibility.Hidden;
     }
     if (myHostingUnit.ChildrenAttractions)
     {
         txt4.Text = " פעילויות לילדים";
     }
     else
     {
         img4.Visibility = Visibility.Hidden;
     }
 }
コード例 #13
0
 private void Button_Click_2(object sender, RoutedEventArgs e)//edit unit
 {
     try
     {
         HostingUnit unit = (HostingUnit)(unitCB.SelectedItem);
         if (unit == null)
         {
             throw new NullReferenceException("לא נבחרה יחידת אירוח");
         }
         editUnitWin win = new editUnitWin(unit);
         win.ShowDialog();
         unitCB.ItemsSource = myBL.getUnitsForHost(myHost);
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
コード例 #14
0
        public Offers(GuestRequest gr)
        {
            InitializeComponent();
            BL.IBL myBL = BlFactory.GetBL();
            current_guestRequest_Key = gr.GuestRequestKey;
            List <Order> order_options = myBL.send_Orders_To_Request(gr);

            if (order_options.Count == 0)
            {
                MessageBox.Show("No available options !", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            foreach (Order ord in order_options)
            {
                HostingUnit unit = myBL.get_All_units().Find(x => x.HostingUnitKey == ord.HostingUnitKey);
                OrdersDataGrid.Items.Add(unit);
            }
        }
コード例 #15
0
 private void ButtonOk_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         HostingUnit myhostingUnit = bl.GetName_GiveHostingUnit(TextBox_of_hostingunit_name.Text.ToString());
         if (myhostingUnit == null)
         {
             throw new Exception("לא קיימת יחידת אירוח כזאת במאגר ");
         }
         int number           = bl.Number_of_orders_accepted(myhostingUnit);
         MessageBox_Project x = new MessageBox_Project(":מס' ההזמנות שנסגרו בהצלחה ביחידה זו", "הזמנות:  " + number);
         x.ShowDialog();
     }
     catch (Exception ms)
     {
         MessageBox.Show(ms.Message);
     }
 }
コード例 #16
0
        private void ViewSelectedItem(object selectedItem)
        {
            if (selectedItem is HostingUnit)
            {
                HostingUnit    h        = (HostingUnit)selectedItem;
                ViewUnitWindow viewUnit = new ViewUnitWindow();
                viewUnit.unitUserControl.DataContext = h;
                viewUnit.unitUserControl.cbBranchesList.ItemsSource   = MainWindow.BL.GetBranchesList(h.Owner.BankBranchDetails.BankName);
                viewUnit.unitUserControl.cbBranchesList.SelectedValue = h.Owner.BankBranchDetails.BranchNumber + " - " + h.Owner.BankBranchDetails.BranchName;

                viewUnit.ShowDialog();
            }
            else if (selectedItem is GuestRequest)
            {
                ViewGuestWindow viewGuest = new ViewGuestWindow();
                viewGuest.guestUserControl.DataContext = (GuestRequest)selectedItem;
                viewGuest.ShowDialog();
            }
        }
コード例 #17
0
 public UpdateUnit(Host host)
 {
     InitializeComponent();
     if (currentUnit == null)
     {
         currentUnit = new HostingUnit();
     }
     InitializeComponent();
     this.DataContext = currentUnit;
     this.AreaComboBox.ItemsSource = Enum.GetValues(typeof(BE1.TypeAreaOfTheCountry));
     this.UnitComboBox.ItemsSource = Enum.GetValues(typeof(BE1.TypeOfHostingUnit));
     currentUnit.owner             = host;
     //currentUnit.owner.hostKey = host.hostKey;
     //  InitializeComponent();
     // currentRequest = new GuestRequest();
     bl = FactoryBL.getBL();
     UnitsDetails.ItemsSource = bl.getAllHostingUnit(x => x.owner.hostKey == host.hostKey);
     UnitsDetails.Visibility  = Visibility.Visible;
 }
コード例 #18
0
        public AddUnitWindow()
        {
            InitializeComponent();
            double screenWidth  = System.Windows.SystemParameters.PrimaryScreenWidth;
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
            double windowWidth  = this.Width;
            double windowHeight = this.Height;

            this.Left = (screenWidth / 2) - (windowWidth / 2);
            this.Top  = (screenHeight / 2) - (windowHeight / 2);

            unit       = new BE.HostingUnit();
            unit.owner = new Host();
            unit.owner.bankBranchDetails = new BankBranch();
            this.DataContext             = unit;
            bl = FactoryBL.getBL();

            this.areaComboBox.ItemsSource = Enum.GetValues(typeof(Enums.area));
            this.typeComboBox.ItemsSource = Enum.GetValues(typeof(Enums.hostingUnitType));
        }
コード例 #19
0
        private void Add_click(object sender, RoutedEventArgs e)
        {
            HostingUnit hostUnit = new HostingUnit
            {
                HostingUnitkey  = long.Parse(unitKey.Text),
                HostingUnitName = name.Text,
                price           = int.Parse(price.Text),
                Owner           = hu.Owner
            };

            try
            {
                MainWindow.myBl.AddHostingUnit(hostUnit);
                MessageBox.Show(hostUnit.Owner.PrivateName + " your hosting unit addea succesfuly");
            }
            catch (BlException ex)
            {
                MessageBox.Show(ex.Message, "", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
        }
コード例 #20
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         My_HostUnit = bl.GetName_GiveHostingUnit(HostUnitFill.Text.ToString());
         if (My_HostUnit == null)
         {
             MessageBox_Project t = new MessageBox_Project("!!שגיאה ", "השם יחידת אירוח שביקשת לעדכן אינו נמצא ברשימה");
             t.ShowDialog();
         }
         bl.deleteHostingUnit(My_HostUnit);
         MessageBox_Project x = new MessageBox_Project("!!מעולה ", "היחידה נמחקה בהצלחה");
         x.ShowDialog();
         Close();
     }
     catch (ArgumentException exp)
     {
         MessageBox.Show(exp.Message);
     }
 }
コード例 #21
0
        public void SetModelHostingUnit(HostingUnit hostingUnit, bool isUpdateable = false)
        {
            resetVisible();

            ShowHostingUser.hostingUnit = hostingUnit;
            ShowHostingUser.Visibility  = Visibility.Visible;
            ShowHostingUser.InitToggles();
            ShowHostingUser.IsEnabled = isUpdateable;

            if (isUpdateable)
            {
                ShowHostingUser.gridBtn.Visibility = Visibility.Visible;
            }
            else
            {
                //ShowHostingUser.ClearBlackoutDates();
                ShowHostingUser.SetBlackoutDates(hostingUnit.Diary);
                ShowHostingUser.SetBankNoEditable();
            }
        }
コード例 #22
0
 private void Button_Click_4(object sender, RoutedEventArgs e)//send mail
 {
     try
     {
         HostingUnit  unit = (HostingUnit)(unitCB.SelectedItem);
         GuestRequest req  = (GuestRequest)(reqLV.SelectedItem);
         if (req == null)
         {
             throw new NullReferenceException("לא נבחרה דרישת אירוח");
         }
         myBL.makeOrder(req.GuestRequestKey, unit.HostingUnitKey);//שולח את המייל כאן ויוצר הזמנה
         IEnumerable <Order> orderList = myBL.getOrdersByUnitKey(unit.HostingUnitKey);
         orderLV.ItemsSource = orderList;
         reqLV.ItemsSource   = myBL.getRequestIf(request => unit.fitCheck(request) && !myBL.isInOrderList(request, orderList));
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
        private void btnDeleteHostingUnit_Click(object sender, RoutedEventArgs e)
        {
            if (lsvDeleteHostingUnit.SelectedIndex < 0)
            {
                lblErrorHostingUnitDelete.Visibility = Visibility.Visible;
                return;
            }

            try
            {
                hostingUnit = listHostingUnits[lsvDeleteHostingUnit.SelectedIndex];

                bl.deleteHostingUnit(hostingUnit);
                refreshHostingUnits();
                MessageBox.Show("נמחק בהצלחה", "", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.None, MessageBoxOptions.RtlReading);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "שגיאה", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.None, MessageBoxOptions.RtlReading);
            }
        }
        private void keyButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                key         = long.Parse(KeyTextBox.Text);
                hostingUnit = bl.FindUnitByKey(key);

                HostingUnitName_TextBox.Text                       = hostingUnit.HostingUnitName;
                HostingUnitSubArea_Textbox.Text                    = hostingUnit.SubArea;
                SubareaTextBlock.Text                              = hostingUnit.Area.ToString();
                HostingUnitSwimmingPool_CheckBox.IsChecked         = hostingUnit.Pool;
                HostingUnitGarden_CheckBox.IsChecked               = hostingUnit.Garden;
                HostingUnitChildrensAttractions_CheckBox.IsChecked = hostingUnit.ChildrensAttractions;

                SetBlackOutDates(hostingUnit);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #25
0
        public UpdateHostingUnit(HostingUnit temp)
        {
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            //HostingUnit.Diary = new bool[31, 12];
            HostingUnit      = temp;
            this.DataContext = HostingUnit;
            host             = temp.Owner;
            InitializeComponent();

            this.areaComboBox.ItemsSource    = System.Enum.GetValues(typeof(BE.Enum.Area));
            this.poolComboBox.ItemsSource    = System.Enum.GetValues(typeof(BE.Enum.Pool));
            this.jacuzziComboBox.ItemsSource = System.Enum.GetValues(typeof(BE.Enum.Jacuzzi));
            this.spookyComboBox.ItemsSource  = System.Enum.GetValues(typeof(BE.Enum.Spooky));
            this.typeComboBox.ItemsSource    = System.Enum.GetValues(typeof(BE.Enum.ResortType));
            this.childrensAttractionsComboBox.ItemsSource = System.Enum.GetValues(typeof(BE.Enum.ChildrensAttractions));
            this.gardenComboBox.ItemsSource        = System.Enum.GetValues(typeof(BE.Enum.Garden));
            this.UpdateHostingUnitGrid.DataContext = temp;

            errorMessages = new List <string>();
            // setHostingUnitFields();
        }
コード例 #26
0
 public editUnitWin(HostingUnit unit)
 {
     InitializeComponent();
     this.Unit = unit;
     editUnitWinGrid.DataContext   = Unit;
     areaCB.SelectedItem           = Unit.Area;
     typeCB.SelectedItem           = Unit.Type;
     areaCB.ItemsSource            = Enum.GetValues(typeof(Area)).Cast <Area>().Where(area => area != Area.All);
     typeCB.ItemsSource            = Enum.GetValues(typeof(HostingType)).Cast <HostingType>();
     ownerLabel.Content            = myBL.getHost(unit.OwnerHostKey);
     jacuzziCB.IsChecked           = Unit.Jacuzzi;
     gardenCB.IsChecked            = Unit.Garden;
     poolCB.IsChecked              = Unit.Pool;
     childrenAtractionCB.IsChecked = Unit.ChildrensAttractions;
     breakfastCB.IsChecked         = Unit.Breakfast;
     HBCB.IsChecked          = Unit.HB;
     FBCB.IsChecked          = Unit.FB;
     bedOnlyCB.IsChecked     = Unit.BedOnly;
     freeParkingCB.IsChecked = Unit.FreeParking;
     freeWifiCB.IsChecked    = Unit.FreeWifi;
 }
コード例 #27
0
 private void Button_Click_5(object sender, RoutedEventArgs e)//אישור הזמנה
 {
     try
     {
         HostingUnit unit  = (HostingUnit)(unitCB.SelectedItem);
         Order       order = (Order)(orderLV.SelectedItem);
         if (order == null)
         {
             throw new NullReferenceException("לא נבחרה הזמנה");
         }
         int commission = myBL.acceptOrder(order);
         MessageBox.Show("חויבת עמלת תיווך על סך " + commission + " שקלים");
         IEnumerable <Order> orderList = myBL.getOrdersByUnitKey(unit.HostingUnitKey);
         orderLV.ItemsSource = orderList;
         reqLV.ItemsSource   = myBL.getRequestIf(request => unit.fitCheck(request) && !myBL.isInOrderList(request, orderList));
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
コード例 #28
0
        public void sendMail(object sender, DoWorkEventArgs e)
        {
            Order       order       = (Order)e.Argument;
            HostingUnit hostingUnit = bl.GetHostingUnit(order.HostingUnitKey);
            Guest       guest       = bl.GetGuest(order.GuestRequestKey);
            string      To          = guest.MailAddress;
            string      Subject     = string.Format(": {0} הצעת חופשה ביחידת האירוח ", hostingUnit.HostingUnitName);
            string      Body        = string.Format("שלום {0} מייל נשלח אילך בהמשך לבקשתך לחופשה דרך האתר שלנו. יחידת האירוח {1} שלחה אילך הצעת אירוח. להמשך טיפוך ניתן לפנות למייל {2}. יום טוב ", guest.PrivateName + " " + guest.FamilyName, hostingUnit.HostingUnitName, hostingUnit.Owner.MailAddress);


            for (int i = 0; i < 10; i++)
            {
                if (Tools.sendMail(To, Subject, Body, false))
                {
                    order.Status = enums.OrderStatus.mail_has_been_sent;
                    bl.updateOrder(order);
                    return;
                }
            }
            MessageBox.Show("לא הצליח לשלוח מייל", "בעיה");
        }
コード例 #29
0
        public unitcontrol(HostingUnit hu)
        {
            VBimage = new Viewbox();

            InitializeComponent();
            Current = hu;
            Id      = Current.HostingUnitkey;
            userGrid.DataContext = Current;
            imageindex           = 0;

            VBimage.Width   = 170;
            VBimage.Height  = 150;
            VBimage.Stretch = Stretch.Fill;
            userGrid.Children.Add(VBimage);
            Grid.SetColumn(VBimage, 2);
            Grid.SetRow(VBimage, 0);
            myImage          = CreatViewImage();
            VBimage.Child    = null;
            VBimage.Child    = myImage;
            VBimage.MouseUp += vbImage_MouseUp;
            occupancy.Text   = MainWindow.myBl.GetAnnualBusyDays(Current).ToString();
        }
コード例 #30
0
        public AddUnitWindow(Host host)
        {
            vbImage     = new Viewbox();
            currentUnit = new HostingUnit();
            InitializeComponent();
            this.DataContext = currentUnit;

            bl = FactoryBL.getBL();
            currentUnit.owner = host;
            UnitControlGrid.Children.Add(vbImage);
            imageIndex      = 0;
            vbImage.Width   = 75;
            vbImage.Height  = 75;
            vbImage.Stretch = Stretch.Fill;
            Grid.SetColumn(vbImage, 2);
            Grid.SetRow(vbImage, 0);
            MyImage       = CreateViewImage();
            vbImage.Child = null;
            vbImage.Child = MyImage;
            this.AreaComboBox.ItemsSource = Enum.GetValues(typeof(BE1.TypeAreaOfTheCountry));
            this.UnitComboBox.ItemsSource = Enum.GetValues(typeof(BE1.TypeOfHostingUnit));
        }