Ejemplo n.º 1
0
 public AddMotherWindow(Mother mother)
 {
     InitializeComponent();
     this.DataContext        = mother;
     AddMotherButton.Content = "update mother";
     bl = BLFactory.getBL();
 }
Ejemplo n.º 2
0
 public MainWindow()
 {
     InitializeComponent();
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
     myBL = BLFactory.getBL();
     myBL.MonthThread();
 }
Ejemplo n.º 3
0
        public AddUnitWindow(int index)
        {
            myBL = BLFactory.getBL();
            InitializeComponent();
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            index2         = index;
            isImageChanged = false;
            h = new Host()
            {
                PrivateName = null,
                FamilyName  = "",
                MailAddress = ""
            };


            hu = new HostingUnit()
            {
                HostingUnitKey  = myBL.getUnitsConfig(),
                HostingUnitName = null
            };

            this.area.ItemsSource = Enum.GetValues(typeof(BE.area));
            this.type.ItemsSource = Enum.GetValues(typeof(BE.type));
            h.BankBranchDetails   = b;
            hu.Owner = h;
            UnitDetails.DataContext    = hu;
            PrivateDetails.DataContext = h;

            b = new BankBranch();
            List <string> Banks = myBL.getAllBankBranches();

            this.bank.ItemsSource = Banks;
            bank.DataContext      = Banks;
        }
Ejemplo n.º 4
0
 public AddMotherWindow()
 {
     InitializeComponent();
     mother           = new Mother();
     this.DataContext = mother;
     bl = BLFactory.getBL();
 }
 public PrivateArea(int index)
 {
     myBL = BLFactory.getBL();
     InitializeComponent();
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
     index2 = index;
 }
 public AddNannyWindow()
 {
     InitializeComponent();
     this.DataContext       = selectedNanny;
     AddNannyButton.Content = "update mother";
     bl = BLFactory.getBL();
 }
Ejemplo n.º 7
0
 public AddChildWindow(Child child)
 {
     InitializeComponent();
     this.DataContext       = child;
     AddChildButton.Content = "update child";
     bl = BLFactory.getBL();
     motherIdComboBox.ItemsSource = bl.getListOfMothers();
 }
Ejemplo n.º 8
0
 public AddChildWindow()
 {
     InitializeComponent();
     child            = new Child();
     this.DataContext = child;
     bl = BLFactory.getBL();
     motherIdComboBox.ItemsSource = bl.getListOfMothers();
 }
Ejemplo n.º 9
0
 public DeleteUnit(int index)
 {
     myBL = BLFactory.getBL();
     InitializeComponent();
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
     index2 = index;
     DeleteGrid.DataContext = num;
     hu = new HostingUnit();
 }
 public AddContractWindow()
 {
     InitializeComponent();
     contract         = new Contract();
     this.DataContext = contract;
     bl = BLFactory.getBL();
     id_NannyComboBox.ItemsSource = bl.getListOfNannies();
     idChildComboBox.ItemsSource  = bl.getListOfChildren();
 }
 public AddContractWindow(Contract contract)
 {
     InitializeComponent();
     this.DataContext          = contract;
     AddContractButton.Content = "update contract";
     bl = BLFactory.getBL();
     id_NannyComboBox.ItemsSource = bl.getListOfNannies();
     idChildComboBox.ItemsSource  = bl.getListOfChildren();
 }
Ejemplo n.º 12
0
        public HostWindow()
        {
            myBL = BLFactory.getBL();
            InitializeComponent();
            WindowStartupLocation = WindowStartupLocation.CenterScreen;

            HostGrid.DataContext = pass;
            HostGrid.DataContext = myID;
            signUp.IsEnabled     = false;
            logIn.IsEnabled      = false;
        }
        public DeleteDetails(int unitKey)
        {
            myBL = BLFactory.getBL();

            InitializeComponent();
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            this.area.ItemsSource = Enum.GetValues(typeof(BE.area));
            this.type.ItemsSource = Enum.GetValues(typeof(BE.type));
            hu1 = myBL.FindUnit(unitKey);
            deleteGrid.DataContext = hu1;
        }
