Beispiel #1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         List <BE.Host> hosts = bl.GetHostList();
         var            v     = from item in hosts
                                where item.HostKey == int.Parse(UserName.Text)
                                select item;
         v.ToList();
         if (v.FirstOrDefault() == null)
         {
             MessageBox.Show($"Host does not exist", "", MessageBoxButton.OK, MessageBoxImage.Error);
             return;
         }
         if (v.FirstOrDefault().HostPassword != int.Parse(HostPassword.Password))
         {
             MessageBox.Show($"Incorrect password", "", MessageBoxButton.OK, MessageBoxImage.Error);
             return;
         }
         host = bl.GetHostById(int.Parse(UserName.Text));
         new Host(host).ShowDialog();
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #2
0
        public AddHostingUnit(BE.Host ho)
        {
            InitializeComponent();
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            bl          = FactoryBL.GetBl();
            hostingUnit = new BE.HostingUnit();
            BE.Host host = ho;
            this.DataContext = hostingUnit;

            errorMessages = new List <string>();

            //this.HostId.ItemsSource = bl.GetHostList();
            //this.HostId.DisplayMemberPath = "HostKey";
            //this.HostId.SelectedValuePath = "HostKey";

            this.HostId.Text = host.HostKey.ToString();

            this.Area.ItemsSource = Enum.GetValues(typeof(Enums.Area));
            this.Type.ItemsSource = Enum.GetValues(typeof(Enums.HostingUnitType));
            this.Food.ItemsSource = Enum.GetValues(typeof(Enums.Food));

            this.Pool.Text                = "No";
            this.Jacuzzi.Text             = "No";
            this.Porch.Text               = "No";
            this.ChildrenAttractions.Text = "No";
        }
Beispiel #3
0
 public HostLogin()
 {
     InitializeComponent();
     InitializeComponent();
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
     bl   = FactoryBL.GetBl();
     host = new BE.Host();
 }
Beispiel #4
0
 public HostPasswordWindow()
 {
     this.MaxHeight        = SystemParameters.MaximizedPrimaryScreenHeight;
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
     InitializeComponent();
     SystemCommands.MaximizeWindow(this);
     myBL = FactoryBL.getBL();
     host = new Host();
 }
Beispiel #5
0
 public AddHost(/*BE.Host myHoster*/)  //התחרטנו, אין לנו צורך בזהץ אם הוא מחובר אין לו גישה לעמוד הזה ואם לא אז אין טעם:)
 {
     InitializeComponent();
     //  host = myHoster;
     host              = new Host();
     banks             = myBL.GroupByBankNumberOfBranch().OneObjectFromAllKey();
     grid5.DataContext = banks;
     grid3.DataContext = host;
     grid4.DataContext = host;
 }
 public void SendEmail(BE.Host host /*FROM*/, string gReqEmail /*TO*/)
 {
     // TODO: realy send the mail
     if (IsCollectionClearance(host))
     {
         Console.WriteLine("{0} is sending email to {1}....", host.Email, gReqEmail);
     }
     else
     {
         throw new Exception("host not has a CollectionClearance!");
     }
 }
 public AddUnit(BE.Host host, string user)
 {
     InitializeComponent();
     if (hebEnglish.hebrew)
     {
         hebChange();
     }
     owner = host;
     unit  = new BE.HostingUnit();
     this.addunit.DataContext = unit;
     username = user;
 }
Beispiel #8
0
        public AddHost()
        {
            InitializeComponent();
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            bl               = FactoryBL.GetBl();
            host             = new BE.Host();
            this.DataContext = host;

            this.BankBranch.ItemsSource = bl.GetBankAccounts();


            errorMessages = new List <string>();
        }
        public UpdateHost(BE.Host ho)
        {
            InitializeComponent();
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            bl   = FactoryBL.GetBl();
            host = ho;

            this.BankBranchDetails.ItemsSource = bl.GetBankAccounts();
            setHostFields();


            errorMessages = new List <string>();
        }
