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); } }
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++; } } } }
/// <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(); }
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(); }
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)); }
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!"); } } } }
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); } }
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; }
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; }
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(); }
public MainWindow() { InitializeComponent(); bl = Factory_BL.getBL(); }
public ListViwe() { InitializeComponent(); MyBl = Factory_BL.getBL(); }
public GetAllHostListWindow() { InitializeComponent(); bl = Factory_BL.getBL(); WindowStartupLocation = WindowStartupLocation.CenterScreen; this.HostListData.ItemsSource = bl.GetHostList(); }
public UpdateHostingUnit() { InitializeComponent(); WindowStartupLocation = WindowStartupLocation.CenterScreen; bL = Factory_BL.getBL(); }