Ejemplo n.º 14
0
 public UpdateDetails(HostingUnit hu, int index)
 {
     myBL = BLFactory.getBL();
     hu1  = hu;
     InitializeComponent();
     WindowStartupLocation  = WindowStartupLocation.CenterScreen;
     this.area.ItemsSource  = Enum.GetValues(typeof(BE.area));
     this.type.ItemsSource  = Enum.GetValues(typeof(BE.type));
     UpdateGrid.DataContext = hu1;
     index2 = index;
 }
 public ManagerWindow()
 {
     myBL = BLFactory.getBL();
     InitializeComponent();
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
     lst  = myBL.getGuestRequests();
     lst2 = myBL.getHostingUnits();
     lst3 = myBL.getOrders();
     guests.ItemsSource = lst;
     orders.ItemsSource = lst3;
     units.ItemsSource  = lst2;
 }
Ejemplo n.º 16
0
 public Order(int index)
 {
     myBL = BLFactory.getBL();
     InitializeComponent();
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
     lst                = myBL.getGuestRequests();
     lst2               = myBL.getHostingUnits();
     lst3               = myBL.getOrders();
     index2             = index;
     guests.ItemsSource = lst;
     orders.ItemsSource = lst3;
     guests.Items.Refresh();
 }
Ejemplo n.º 17
0
        public AddRequest()
        {
            myBL = BLFactory.getBL();
            InitializeComponent();
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            myReq = new GuestRequest()
            {
                GuestRequestKey  = myBL.getRequestsConfig(),
                RegistrationDate = DateTime.Now,
                EntryDate        = DateTime.Now,
                ReleaseDate      = DateTime.Now
            };

            MyGrid.DataContext   = myReq;
            jaccuzi.SelectedItem = Preference.Must;

            this.area.ItemsSource        = Enum.GetValues(typeof(BE.area));
            this.type.ItemsSource        = Enum.GetValues(typeof(BE.type));
            this.pool.ItemsSource        = Enum.GetValues(typeof(BE.Preference));
            this.garden.ItemsSource      = Enum.GetValues(typeof(BE.Preference));
            this.attractions.ItemsSource = Enum.GetValues(typeof(BE.Preference));
            this.jaccuzi.ItemsSource     = Enum.GetValues(typeof(BE.Preference));
        }
Ejemplo n.º 18
0
        public UpdateWindow(personsEnum.typeOfPerson thePerson)
        {
            InitializeComponent();
            TheBL = BLFactory.getBL();
            DELButton.Visibility  = Visibility.Hidden;
            slowButton.Visibility = Visibility.Hidden;
            setPic(thePerson);
            // switch

            switch (thePerson)
            {
            case personsEnum.typeOfPerson.nanny1:
                IDComboBox.ItemsSource = TheBL.getListOfNannies();
                slowButton.Content     = "Update Nanny";
                headerLabel.Content    = "double click the Nanny's ID to update";
                flag = 1;
                break;

            case personsEnum.typeOfPerson.mother2:
                IDComboBox.ItemsSource = TheBL.getListOfMothers();    //for mother obvesly
                slowButton.Content     = "Update Mother";
                headerLabel.Content    = "double click the Mother's ID to update";
                flag = 2;    //need double click and switch
                break;

            case personsEnum.typeOfPerson.child3:
                IDComboBox.ItemsSource = TheBL.getListOfChildren();
                slowButton.Content     = "Update Child";
                headerLabel.Content    = "double click the Child's ID to update";
                flag = 3;    //need double click and switch
                break;

            case personsEnum.typeOfPerson.contract4:
                IDComboBox.ItemsSource = TheBL.getListOfContracts();
                headerLabel.Content    = "double click on the Contract ID to update";
                flag = 4;    //need double click and switch
                break;

            case personsEnum.typeOfPerson.nannyDelete5:
                IDComboBox.ItemsSource = TheBL.getListOfNannies();
                DELButton.Visibility   = Visibility.Visible;
                flag = 5;
                break;

            case personsEnum.typeOfPerson.motherDelete6:
                IDComboBox.ItemsSource = TheBL.getListOfMothers();
                DELButton.Visibility   = Visibility.Visible;
                flag = 6;
                break;

            case personsEnum.typeOfPerson.childDelete7:
                IDComboBox.ItemsSource = TheBL.getListOfChildren();
                headerLabel.Content    = "click Child to delete";
                DELButton.Visibility   = Visibility.Visible;
                flag = 7;
                break;

            case personsEnum.typeOfPerson.contractDelete8:
                IDComboBox.ItemsSource = TheBL.getListOfContracts();
                DELButton.Visibility   = Visibility.Visible;
                flag = 8;
                break;
            }
        }