Beispiel #10
0
        private void AddHost_Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (errorMessages.Any())
                {
                    string err = "Exception: ";
                    foreach (var item in errorMessages)
                    {
                        err += "\n" + item;
                    }

                    MessageBox.Show(err);
                    return;
                }

                if (ID.Text == "" || Name.Text == "" || LastName.Text == "" || Email.Text == "")
                {
                    MessageBox.Show($"you need to fill all details", "", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                if (this.CollectionClearance.Text == "No")
                {
                    host.CollectionClearance = false;
                }
                else
                {
                    host.CollectionClearance = true;
                }

                BankBranch bankBranch = this.BankBranch.SelectedItem as BankBranch;
                host.BankBranchDetails = bankBranch;
                int hh = host.HostKey;
                bl.AddHost(host);
                host             = new BE.Host();
                this.DataContext = host;
                this.Close();
                MessageBox.Show($"The Host was received by the system");

                BE.Host h = bl.GetHostById(hh);
                MessageBox.Show("Your password is: " + h.HostPassword.ToString());
            }
            catch (FormatException)
            {
                MessageBox.Show("check your input and try again");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #11
0
        public static BE.Host Clone(this BE.Host original)
        {
            BE.Host target = new BE.Host();
            target.BankAccount         = original.BankAccount;
            target.CollectionClearance = original.CollectionClearance;
            target.FamilyName          = original.FamilyName;
            target.FhoneNumber         = original.FhoneNumber;
            target.Hostkey             = original.Hostkey;
            target.MailAddress         = original.MailAddress;
            target.numHostingUnit      = original.numHostingUnit;
            target.PrivateName         = original.PrivateName;


            return(target);
        }
 /// <summary>
 /// updates a host's last name
 /// </summary>
 /// <param name="host"></param>
 /// <param name="newName"></param>
 public void UpdateHostFamilyName(BE.Host host, string newName)
 {
     try
     {
         var it = (from item in hostingUnitRoot.Elements()
                   where int.Parse(item.Element("Host").Element("HostKey").Value) == host.HostKey
                   select ConvertHostingUnit(item)).FirstOrDefault();
         it.Owner.FamilyName = newName;
         UpdateHostingUnit(it.Clone());
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public HostingUnit()
        {
            InitializeComponent();
            host = new Host();
            host.BankBranchDetails = new BankBranch();
            Hostings                    = new ObservableCollection <BE.HostingUnit>();
            Orders                      = new ObservableCollection <Order>();
            OrdersOrHostingUnit         = "hostingunit";
            HostingUnitList.DataContext = Hostings;
            OrderList.DataContext       = Orders;
            userControlush userControlush = new userControlush(host);

            UserGrid.Children.Add(userControlush);
            Grid.SetRow(userControlush, 1);
            userControlush.CostumerChange += Controlush_CostumerChange;
        }
        public UpdateUnitWindow(BE.Host currentHost)
        {
            this.currentHost = currentHost;
            this.WindowState = WindowState.Maximized;
            BL.IBL myBL = BlFactory.GetBL();
            InitializeComponent();
            HostUnitsDataGrid.Foreground = Brushes.Black;
            List <HostingUnit> list = myBL.units_of_Host(currentHost);

            foreach (HostingUnit unit in list)
            {
                HostUnitsDataGrid.Items.Add(unit);
            }
            //Erase extra row
            HostUnitsDataGrid.IsReadOnly             = true;
            this.HostUnitsDataGrid.CanUserDeleteRows = true;
        }
Beispiel #15
0
        public static Host Clone(this Host original)
        {
            Host target = new BE.Host();

            target.HostKey           = original.HostKey;
            target.PrivateName       = original.PrivateName;
            target.FamilyName        = original.FamilyName;
            target.PhoneNumber       = original.PhoneNumber;
            target.MailAddress       = original.PhoneNumber;
            target.Age               = original.Age;
            target.BankAccountNumber = original.BankAccountNumber;

            target.BankBranchDetails   = original.BankBranchDetails.Clone();
            target.CollectionClearance = original.CollectionClearance;
            target.PaymentOwed         = original.PaymentOwed;

            return(target);
        }
Beispiel #16
0
        private void ShowHostingUnit_Click(object sender, RoutedEventArgs e)
        {
            this.Close();

            var v = from item in bl.GetHostList()
                    where item.HostKey == host.HostKey
                    select item;

            if (v.FirstOrDefault() == null)
            {
                MessageBox.Show("The Host Does Not Exist");
            }

            host = v.First();

            BE.HostingUnit hostingUnit = (BE.HostingUnit)HostingUnitsList.SelectedItem;
            new HostingUnit(hostingUnit).ShowDialog();
            new Host(host).ShowDialog();
        }
Beispiel #17
0
        /// <summary>
        /// the func check if the host we want to delete have any bookes hosting unit .
        /// first we make a list of all the booked hosting unit
        /// second we chack if one of them belong to the host we want to delete.
        /// </summary>
        /// <param name="TheHost"></param>
        public void DeleteHost(BE.Host TheHost)
        {
            try
            {
                List <BE.HostingUnit> bookedHostingUint = dal.getListOfHostingUnits()
                                                          .FindAll(delegate(HostingUnit hostingUnit) { return(!CheakDatesAreFree(hostingUnit, DateTime.Now, DateTime.Now.AddMonths(11))); });

                if (bookedHostingUint.Any(delegate(HostingUnit HostingUnit) { return(HostingUnit.Owner.HostKey == TheHost.HostKey); }))
                {
                    throw new GenralException("Host", "the host have a booked hostingunit");
                }
                else
                {
                    dal.DeleteHost(TheHost);
                }
            }
            catch (GenralException E)
            { throw E; }
        }
Beispiel #18
0
        public bool IsCanCancalCollectionClearance(BE.Host host)
        {
            List <BE.HostingUnit> units = _dal.GetAllHostingUnits();
            // get all HostingUnit that host is there owner
            List <BE.HostingUnit> hostingUnit = (from unit in units
                                                 where unit.Owner.HostKey == host.HostKey
                                                 select unit).ToList();

            // check if for all units there is no open order
            foreach (BE.HostingUnit unit in units)
            {
                if (IsPossibleToDelete(unit) == false)
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #19
0
        public Host(BE.Host ho)
        {
            InitializeComponent();
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            bl   = FactoryBL.GetBl();
            host = ho;

            setHostFields();
            //this.BankBranch.ItemsSource = bl.GetBankAccounts();

            //errorMessages = new List<string>();

            List <BE.HostingUnit> hostingUnits = (from item in bl.GetHostingUnitList()
                                                  where host.HostKey == item.Owner.HostKey
                                                  select item).ToList();

            //List < BE.HostingUnit > hostingUnits = bl.GetHostingUnitList();
            HostingUnitsList.ItemsSource = hostingUnits;

            this.HostingUnitsList.ItemsSource = hostingUnits;
        }
Beispiel #20
0
 public void DeleteHost(BE.Host TheHost)
 {
     try
     {
         bool        Flag = false;
         List <Host> L    = DS.DataSource.ListHosts;
         for (int i = 0; i < L.Count; i++)
         {
             if (L[i].HostKey == TheHost.HostKey)
             {
                 L.Remove(L[i]); //need to check if work good
                 Flag = true;
             }
         }
         if (Flag == false)
         {
             throw new MissingIdException("Host", TheHost.HostKey);
         }
     }
     catch (MissingIdException E) { throw E; }
 }
Beispiel #21
0
 public void UpdateHost(BE.Host theHost)
 {
     try
     {
         bool        Flag = false;
         List <Host> L    = DS.DataSource.ListHosts;
         for (int i = 0; i < L.Count; i++)
         {
             if (L[i].HostKey == theHost.HostKey)
             {
                 L[i] = theHost; //need to check if work good
                 Flag = true;
             }
         }
         if (Flag == false)
         {
             throw new MissingIdException("GuestRequest", theHost.HostKey);
         }
     }
     catch (MissingIdException E) { throw E; }
 }
Beispiel #22
0
        public static BE.Host Clone(this BE.Host original)
        {
            BE.Host target = new BE.Host();
            target.HostKey                           = original.HostKey;
            target.password                          = original.password;
            target.PrivateName                       = original.PrivateName;
            target.FamilyName                        = original.FamilyName;
            target.PhoneNumber                       = original.PhoneNumber;
            target.MailAddress                       = original.MailAddress;
            target.numberOfUints                     = original.numberOfUints;
            target.HostBankAccuont                   = new BankAccount();
            target.HostBankAccuont.BankName          = original.HostBankAccuont.BankName;
            target.HostBankAccuont.BankAccountNumber = original.HostBankAccuont.BankAccountNumber;
            target.HostBankAccuont.BranchAddress     = original.HostBankAccuont.BranchAddress;
            target.HostBankAccuont.BranchCity        = original.HostBankAccuont.BranchCity;
            target.HostBankAccuont.BranchNumber      = original.HostBankAccuont.BranchNumber;

            target.CollectionClearance = original.CollectionClearance;

            return(target);
        }
Beispiel #23
0
        /// <summary>
        /// uodates a host's family name
        /// </summary>
        /// <param name="host"></param>
        /// <param name="newName"></param>
        public void UpdateHostFamilyName(BE.Host host, string newName)
        {
            if (!GetHostingUnitList().Any(y => y.Owner.HostKey == host.HostKey))
            {
                throw new NullReferenceException("the host doesn't exist ");
            }
            var x = (from newHost in dalAccess.GetHostingUnitList()
                     where newHost.Owner.HostKey == host.HostKey
                     select newHost).FirstOrDefault();

            if (x.Owner.FamilyName == newName)
            {
                throw new InvalidDataException("the host already has that name");
            }
            try
            {
                dalAccess.UpdateHostFamilyName(x.Owner, newName);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Beispiel #24
0
 public bool IsCollectionClearance(BE.Host host)
 {
     return(host.CollectionClearance);
 }
Beispiel #25
0
 /// <summary>
 /// the function scans the list of hosts and checks if the id exsits
 /// </summary>
 /// <param name="HostKey"></param>
 /// <returns>return true if exsits and by reference the host</returns>
 public void UpdateHost(BE.Host theHost)
 {
     dal.UpdateHost(theHost);
 }
Beispiel #26
0
        static void Main(string[] args)
        {
            DateTime entryDate   = new DateTime(2020, 4, 5),
                     releaseDate = new DateTime(2020, 5, 12);

            BE.Host host = new BE.Host()
            {
                HostKey             = ++BE.Configuration.HostKey,
                Balance             = 105,
                PrivateName         = "no",
                FamilyName          = "money",
                PhoneNumber         = "05050505",
                Email               = "*****@*****.**",
                CollectionClearance = true,
                BankBranchDetails   = new BE.BankBranch()
                {
                    BankNumber    = ++BE.Configuration.BankNumber,
                    BankName      = "take your money",
                    BranchAddress = "take your money city",
                    BranchCity    = "no money city",
                    BranchNumber  = 15
                },
                BankAccountNumber = 130559,
            };
            BE.GuestRequest guestRequest = new BE.GuestRequest
            {
                GuestRequestKey     = ++BE.Configuration.GuestRequestKey,
                PrivateName         = "shachar",
                FamilyName          = "markovich",
                Email               = "*****@*****.**",
                Stat                = BE.Enums.Status.NotYetApproved,
                RegistrationDate    = DateTime.Now,
                EntryDate           = new DateTime(2020, 8, 9),
                ReleaseDate         = new DateTime(2020, 8, 12),
                Area                = BE.Enums.Area.Center,
                type                = BE.Enums.UnitType.Hotel,
                Adults              = 2,
                Children            = 3,
                Pool                = true,
                Jecuzzi             = true,
                Garden              = true,
                ChildrenAttractions = true
            };
            BE.HostingUnit hostingUnit = new BE.HostingUnit()
            {
                HostingUnitKey  = ++BE.Configuration.HostingUnitKey,
                HostingUnitName = "hotel california",
                Owner           = host,
                type            = BE.Enums.UnitType.Hotel,
                Area            = BE.Enums.Area.Center,
                Diary           = new bool[BE.Configuration._month, BE.Configuration._days],
            };
            BE.Order order = new BE.Order()
            {
                OrderKey        = ++BE.Configuration.OrderKey,
                HostingUnitKey  = hostingUnit.HostingUnitKey,
                GuestRequestKey = guestRequest.GuestRequestKey,
                Status          = guestRequest.Stat,
                CreateDate      = DateTime.Now,
                OrderDate       = new DateTime(2020, 3, 3)
            };


            _bl.AddGuestRequest(guestRequest);
            _bl.AddHostingUnit(hostingUnit);
            _bl.AddOrder(order);

            Console.WriteLine("adding the next instance Successfully:\n");
            Console.WriteLine(host);
            Console.WriteLine();
            Console.WriteLine(guestRequest);
            Console.WriteLine();
            Console.WriteLine(order);
            Clear();


            if (_bl.IsDateArmor(hostingUnit, entryDate, releaseDate))
            {
                Console.WriteLine("the following hostingUnit has free rooms between " + entryDate.toString() + " to " + releaseDate.toString());
                Console.WriteLine(hostingUnit);
                Clear();
            }

            Console.WriteLine($"host.Balance before taking fee: {host.Balance}");
            _bl.TakeFee(order);
            List <BE.HostingUnit> unit2 = _bl.AccordingTo(unit => hostingUnit.Owner.HostKey == unit.Owner.HostKey);

            Console.WriteLine($"host.Balance after taking fee: {unit2.Single().Owner.Balance}");
            Clear();

            Console.WriteLine($"hostingUnit.diary before update:\n{hostingUnit.Diary.toString()}");
            _bl.UpdateCalendar(hostingUnit, entryDate, releaseDate);
            unit2 = _bl.AccordingTo(unit => hostingUnit.HostingUnitKey == unit.HostingUnitKey);
            Console.WriteLine($"hostingUnit.diary after update:\n{unit2.Single().Diary.toString()}");
            Clear();


            _bl.SendEmail(host /*FROM*/, "*****@*****.**" /*TO*/);
            int daysNumber = _bl.OrderCount(guestRequest);

            Console.WriteLine($"number of orders sent to {guestRequest.GuestRequestKey} is: {daysNumber}");
            daysNumber = _bl.ApprovedCount(hostingUnit);
            Console.WriteLine($"number of all order that have been closed for the hosting unit {hostingUnit.HostingUnitKey} is: {daysNumber}");
            Clear();

            List <BE.HostingUnit> c = _bl.ListOptionsFree(entryDate, daysNumber);

            foreach (var item in c)
            {
                Console.WriteLine(item);
            }

            Console.WriteLine("\n");
            List <BE.Order> d = _bl.AtLeastnDays(daysNumber);

            foreach (var item in c)
            {
                Console.WriteLine(item);
            }

            Clear();

            List <IGrouping <BE.Enums.Area, BE.GuestRequest> > f = _bl.GroupGuestRequestByArea();
            List <IGrouping <int, BE.GuestRequest> >           g = _bl.GroupGuestRequestByPeopleCount();
            List <IGrouping <int, BE.Host> > h = _bl.GroupHostByfHostingUnitCount();
            List <IGrouping <BE.Enums.Area, BE.HostingUnit> > i = _bl.GroupHostingUnitByArea();
        }
        static DataSource()
        {
            guestrequestList = new List <GuestRequest>();
            hostingunitList  = new List <HostingUnit>();
            orderList        = new List <Order>();


            Host host1 = new BE.Host();

            host1.HostKey           = 10000367;
            host1.PrivateName       = "Samuel";
            host1.FamilyName        = "Cohen";
            host1.PhoneNumber       = 0582042589;
            host1.MailAddress       = "*****@*****.**";
            host1.BankBranchDetails = new BankBranch {
                BankNumber = 0001, BankName = "leumi", BranchNumber = 335, BranchAdress = "hapisga 10", BranchCity = "jerusalem"
            };
            host1.BankAccountNumber   = 31231;
            host1.CollectionClearance = true;



            //Host host2 = new Host();

            //host2.HostKey = 10000368;
            //host2.PrivateName = "Dina";
            //host2.FamilyName = "Schwartz";
            //host2.PhoneNumber = 0584567822;
            //host2.MailAddress = "*****@*****.**";
            //host2.BankBranchDetails = new BankBranch { BankNumber = 0001, BankName = "leumi", BranchNumber = 335, BranchAdress = "hapisga 10", BranchCity = "jerusalem" };
            //host2.BankAccountNumber = 31421;
            //host2.CollectionClearance = true;


            //GuestRequest guest1 = new GuestRequest();

            //guest1.GuestRequestKey = 20000345;
            //guest1.PrivateName = "Sarah";
            //guest1.FamilyName = "Rottenberg";
            //guest1.MailAddress = "*****@*****.**";
            //guest1.StatusRequest = MyEnums.StatusRequest.Active;
            //guest1.RegistrationDate = new DateTime(2019, 09, 20);
            //guest1.EntryDate = new DateTime(2019, 10, 12);
            //guest1.ReleaseDate = new DateTime(2019, 10, 18);
            //guest1.Area = MyEnums.Area.South;
            //guest1.SubArea = "Dead Sea";
            //guest1.Type = MyEnums.Type.Zimmer;
            //guest1.Adults = 2;
            //guest1.Children = 0;
            //guest1.Pool = MyEnums.Pool.Possible;
            //guest1.Jacuzzi = MyEnums.Jacuzzi.Possible;
            //guestrequestList.Add(guest1);



            //GuestRequest guest2 = new GuestRequest();


            //guest2.GuestRequestKey = 20000567;
            //guest2.PrivateName = "Stephane";
            //guest2.FamilyName = "Ross";
            //guest2.MailAddress = "*****@*****.**";
            //guest2.StatusRequest = MyEnums.StatusRequest.Active;
            //guest2.EntryDate = new DateTime(2019, 11, 15);
            //guest2.ReleaseDate = new DateTime(2019, 11, 20);
            //guest2.Area = MyEnums.Area.Center;
            //guest2.Type = MyEnums.Type.Appartment;
            //guest2.Adults = 2;
            //guest2.Children = 3;
            //guest2.Garden = MyEnums.Garden.Possible;
            //guest2.ChildrenAttractions = MyEnums.ChildrenAttractions.Possible;
            //guestrequestList.Add(guest2);



            //GuestRequest guest3 = new GuestRequest();

            //guest3.GuestRequestKey = 20000890;
            //guest3.PrivateName = "Esti";
            //guest3.FamilyName = "Rozen";
            //guest3.MailAddress = "*****@*****.**";
            //guest3.StatusRequest = MyEnums.StatusRequest.Active;
            //guest3.RegistrationDate = new DateTime(2019, 05, 15);
            //guest3.EntryDate = new DateTime(2019, 07, 06);
            //guest3.ReleaseDate = new DateTime(2019, 07, 15);
            //guest3.Area = MyEnums.Area.North;
            //guest3.Type = MyEnums.Type.Camping;
            //guest3.Adults = 4;
            //guestrequestList.Add(guest3);



            //HostingUnit unit1 = new HostingUnit();

            //unit1.HostingUnitKey = 30000005;
            //unit1.Owner = host1;
            //unit1.HostingUnitName = "The house 1";
            //unit1.subArea = "Nahlaos";
            //unit1.jaccuzi = true;
            //unit1.garden = true;
            //unit1.childrenAttractions = true;
            //unit1.kids = 2;
            //unit1.area = MyEnums.Area.Jerusalem;
            //unit1.pool = true;
            //unit1.adults = 3;


            //HostingUnit unit2 = new HostingUnit();

            //unit2.HostingUnitKey = 30000057;
            //unit2.Owner = host2;
            //unit2.HostingUnitName = "The house 2";
            //unit2.area = MyEnums.Area.Jerusalem;
            //unit2.pool = false;
            //unit2.adults = 5;
            //unit1.jaccuzi = true;
            //unit1.garden = true;
            //unit1.childrenAttractions = false;
            //unit1.kids = 1;



            //HostingUnit unit3 = new HostingUnit();

            //unit3.Owner = host1;
            //unit3.HostingUnitName = "The house 3";
            //unit3.area = MyEnums.Area.Center;
            //unit3.pool = true;
            //unit3.adults = 6;
        }
        static DataSource()
        {
            guestRequestsList = new List <GuestRequest>();
            hostsList         = new List <Host>();
            ordersList        = new List <Order>();
            hostingUnitsList  = new List <HostingUnit>();
            bankBranchesList  = new List <BankBranch>();

            BE.GuestRequest guestRequest = new BE.GuestRequest();
            guestRequest.privateName           = "Sarah";
            guestRequest.familyName            = "Toledano";
            guestRequest.mailAddress           = "*****@*****.**";
            guestRequest.Status                = Status.email_sent;
            guestRequest.registrationDate      = new DateTime(01 / 01 / 2019);
            guestRequest.enteryDate            = new DateTime(01 / 10 / 2019);
            guestRequest.releaseDate           = new DateTime(02 / 20 / 2019);
            guestRequest.Area                  = Area.jerusalem;
            guestRequest.Type                  = BE.Type.hotel;
            guestRequest.adults                = 2;
            guestRequest.children              = 1;
            guestRequest.Pool                  = Pool.yes;
            guestRequest.Jacuzzi               = Jacuzzi.yes;
            guestRequest.Wifi                  = Wifi.yes;
            guestRequest.BBQArea               = BBQArea.yes;
            guestRequest.ChildrenAtracttions   = ChildrenAttractions.yes;
            guestRequest.CollectionClearance   = CollectionClearance.no;
            guestRequest.CustomerRequestStatus = CustomerRequestStatus.approved;
            guestRequest.Garden                = Garden.yes;
            guestRequest.Meals                 = Meals.yes;
            guestRequest.Phone                 = Phone.doesnt_matter;
            guestRequest.RoomService           = RoomService.yes;
            guestRequest.SmokingArea           = SmokingArea.no;
            guestRequest.SoccerField           = SoccerField.doesnt_matter;
            guestRequest.Television            = Television.yes;
            guestRequest.Trampoline            = Trampoline.yes;

            BE.GuestRequest guestRequest1 = new BE.GuestRequest();
            guestRequest1.privateName           = "Shirel";
            guestRequest1.familyName            = "Ben-Chaim";
            guestRequest1.mailAddress           = "*****@*****.**";
            guestRequest1.Status                = Status.dealt_with;
            guestRequest1.registrationDate      = new DateTime(01 / 30 / 2019);
            guestRequest1.enteryDate            = new DateTime(08 / 23 / 2019);
            guestRequest1.releaseDate           = new DateTime(09 / 10 / 2019);
            guestRequest1.Area                  = Area.north;
            guestRequest1.Type                  = BE.Type.apartement;
            guestRequest1.adults                = 2;
            guestRequest1.children              = 15;
            guestRequest1.Pool                  = Pool.yes;
            guestRequest1.Jacuzzi               = Jacuzzi.yes;
            guestRequest1.Wifi                  = Wifi.no;
            guestRequest1.BBQArea               = BBQArea.yes;
            guestRequest1.ChildrenAtracttions   = ChildrenAttractions.yes;
            guestRequest1.CollectionClearance   = CollectionClearance.yes;
            guestRequest1.CustomerRequestStatus = CustomerRequestStatus.closed_by_website;
            guestRequest1.Garden                = Garden.yes;
            guestRequest1.Meals                 = Meals.yes;
            guestRequest1.Phone                 = Phone.no;
            guestRequest1.RoomService           = RoomService.yes;
            guestRequest1.SmokingArea           = SmokingArea.no;
            guestRequest1.SoccerField           = SoccerField.yes;
            guestRequest1.Television            = Television.no;
            guestRequest1.Trampoline            = Trampoline.yes;

            BE.Host host = new BE.Host();
            host.hostKey     = 12345678;
            host.privateName = "Mike";
            host.familyName  = "Ross";
            host.phoneNumber = 0547201224;
            host.mailAddress = "*****@*****.**";
            //host.BankBranchDetails = ;
            host.bankAccountNumber   = "2453566";
            host.CollectionClearance = CollectionClearance.yes;

            BE.Host host1 = new BE.Host();
            host.hostKey     = 87654321;
            host.privateName = "Harvey";
            host.familyName  = "Specter";
            host.phoneNumber = 0547235322;
            host.mailAddress = "*****@*****.**";
            //host.BankBranchDetails = ;
            host.bankAccountNumber   = "3436457";
            host.CollectionClearance = CollectionClearance.yes;

            BE.Order order = new BE.Order();
            order.createDate = new DateTime(05 / 25 / 2019);
            order.orderDate  = new DateTime(04 / 20 / 2019);
            order.Status     = Status.dealt_with;

            BE.Order order1 = new BE.Order();
            order.createDate = new DateTime(06 / 26 / 2019);
            order.orderDate  = new DateTime(07 / 12 / 2019);
            order.Status     = Status.email_sent;

            BE.HostingUnit hostingUnit = new BE.HostingUnit();
            hostingUnit.hostingUnitName     = "apartement1";
            hostingUnit.Pool                = Pool.yes;
            hostingUnit.RoomService         = RoomService.yes;
            hostingUnit.SmokingArea         = SmokingArea.no;
            hostingUnit.SoccerField         = SoccerField.doesnt_matter;
            hostingUnit.Television          = Television.yes;
            hostingUnit.Trampoline          = Trampoline.yes;
            hostingUnit.Wifi                = Wifi.doesnt_matter;
            hostingUnit.BBQArea             = BBQArea.doesnt_matter;
            hostingUnit.ChildrenAtracttions = ChildrenAttractions.no;
            hostingUnit.Garden              = Garden.yes;
            hostingUnit.Jacuzzi             = Jacuzzi.yes;
            hostingUnit.Meals               = Meals.yes;
            hostingUnit.Phone               = Phone.doesnt_matter;
            //hostingUnit.Owner;

            BE.HostingUnit hostingUnit1 = new BE.HostingUnit();
            hostingUnit.hostingUnitName     = "apartement2";
            hostingUnit.Pool                = Pool.yes;
            hostingUnit.RoomService         = RoomService.yes;
            hostingUnit.SmokingArea         = SmokingArea.yes;
            hostingUnit.SoccerField         = SoccerField.yes;
            hostingUnit.Television          = Television.yes;
            hostingUnit.Trampoline          = Trampoline.no;
            hostingUnit.Wifi                = Wifi.yes;
            hostingUnit.BBQArea             = BBQArea.yes;
            hostingUnit.ChildrenAtracttions = ChildrenAttractions.doesnt_matter;
            hostingUnit.Garden              = Garden.no;
            hostingUnit.Jacuzzi             = Jacuzzi.yes;
            hostingUnit.Meals               = Meals.yes;
            hostingUnit.Phone               = Phone.no;
            //hostingUnit.Owner;

            BE.BankBranch bankBranch = new BE.BankBranch();
            bankBranch.bankNumber    = 11;
            bankBranch.bankName      = "diskont";
            bankBranch.branchNumber  = 41;
            bankBranch.branchAddress = "yafo 220";
            bankBranch.BranchCity    = BranchCity.tel_aviv;

            BE.BankBranch bankBranch1 = new BE.BankBranch();
            bankBranch.bankNumber    = 10;
            bankBranch.bankName      = "leumi";
            bankBranch.branchNumber  = 70;
            bankBranch.branchAddress = "hapisga 22";
            bankBranch.BranchCity    = BranchCity.jerusalem;

            BE.BankBranch bankBranch2 = new BE.BankBranch();
            bankBranch.bankNumber    = 9;
            bankBranch.bankName      = "mizrachi tfahot";
            bankBranch.branchNumber  = 32;
            bankBranch.branchAddress = "modiin";
            bankBranch.BranchCity    = BranchCity.tveria;

            BE.BankBranch bankBranch3 = new BE.BankBranch();
            bankBranch.bankNumber    = 8;
            bankBranch.bankName      = "igud";
            bankBranch.branchNumber  = 20;
            bankBranch.branchAddress = "herzl 21";
            bankBranch.BranchCity    = BranchCity.rehovot;

            BE.BankBranch bankBranch4 = new BE.BankBranch();
            bankBranch.bankNumber    = 7;
            bankBranch.bankName      = "poalim";
            bankBranch.branchNumber  = 56;
            bankBranch.branchAddress = "arlozorov 12";
            bankBranch.BranchCity    = BranchCity.tel_aviv;
        }