コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();
            bl          = Factory_BL.getBL();
            bool[,] mat = new bool[5, 7];
            setMet(mat);
            Address a1, a2;

            a1.city = "Hifa"; a1.streetName = "Nosh"; a1.houseNumber = 4;
            a2.city = "Jersalem"; a2.streetName = "Dag"; a2.houseNumber = 6;
            try
            {
                bl.AddTester("111111111", "Nadv", "Rabinovich", new DateTime(1970, 3, 11), gender.male, "0528434091", a1, 20, 20, carType.privateCar, mat, 50);
                bl.AddTester(new Tester("111111123", "Ester", "Malka", new DateTime(1972, 4, 13), gender.female, "0528434093", a2, 20, 20, carType.privateCar, 50, mat));
                bl.AddTrainee("312589963", "Rafi", "Lev", new DateTime(1990, 3, 11), gender.male, "0525525224", a1, carType.privateCar, gear.manual, "Hermon", "Yossi", 30);
                bl.AddTrainee(new Trainee("312589964", "Noam", "Getz", new DateTime(1994, 6, 14), gender.male, "0525525224", a2, carType.privateCar, gear.manual, "Hermon", "Yossi", 28));
                bl.AddTrainee("312589967", "Tal", "Madmon", new DateTime(1990, 3, 11), gender.male, "0525525223", a1, carType.privateCar, gear.manual, "Ways", "Efi", 30);
                bl.AddTest("312589963", a1, new DateTime(2018, 12, 31, 13, 0, 0));
                bl.AddTest("312589963", a1, new DateTime(2019, 1, 7, 13, 0, 0));
                string str = "";

                foreach (var v in bl.GetAllTrainees())
                {
                    str += (v.Id + " " + v.Name + " " + v.FamilyName);
                    str += "\n";
                }
                MainLabel.Content = "Trainees:";
                showTestBox.Text  = str;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
 /// <summary>
 /// Constructor , initialize data
 /// </summary>
 public ClientWindow()
 {
     InitializeComponent();
     client           = new Client();
     this.DataContext = client;
     bl = Factory_BL.GetBL();
 }
コード例 #3
0
        public HostOrder(string eMail) : this()
        {
            bL = Factory_BL.getBL();
            var hostingUnits  = bL.HostingUnitList(eMail);
            var guestRequests = bL.GuestRequestList();
            int index         = 0;

            foreach (var guest in guestRequests)
            {
                foreach (var hosting in hostingUnits)
                {
                    HostingUnit hostingUnit = bL.GetHostingUnit(eMail, hosting);
                    if (bL.SendGuestToHost(guest, hostingUnit))
                    {
                        GuestRequestOrderUserControl a = new GuestRequestOrderUserControl(hostingUnit, guest);
                        MainGrid.Children.Add(a);
                        MainGrid.RowDefinitions.Add(new RowDefinition()
                        {
                            Height = GridLength.Auto
                        });
                        Grid.SetRow(a, index + 1);
                        index++;
                    }
                }
            }
        }
コード例 #4
0
 /// <summary>
 /// Constructor , initialize data
 /// </summary>
 public DeleteDish()
 {
     InitializeComponent();
     dish = new Dish();
     bl   = Factory_BL.GetBL();
     this.ListCombobox.ItemsSource = bl.ListOfDish();
     this.CancelButton.IsEnabled   = false;
 }
コード例 #5
0
 public AddHostingUnit()
 {
     InitializeComponent();
     WindowStartupLocation               = WindowStartupLocation.CenterScreen;
     areaComboBox.ItemsSource            = Enum.GetValues(typeof(Area)).Cast <Area>().Where(i => i.ToString() != "All");
     HostingUnitTypeComboBox.ItemsSource = Enum.GetValues(typeof(Type)).Cast <Type>().Where(i => i.ToString() != "All");
     bL = Factory_BL.getBL();
 }
コード例 #6
0
 /// <summary>
 /// Constructor , initialize the window , data binding, and combobox
 /// </summary>
 public AddBranch()
 {
     InitializeComponent();
     branch           = new Branch();
     this.DataContext = branch;
     bl = Factory_BL.GetBL();
     this.cashroutLevelComboBox.ItemsSource = Enum.GetValues(typeof(CasheRoutLevel));
 }
コード例 #7
0
 /// <summary>
 /// We loced and ulocked the filed by tester login and log out
 /// </summary>
 public UpdateTest()
 {
     InitializeComponent();
     My_bl = Factory_BL.getBL();
     StudentIDTB.IsEnabled    = false;
     HourDispalyLabel.Content = "Hour:";
     LockFiled();
 }
コード例 #8
0
 /// <summary>
 /// Constructor, initialize all data
 /// </summary>
 public DeleteOrderWindow()
 {
     InitializeComponent();
     order = new Order();
     // getting all the function
     bl = Factory_BL.GetBL();
     this.ListCombobox.ItemsSource = bl.ListOfOrder();
     this.CancelButton.IsEnabled   = false;
 }
コード例 #9
0
 /// <summary>
 /// Constructor , initalize data
 /// </summary>
 public AddDish()
 {
     InitializeComponent();
     this.requestComboBox.ItemsSource    = Enum.GetValues(typeof(CasheRoutLevel));
     this.sizeOfDishComboBox.ItemsSource = Enum.GetValues(typeof(size));
     dish             = new Dish();
     this.DataContext = dish;
     bl = Factory_BL.GetBL();
 }
コード例 #10
0
 /// <summary>
 /// Constructor , initialize data
 /// </summary>
 public DeleteBranch()
 {
     InitializeComponent();
     branch           = new Branch();
     this.DataContext = branch;
     bl = Factory_BL.GetBL();
     ListCombobox.ItemsSource    = bl.ListOfBranch();
     this.CancelButton.IsEnabled = false;
 }
コード例 #11
0
 /// <summary>
 /// Constructor , initialize data
 /// </summary>
 public UpdateDish()
 {
     InitializeComponent();
     dish             = new Dish();
     this.DataContext = dish;
     bl = Factory_BL.GetBL();
     ListBranch.ItemsSource              = bl.ListOfDish();
     nameTextBox.IsEnabled               = preparationTimeTextBox.IsEnabled = priceOfDishTextBox.IsEnabled = quantityTextBox.IsEnabled = requestComboBox.IsEnabled = sizeOfDishComboBox.IsEnabled = false;
     this.requestComboBox.ItemsSource    = Enum.GetValues(typeof(BE.CasheRoutLevel));
     this.sizeOfDishComboBox.ItemsSource = Enum.GetValues(typeof(size));
 }
コード例 #12
0
 /// <summary>
 /// Constructor , initialize data , locking button
 /// </summary>
 public UpdateMenuOrderWindow()
 {
     InitializeComponent();
     order            = new Ordered_Dish();
     this.DataContext = order;
     bl = Factory_BL.GetBL();
     this.OrderListCombobox.ItemsSource = bl.ListOfOrder();
     this.DateTimetrueLabel.Content     = DateTime.Now;
     this.SearchButton.IsEnabled        = this.NextButton.IsEnabled = false;
     this.menuIDTextBox.IsEnabled       = this.PriceTextBox.IsEnabled = this.Nametextbox.IsEnabled = ListOfDishCombobox.IsEnabled = false;
     this.quantityTextBox.IsEnabled     = this.SearchButton.IsEnabled = false;
 }
コード例 #13
0
 /// <summary>
 /// Constructor , initialize data
 /// </summary>
 public UpdateBranch()
 {
     InitializeComponent();
     branch           = new Branch();
     this.DataContext = branch;
     bl = Factory_BL.GetBL();
     // loading data
     this.ListBranch.ItemsSource            = bl.ListOfBranch();
     this.cashroutLevelComboBox.ItemsSource = Enum.GetValues(typeof(BE.CasheRoutLevel));
     // lock all the button
     this.branchNameTextBox.IsEnabled = branchAddressTextBox.IsEnabled = branchNumberTelephoneTextBox.IsEnabled = nameInchargeTextBox.IsEnabled = numberOfWorkerTextBox.IsEnabled = numberDeliveryManAvailabeTextBox.IsEnabled = cashroutLevelComboBox.IsEnabled = false;
 }
コード例 #14
0
 /// <summary>
 /// Constructor , initialize data, locking button
 /// </summary>
 /// <param name="branch"></param>
 public MenuOrderWindow(int branch)
 {
     InitializeComponent();
     this.Branch      = branch;
     order            = new Ordered_Dish();
     this.DataContext = order;
     bl = Factory_BL.GetBL();
     this.NumberOrderLabel.Content       = bl.ListOfOrder().Last().OrderNumber;
     this.DateTimetrueLabel.Content      = DateTime.Now;
     this.ListOfDishCombobox.ItemsSource = bl.ByCashRoutonly(bl.ListOfOrder().Last().choice);
     this.SearchButton.IsEnabled         = this.NextButton.IsEnabled = false;
     this.menuIDTextBox.Text             = this.PriceTextBox.Text = this.quantityTextBox.Text = Nametextbox.Text = "";
 }
コード例 #15
0
        public TesterWindow()
        {
            InitializeComponent();
            bL = Factory_BL.getBL();
            AddBoutton.IsChecked = true;
            foreach (var v in BE.Configuration.phoneNumberPrefixes)
            {
                phoneNumerCombobox.Items.Add(v);
            }
            birthDateDatePicker.DisplayDateEnd   = DateTime.Now.AddYears(BE.Configuration.Tester_MIN_AGE * -1);
            birthDateDatePicker.DisplayDateStart = DateTime.Now.AddYears(BE.Configuration.Maximum_Tester_age * -1);
            expiranceCarComboBox.DataContext     = Enum.GetNames(typeof(BE.MyEnum.carType)).ToList();

            myGenderComboBox.ItemsSource = Enum.GetValues(typeof(BE.MyEnum.gender));
        }
コード例 #16
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            bL = Factory_BL.getBL();
            Host host = new Host();

            if (bL.IsHostExists(email.Text))
            {
                if (bL.CheckPass(email.Text, pword.Text))
                {
                    this.Close();
                    HostInterface hostInterface = new HostInterface(email.Text);
                    hostInterface.ShowDialog();
                }
                else
                {
                    MessageBox.Show($"The combination of email address and password you entered does not match.", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            else
            {
                if (email.Text == "" || pword.Text == "" || First_name.Text == "" || Last_Name.Text == "" || Phone_number.Text == "" || BankAccountNumber.Text == "")
                {
                    MessageBox.Show($"Please fill all the fields!", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                else
                {
                    bL.SetHostKey(host);
                    host.MailAddress       = email.Text;
                    host.Password          = pword.Text;
                    host.FirstName         = First_name.Text;
                    host.LastName          = Last_Name.Text;
                    host.PhoneNumber       = Phone_number.Text;
                    host.BankAccountNumber = int.Parse(BankAccountNumber.Text);
                    if (CollectionClearanceCheckBox.IsChecked == true)
                    {
                        login_button.IsEnabled = false;
                        bL.AddHost(host);
                        this.Close();
                        new HostInterface(email.Text).ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("please accept collections clearance!");
                    }
                }
            }
        }
コード例 #17
0
        static void Main(string[] args)
        {
            IBL bl = Factory_BL.getBL();



            Address a;

            a.city = "Hifa"; a.streetName = " The Pool"; a.houseNumber = 3;
            Trainee T = new Trainee("111111111", "Maoz", "Smith", new DateTime(2005, 3, 11), (gender)1, "0525525223", a, (carType)2, (gear)1, "kolo", "moshe", 100);

            // Console.WriteLine(T.ToString());
            bool[,] mat = new bool[5, 6];
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 6; j++)
                {
                    if ((j + 2) % 2 == 0)
                    {
                        mat[i, j] = true;
                    }
                    else
                    {
                        mat[i, j] = false;
                    }
                }
            }

            Tester tester = new Tester("444444444", "Nadav", "Rabinovich", new DateTime(1970, 12, 23), (gender)1, "0522848424", a, 30, 17, (carType)3, 60, mat);

            try
            {
                bl.AddTester("444444444", "Nadav", "Rabinovich", new DateTime(1970, 12, 23), (gender)0, "0522848424", a, 30, 17, (carType)3, mat, 30);
                bl.AddTester("111111111", "Ester", "Malka", new DateTime(1970, 12, 23), (gender)0, "0522848424", a, 30, 17, (carType)3, mat, 30);
                bl.AddTrainee("312589963", "Maoz", "Lex", new DateTime(1994, 3, 11), (gender)1, "0525525223", a, (carType)4, gear.manual, "hermon", "avi", 28);
                bl.AddTrainee("312589964", "Rafi", "Lev", new DateTime(1995, 3, 3), (gender)1, "0525525243", a, (carType)4, gear.manual, "hermon", "avi", 36);
                bl.AddTrainee("312589946", "Tomer", "Fridman", new DateTime(1995, 3, 3), (gender)1, "0525525243", a, (carType)4, gear.manual, "ways", "avi", 36);
                bl.AddTest("312589963", a, new DateTime(2018, 12, 18, 11, 0, 0));
                bl.AddTest("312589964", a, new DateTime(2019, 12, 18, 9, 0, 0));
                IEnumerable <IGrouping <string, Trainee> > answer   = bl.TraineeBySchool(true);
                IEnumerable <IGrouping <int, Trainee> >    trainees = bl.AllTraineesByNumberOfTests();
            }
            catch (Exception ex)
            { Console.WriteLine(ex.Message);
              Console.WriteLine(ex.Data); }
        }
コード例 #18
0
 public TesterViweWindow()
 {
     InitializeComponent();
     my_bl = Factory_BL.getBL();
     testerListView.DataContext = my_bl.GetAllTesters();
     WorkHoursUC.IsEnabled      = false;
     DayAndHourBU.Visibility    = Visibility.Hidden;
     DayOfWeekCB.IsEnabled      = false;
     HourCB.IsEnabled           = false;
     for (int i = 9; i < 15; i++)
     {
         HourCB.Items.Add(i.ToString());
     }
     for (int i = 0; i < 5; i++)
     {
         DayOfWeekCB.Items.Add((DayOfWeek)i);
     }
     LicenceTypeCB.Visibility         = Visibility.Hidden;
     NumberOfTestsComboBox.Visibility = Visibility.Hidden;
 }
コード例 #19
0
        public GuestRequestWindows()
        {
            InitializeComponent();
            WindowStartupLocation = WindowStartupLocation.CenterScreen;

            DataContext = this;
            bL          = Factory_BL.getBL();
            AreaComboBox.ItemsSource              = Enum.GetValues(typeof(Area));
            AreaComboBox.SelectedIndex            = 0;
            HostingUnitTypeComboBox.ItemsSource   = Enum.GetValues(typeof(Type));
            HostingUnitTypeComboBox.SelectedIndex = 0;
            pool.ItemsSource                  = Enum.GetValues(typeof(Pool));
            pool.SelectedIndex                = 2;
            jacuzzi.ItemsSource               = Enum.GetValues(typeof(Jaccuzzi));
            jacuzzi.SelectedIndex             = 2;
            garden.ItemsSource                = Enum.GetValues(typeof(Garden));
            garden.SelectedIndex              = 2;
            childrensAttraction.ItemsSource   = Enum.GetValues(typeof(ChildrensAttractions));
            childrensAttraction.SelectedIndex = 2;
        }
コード例 #20
0
        public GuestRequestOrderUserControl(HostingUnit hostUnit, GuestRequest guest)
        {
            InitializeComponent();
            this.CurrentHostingUnit  = hostUnit;
            this.CurrentGuestRequest = guest;
            UserDataContext userDataContext = new UserDataContext();

            userDataContext.hostUnit    = hostUnit;
            userDataContext.guest       = guest;
            UserControlGrid.DataContext = userDataContext;
            Grid.SetColumn(vbImage, 1);
            Grid.SetRow(vbImage, 0);
            bl                       = Factory_BL.getBL();
            MyImage                  = CreateViewImage();
            vbImage.Child            = null;
            vbImage.Child            = MyImage;
            numOfGuestsTB.Text       = guest.TotalNumPersons.ToString();
            totalPriceTB.Text        = CalculateTotalPrice(hostUnit, guest);
            entryDateTB.Text         = guest.EntryDate.ToString("dd/MM/yyyy");
            releaseDateTB.Text       = guest.ReleaseDate.ToString("dd/MM/yyyy");
            totalNumberOfDaysTB.Text = bl.Time_Span(guest.EntryDate, guest.ReleaseDate).ToString();
        }
コード例 #21
0
 public MainWindow()
 {
     InitializeComponent();
     bl = Factory_BL.getBL();
 }
コード例 #22
0
 public UpdateHostingUnit()
 {
     InitializeComponent();
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
     bL = Factory_BL.getBL();
 }
コード例 #23
0
 public GetAllHostListWindow()
 {
     InitializeComponent(); bl     = Factory_BL.getBL();
     WindowStartupLocation         = WindowStartupLocation.CenterScreen;
     this.HostListData.ItemsSource = bl.GetHostList();
 }
コード例 #24
0
 public ListViwe()
 {
     InitializeComponent();
     MyBl = Factory_BL.getBL();
 }