Ejemplo n.º 19
0
 public ViewModel(Action <object, EventArgs> d)
 {
     bl = BLFactory.getBL(d);
 }
Ejemplo n.º 20
0
 public ViewModel()
 {
     bl = BLFactory.getBL();
 }
Ejemplo n.º 21
0
        static void Main(string[] args)
        {
            IBL bl = BLFactory.getBL();

            #region newGuestRequest
            GuestRequest gr = new GuestRequest();
            gr.GuestRequestKey     = Configuration.guestRequestKey++;
            gr.PrivateName         = "Tal";
            gr.FamilyName          = "Segal";
            gr.MailAddress         = "*****@*****.**";
            gr.Status              = RequestStatus.Open;
            gr.RegistrationDate    = new DateTime(2019, 03, 02);
            gr.EntryDate           = new DateTime(2019, 03, 12);
            gr.ReleaseDate         = new DateTime(2019, 03, 15);
            gr.Area                = area.Center;
            gr.Type                = type.Igloo;
            gr.Adults              = 2;
            gr.Children            = 3;
            gr.Pool                = Preference.Possible;
            gr.Garden              = Preference.Must;
            gr.Jacuzzi             = Preference.Possible;
            gr.Beach               = false;
            gr.minPrice            = 1000;
            gr.maxPrice            = 2200;
            gr.ChildrenAttractions = Preference.Unwanted;
            #endregion

            #region addGuestRequest
            GuestRequest g1 = new GuestRequest();
            try
            {
                bl.addClientRequest(gr);
                g1 = bl.getGuestRequests()[bl.getGuestRequests().Count() - 1];
                Console.WriteLine("\nGuest request add succesfully:\n");
                Console.WriteLine(g1.ToString());
            }
            catch (Exception ex)
            {
                Console.WriteLine("\n" + ex.Message);
            }
            #endregion

            #region newHost
            Host h = new Host();
            h.ID                              = 315428976;
            h.PrivateName                     = "Avital";
            h.FamilyName                      = "Prives";
            h.PhoneNumber                     = 0505678432;
            h.MailAddress                     = "*****@*****.**";
            h.BankBranchDetails               = new BankBranch();
            h.BankBranchDetails.BankName      = "Hapoalim";
            h.BankBranchDetails.BankNumber    = 4;
            h.BankBranchDetails.BranchAddress = "Ben Yehuda";
            h.BankBranchDetails.BranchCity    = "Tel Aviv";
            h.BankBranchDetails.BranchNumber  = 45;
            h.BankAccountNumber               = 54;
            h.CollectionClearance             = true;
            #endregion

            #region newHostingUnit
            HostingUnit hu = new HostingUnit();
            hu.Owner               = h;
            hu.price               = 1500;
            hu.Area                = area.North;
            hu.Type                = type.Igloo;
            hu.Adults              = 2;
            hu.Children            = 3;
            hu.Pool                = true;
            hu.Jacuzzi             = true;
            hu.Beach               = false;
            hu.Garden              = false;
            hu.ChildrenAttractions = false;
            hu.HostingUnitKey      = Configuration.hostingUnitKey++;
            hu.HostingUnitName     = "Frozen Igloo";
            hu.Diary               = new bool[31, 13];
            for (int i = 1; i < 13; i++)
            {
                for (int j = 1; j < 31; j++)
                {
                    hu.Diary[j, i] = false;
                }
            }
            #endregion

            #region tryDeleteHostingUnit
            HostingUnit h1 = new HostingUnit();
            try
            {
                bl.deleteHostingUnit(hu);
                h1 = bl.getHostingUnits()[bl.getHostingUnits().Count() - 1];
                Console.WriteLine("\nDelete hosting unit succesfully:\n");
                Console.WriteLine(h1.ToString());
            }
            catch (Exception ex)
            {
                Console.WriteLine("\n" + ex.Message);
            }
            #endregion

            #region addHostingUnit
            HostingUnit h2 = new HostingUnit();
            try
            {
                bl.addHostingUnit(hu);
                h2 = bl.getHostingUnits()[bl.getHostingUnits().Count() - 1];
                Console.WriteLine("\nHosting unit add succesfully:\n");
                Console.WriteLine(h2);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            #endregion

            #region updateHostingUnit
            h2.HostingUnitName = "Home Sweet Home";
            try
            {
                bl.updateHostingUnit(h2);
                Console.WriteLine("\nHosting unit update succesfully:\n");
                Console.WriteLine(h2);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            #endregion

            Console.WriteLine("\nAfter edit\n");

            #region newOrder
            Order or = new Order();
            or.OrderKey        = Configuration.orderKey++;
            or.HostingUnitKey  = h2.HostingUnitKey;
            or.GuestRequestKey = g1.GuestRequestKey;
            or.CreateDate      = new DateTime(2019, 01, 29);
            or.OrderDate       = or.CreateDate;
            or.Status          = RequestStatus.Open;
            #endregion

            #region addOrder
            Order o1 = new Order();
            try
            {
                bl.addOrder(or);
                o1 = bl.getOrders()[bl.getOrders().Count() - 1];
                Console.WriteLine("\nOrder added succcessfuly: \n");
                Console.WriteLine(o1);
            }
            catch (Exception ex)
            {
                Console.WriteLine("\n" + ex.Message);
            }
            #endregion

            or.Status = RequestStatus.Approved;

            #region updateOrder
            try
            {
                bl.updateOrder(or);
                Console.WriteLine("\nOrder update succcessfuly:");
                Console.WriteLine("\n" + or);
            }
            catch (Exception ex)
            {
                Console.WriteLine("\n" + ex.Message);
            }
            #endregion

            Console.WriteLine("The annual occupancy to this unit is: " + bl.AnnnualOccupancyToHostingUnit(hu));
            bl.AnnualOccupancyPercent(hu);

            Console.WriteLine("\nNumber of orders to the first request: " + bl.numOfOrdersToRequest(gr));

            #region tryDeleteHostingUnit
            try
            {
                bl.deleteHostingUnit(h2);
                Console.WriteLine("\nhosting unit deletion succcessfuly:\n");
            }
            catch (Exception ex)
            {
                Console.WriteLine("\n" + ex.Message);
            }
            #endregion

            Console.WriteLine("\nThe most requested area by guests is: " + bl.mostRequestedArea());

            #region newHost2
            Host ho = new Host();
            ho.ID                              = 315428976;
            ho.PrivateName                     = "Talya";
            ho.FamilyName                      = "Gil";
            ho.PhoneNumber                     = 0501234532;
            ho.MailAddress                     = "*****@*****.**";
            ho.BankBranchDetails               = new BankBranch();
            ho.BankBranchDetails.BankName      = "Hapoalim";
            ho.BankBranchDetails.BankNumber    = 4;
            ho.BankBranchDetails.BranchAddress = "Ben Yehuda";
            ho.BankBranchDetails.BranchCity    = "Tel Aviv";
            ho.BankBranchDetails.BranchNumber  = 45;
            ho.BankAccountNumber               = 54;
            ho.CollectionClearance             = true;
            #endregion

            #region newHostingUnit2
            HostingUnit hu2 = new HostingUnit();
            hu2.Owner               = ho;
            hu2.price               = 1000;
            hu2.Area                = area.North;
            hu2.Type                = type.Zimmer;
            hu2.Adults              = 2;
            hu2.Children            = 5;
            hu2.Pool                = true;
            hu2.Jacuzzi             = true;
            hu2.Beach               = true;
            hu2.Garden              = false;
            hu2.ChildrenAttractions = false;
            hu2.HostingUnitKey      = Configuration.hostingUnitKey++;
            hu2.HostingUnitName     = "Hot Zimmer";
            hu2.Diary               = new bool[31, 13];
            for (int i = 1; i < 13; i++)
            {
                for (int j = 1; j < 31; j++)
                {
                    hu2.Diary[j, i] = false;
                }
            }
            #endregion

            #region addHostingUnit2
            HostingUnit hu3 = new HostingUnit();
            try
            {
                bl.addHostingUnit(hu2);
                hu3 = bl.getHostingUnits()[bl.getHostingUnits().Count() - 1];
                Console.WriteLine("\nHosting unit add succesfully:\n");
                Console.WriteLine(hu3);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            #endregion

            Console.WriteLine("Number of orders to this unit: " + bl.numOfOrdersToUnit(hu3));
            Console.WriteLine("\n\nAll hosts' ID's are correct: " + bl.checkHostID(h));
            Console.WriteLine("\nMost requested type of hosting unit: " + bl.mostRequestedTypeOfUnit());
            Console.WriteLine("\nNumber of Approved Orders: " + bl.numOfApprovedOrders() + "\n");
            Console.WriteLine("\nCheapest hosting unit:\n\n" + bl.CheapestHostingUnit());

            #region groupingChecking
            bl.unitAreaGrouping(area.Jerusalem);
            bl.numOfVisitorsGrouping(3);
            // bl.hostGrouping(1);
            bl.areaGrouping(area.Center);
            #endregion

            Console.ReadLine();
        }
Ejemplo n.º 22
0
 public updateChild()
 {
     InitializeComponent();
     TheBL = BLFactory.getBL();
     idChildComboBox.ItemsSource = TheBL.getListOfChildren();
 }
        static void Main(string[] args)
        {
            IBL bl = BLFactory.getBL();

            GuestRequest g = new GuestRequest()
            {
                GuestRequestKey      = ++Configuration.guestRequestKeySeq,
                PrivateName          = "noam",
                FamilyName           = "ben haim",
                MailAddress          = "*****@*****.**",
                RegistrationDate     = new DateTime(2020, 8, 29),
                EntryDate            = new DateTime(2020, 9, 21),
                ReleaseDate          = new DateTime(2020, 9, 28),
                SubArea              = "tel aviv",
                Adults               = 2,
                Children             = 6,
                statusRequest        = StatusRequest.Active,
                area                 = Area.Center,
                types                = Types.Zimmer,
                pool                 = Pool.Necesarry,
                jacuzzi              = Jacuzzi.Possible,
                garden               = Garden.NotInteresed,
                childrensAttractions = ChildrensAttractions.Necesarry,
                tv          = TV.Necesarry,
                RoomService = true,
                Playpen     = false,
                meals       = Meals.All
            };
            HostingUnit h = new HostingUnit()
            {
                Owner = new Host()
                {
                    HostKey           = 322758889,
                    PrivateName       = "zimer 1",
                    FamilyName        = "cohen",
                    FhoneNumber       = 039554809,
                    MailAddress       = "*****@*****.**",
                    BankBranchDetails = new BankBranch()
                    {
                        BankNumber    = 123,
                        BankName      = "yahav",
                        BranchNumber  = 475,
                        BranchAddress = "rabi akiva",
                        BranchCity    = "ramat gan"
                    },
                    BankAccountNumber   = 022789,
                    CollectionClearance = true
                },
                HostingUnitKey  = 10000002,
                HostingUnitName = "suite1",
                Diary           = new bool[12, 31],
                area            = Area.Center
            };
            Order o = new Order()
            {
                HostingUnitKey  = 10000001,
                GuestRequestKey = 10000008,
                OrderKey        = ++Configuration.OrderKeyseq,
                statusOrder     = StatusOrder.NotYetAddressed,
                CreateDate      = new DateTime(2020, 2, 3),
                MailDate        = new DateTime(2020, 2, 8),
            };
            DateTime d1 = new DateTime(2020, 9, 25);
            DateTime d2 = new DateTime(2020, 1, 5);


            try
            {
                bl.addClientRequest(g);
            }
            catch (Exceptions ex)
            {
                Console.WriteLine(ex.message + ", " + ex.key + " ," + ex.name);
            }
            try
            {
                bl.updateClientRequestStatus(g, StatusRequest.CloseDeal);
            }
            catch (Exceptions ex)
            {
                Console.WriteLine(ex.message + ", " + ex.key + " ," + ex.name);
            }
            try
            {
                bl.addHostingUnit(h);
            }
            catch (Exceptions ex)
            {
                Console.WriteLine(ex.message + ", " + ex.key + " ," + ex.name);
            }
            try
            {
                bl.deleteHostingUnit(h /*, o*/);
            }
            catch (Exceptions ex)
            {
                Console.WriteLine(ex.message + ", " + ex.key + " ," + ex.name);
            }
            try
            {
                bl.updateHostingUnit(h /*, o*/);
            }
            catch (Exceptions ex)
            {
                Console.WriteLine(ex.message + ", " + ex.key + " ," + ex.name);
            }
            try
            {
                bl.addOrder(h, g, o);
            }
            catch (Exceptions ex)
            {
                Console.WriteLine(ex.message + ", " + ex.key + " ," + ex.name);
            }
            try
            {
                bl.updateOrder(h, o, StatusOrder.CloseOfResponsiveness, g);
            }
            catch (Exceptions ex)
            {
                Console.WriteLine(ex.message + ", " + ex.key + " ," + ex.name);
            }
            IEnumerable <HostingUnit> isAvailable = bl.availableUnits(d1, 3);

            foreach (var item in isAvailable)
            {
                Console.WriteLine(item);
            }
            Console.WriteLine(bl.between(d1));
            IEnumerable <Order> orders = bl.numOfOrders(1);

            foreach (var item in orders)
            {
                Console.WriteLine(item);
            }
            Console.WriteLine(bl.numOrders(g));
            Console.WriteLine(bl.numSucceedOrders(h));
            List <GuestRequest> center = bl.groupRequestByArea(Area.Center);

            foreach (var item in center)
            {
                Console.WriteLine(item);
            }
            List <GuestRequest> customers8 = bl.groupRequestByNumOfCustomers(8);

            foreach (var item in customers8)
            {
                Console.WriteLine(item);
            }
            List <Host> oneHost = bl.groupHostByNumOfHostingUnit(2);

            foreach (var item in oneHost)
            {
                Console.WriteLine(item);
            }
            List <HostingUnit> c = bl.groupHostingUnitByArea(Area.Center);

            foreach (var item in c)
            {
                Console.WriteLine(item);
            }
            //List<BankBranch> b= bl.getBankList();
            //foreach (var item in b)
            //{
            //    Console.WriteLine(item.BankNumber);
            //}



            //bool isRoomService(GuestRequest g1)
            //{
            //    return g1.RoomService;
            //}
            //Predicate<GuestRequest> func = isRoomService;
            //bool x = func(g);
            //List<GuestRequest> l = bl.condition(x);
            Console.ReadKey();
        }
Ejemplo n.º 24
0
 public TaskModel(Task CurrentTask)
 {
     bl = BLFactory.getBL();
     this.CurrentTask = CurrentTask; // fake
 }