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"; }
public UpdateOrder(BE.Order or) { InitializeComponent(); WindowStartupLocation = WindowStartupLocation.CenterScreen; bl = FactoryBL.GetBl(); order = or; //this.OrderKey.ItemsSource = bl.GetOrderList(); //this.OrderKey.DisplayMemberPath = "OrderKey"; //this.OrderKey.SelectedValuePath = "OrderKey"; this.OrderKey.Text = order.OrderKey.ToString(); setOrderFields(); //this.Area.Text = order.ToString(); //this.Type.ItemsSource = Enum.GetValues(typeof(Enums.HostingUnitType)); //this.Pool.ItemsSource = Enum.GetValues(typeof(Enums.Options)); //this.Jaccuzzi.ItemsSource = Enum.GetValues(typeof(Enums.Options)); //this.Porch.ItemsSource = Enum.GetValues(typeof(Enums.Options)); //this.Food.ItemsSource = Enum.GetValues(typeof(Enums.Food)); //this.ChildrenAttractions.ItemsSource = Enum.GetValues(typeof(Enums.Options)); //this.EntryDate.DisplayDate = DateTime.Now; //this.ReleaseDate.DisplayDateEnd = DateTime.Now; this.Status.ItemsSource = Enum.GetValues(typeof(Enums.OrderStatus)); errorMessages = new List <string>(); }
public AddMotherWindow() { InitializeComponent(); bl = FactoryBL.GetBL(); mother = new Mother(); this.MotherDetails.DataContext = mother; }
public ContractCard(Contract contractToShow, DataGrid dataGridInput) { InitializeComponent(); dataGridToRefresh = dataGridInput; bl = FactoryBL.GetBL(); contractOfCard = contractToShow.GetCopy(); ID_TextBlock.Text = contractToShow.ContID.ToString(); Child_ID_TextBlock.Text = contractToShow.ChildID.ToString(); Nanny_ID_TextBlock.Text = contractToShow.NannyID.ToString(); Introductory_Meeting_CheckBox.IsChecked = contractToShow.IsIntroductoryMeeting; SpeicalDetailsOfMeeting.Text = contractToShow.SpeicalDetailsOfMeeting; signed_CheckBox.IsChecked = contractToShow.IsContractSigned; PaymentMethod_TextBlock.Text = contractToShow.PaymentMethod.ToString(); if (PaymentMethod_TextBlock.Text == "Hourly") { Calculated_wage_TextBlock.Text = contractToShow.HourlySalary.ToString(); } else { Calculated_wage_TextBlock.Text = contractToShow.MonthlySalary.ToString(); } Start_Date_TextBlock.Text = $"{contractToShow.StartDate.Day}/{contractToShow.StartDate.Month}/{contractToShow.StartDate.Year}"; End_Date_TextBlock.Text = $"{contractToShow.EndDate.Day}/{contractToShow.EndDate.Month}/{contractToShow.EndDate.Year}"; }
public Tester_UserControl() { InitializeComponent(); bl = FactoryBL.GetBL(Configuration.BLType); bl.TesterEvent += TesterEvent; string[] SortByValues = { "firstName", "lastName", "id", "max test in week", "gender", "age", "exp years", "car type", "max distance" }; listAllTester = bl.getAllTester(); //To prevent from get the all list every simple action, save the whole list until the original list change (in the event this variable will get the new list) currentUseList = listAllTester; //on this variable all the changes will be done ComboBoxSortBy.ItemsSource = SortByValues; CreateDemoEntites(); filtersControl.radioButtonAscending.Checked += RadioButtonAscending_Checked; filtersControl.radioButtonDescending.Checked += RadioButtonDescending_Checked; testerDataGrid.DataContext = currentUseList; filtersControl.radioButtonAscending.Checked += RadioButtonAscending_Checked; filtersControl.radioButtonDescending.Checked += RadioButtonDescending_Checked; filtersControl.checkBoxFilterMotorcycle.Checked += CheckBoxFilterMotorcycle_Checked; filtersControl.checkBoxFilterMotorcycle.Unchecked += CheckBoxFilterMotorcycle_Unchecked; filtersControl.checkBoxFilterprivetCar.Checked += CheckBoxFilterprivetCar_Checked; filtersControl.checkBoxFilterprivetCar.Unchecked += CheckBoxFilterprivetCar_Unchecked; filtersControl.checkBoxFilterSmallTruck.Checked += CheckBoxFilterSmallTruck_Checked; filtersControl.checkBoxFilterSmallTruck.Unchecked += CheckBoxFilterSmallTruck_Unchecked; filtersControl.checkBoxFilterTruck.Checked += CheckBoxFilterTruck_Checked; filtersControl.checkBoxFilterTruck.Unchecked += CheckBoxFilterTruck_Unchecked; findAndSort(); }
public GuestRequestsByArea() { InitializeComponent(); WindowStartupLocation = WindowStartupLocation.CenterScreen; bl = FactoryBL.GetBl(); //guestRequest = new GuestRequest(); //this.DataContext = guestRequest; IEnumerable <IGrouping <Enums.Area, GuestRequest> > guestRequests; List <GuestRequest> guestRequestsList = new List <GuestRequest>(); guestRequests = bl.GetGuestRequestsByArea(); foreach (var item in guestRequests) { foreach (var v in item) { guestRequestsList.Add(v); } } GuestRequestsByArea_Grouping.ItemsSource = guestRequestsList; CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(GuestRequestsByArea_Grouping.ItemsSource); PropertyGroupDescription groupDescription = new PropertyGroupDescription("Area"); view.GroupDescriptions.Add(groupDescription); }
private void Search_Click(object sender, RoutedEventArgs e) { address.City = CityInput.Text; address.Street = StreetInput.Text; try { address.Building_number = int.Parse(HouseNumberInput.Text); } catch (Exception) { MessageBox.Show("the house number must contain only digits", "house number error", MessageBoxButton.OK, MessageBoxImage.Error); HouseNumberInput.Text = "number"; return; } try { TestersNumber.Text = ""; int help = (int)distance.Value; TestersNumber.Text = FactoryBL.GetInstance().InRadius(address, help).Count.ToString(); } catch (Exception) { TestersNumber.Text = 0.ToString(); } }
public HostingUnitByArea() { InitializeComponent(); WindowStartupLocation = WindowStartupLocation.CenterScreen; bl = FactoryBL.GetBl(); IEnumerable <IGrouping <Enums.Area, BE.HostingUnit> > hostingUnits; List <BE.HostingUnit> hostingUnitsList = new List <BE.HostingUnit>(); hostingUnits = bl.GetHostingUnitsByArea(); foreach (var item in hostingUnits) { foreach (var v in item) { hostingUnitsList.Add(v); } } HostingUnitByArea_Grouping.ItemsSource = hostingUnitsList; CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(HostingUnitByArea_Grouping.ItemsSource); PropertyGroupDescription groupDescription = new PropertyGroupDescription("Area"); view.GroupDescriptions.Add(groupDescription); }
public Add_Child() { InitializeComponent(); bl = FactoryBL.GetBL(); Grid.DataContext = child; }
public Add_Mother() { InitializeComponent(); bl = FactoryBL.GetBL(); Grid.DataContext = mother; }
public TestersListPage() { InitializeComponent(); BL = FactoryBL.getInstance(); testers = BL.getAllTesters(); Testers.ItemsSource = testers; }
public log_in_tester(Tester tester) { InitializeComponent(); tester1 = tester; DataContext = tester; bl = FactoryBL.GetBL(); string DirPath = Directory.GetParent(Environment.CurrentDirectory).Parent.FullName; imageNotWorking.Source = new BitmapImage(new Uri(DirPath + "/images/עובד לא.jpg")); notWorking.ImageSource = imageNotWorking.Source; imageWorking.Source = new BitmapImage(new Uri(DirPath + "/images/עובד.jpg")); working.ImageSource = imageWorking.Source; foreach (Button item in buttons.Children) { int x = int.Parse(item.Name[1].ToString()); int y = int.Parse(item.Name[3].ToString()); if (tester.mat[x, y] == true) { item.Background = working; } if (tester.mat[x, y] == false) { item.Background = notWorking; } } }
public UpdateChild(Child ch) { InitializeComponent(); child = ch; this.DataContext = child; bl = FactoryBL.GetBL(); }
private async void setCoins() { List <CurrentCoinValue> BeCoins = FactoryBL.get().getCoinsValue(); Coins = (from c in BeCoins select new CoinModel(c.CurrentCoinValueId, c.date, c.value, FactoryBL.get().GetSlope(c.CurrentCoinValueId))).ToList(); }
public AddOrder() { InitializeComponent(); WindowStartupLocation = WindowStartupLocation.CenterScreen; bl = FactoryBL.GetBl(); order = new BE.Order(); this.DataContext = order; this.GuestRequestKey.ItemsSource = bl.GetGuestRequestList(); this.GuestRequestKey.DisplayMemberPath = "GuestRequestKey"; this.GuestRequestKey.SelectedValuePath = "GuestRequestKey"; this.HostingUnitKey.ItemsSource = bl.GetHostingUnitList(); this.HostingUnitKey.DisplayMemberPath = "HostingUnitKey"; this.HostingUnitKey.SelectedValuePath = "HostingUnitKey"; this.Area.ItemsSource = Enum.GetValues(typeof(Enums.Area)); this.Type.ItemsSource = Enum.GetValues(typeof(Enums.HostingUnitType)); this.Pool.ItemsSource = Enum.GetValues(typeof(Enums.Options)); this.Jaccuzzi.ItemsSource = Enum.GetValues(typeof(Enums.Options)); this.Porch.ItemsSource = Enum.GetValues(typeof(Enums.Options)); this.Food.ItemsSource = Enum.GetValues(typeof(Enums.Food)); this.ChildrenAttractions.ItemsSource = Enum.GetValues(typeof(Enums.Options)); this.EntryDate.DisplayDate = DateTime.Now; this.ReleaseDate.DisplayDateEnd = DateTime.Now; errorMessages = new List <string>(); }
public GuestWindow() { this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight; WindowStartupLocation = WindowStartupLocation.CenterScreen; InitializeComponent(); SystemCommands.MaximizeWindow(this); guestRequest = new BE.GuestRequest(); WindowStartupLocation = WindowStartupLocation.CenterScreen; this.addGuestRequest.DataContext = guestRequest; myBL = FactoryBL.getBL(); this.entryDateDatePicker.DisplayDateStart = DateTime.Now; this.entryDateDatePicker.DisplayDateEnd = DateTime.Now.AddMonths(11); this.releaseDateDatePicker.DisplayDateStart = DateTime.Now; this.releaseDateDatePicker.DisplayDateEnd = DateTime.Now.AddMonths(11); 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)); _myData = new Message() { message = "" }; TextBlockReview.DataContext = _myData; errorMessages = new List <string>(); }
public Remove_Contract() { InitializeComponent(); bl = FactoryBL.GetBL(); Grid.DataContext = contract; Contract.Counter--; }
public AdminWindow() { InitializeComponent(); bl = FactoryBL.GetBL(); list = bl.GetAdmins().ToList(); DataContext = list; }
public AllTesters() { InitializeComponent(); Ibl help = FactoryBL.GetInstance(); data.DataContext = new ObservableCollection <Tester>(help.GetTesters()); }
public Update_Contract() { InitializeComponent(); bl = FactoryBL.GetBL(); Grid.DataContext = contract; }
public CoinHistoryViewModel(string coin, string format) { try { List <CoinValue> BeCoins = FactoryBL.get().getCoinHistory(coin, format); history = (from c in BeCoins select new CoinModel(coin, c.date, c.CoinValueId, 0)).ToList(); if (history.Count == 1) //precaution for break mode ,if the graph has only single value (y = 4 for example) the code will enter break mode { CoinModel tempC = history.First(); history.Add(new CoinModel(tempC.coin, tempC.lastUpdate - TimeSpan.FromDays(1), tempC.value + 0.0000001)); history.Add(new CoinModel(tempC.coin, tempC.lastUpdate - TimeSpan.FromDays(2), tempC.value)); } if (FactoryBL.get().GetSlope(coin) == 0) //another reprecaution for break mode ,so the graph won't have only 1 value and enter a break mode { CoinModel tempC = history.First(); history.Remove(tempC); history.Add(new CoinModel(tempC.coin, tempC.lastUpdate - TimeSpan.FromDays(1), tempC.value + 0.0000001)); } } catch (Exception ex) { history = new List <CoinModel>(); history.Add(new CoinModel("NOT FOUND", DateTime.Now, 1)); } YFormatter = valueTostring; }
public HostsByNumOfHostingUnits() { InitializeComponent(); WindowStartupLocation = WindowStartupLocation.CenterScreen; bl = FactoryBL.GetBl(); //IEnumerable<IGrouping<int, BE.Host>> hosts; //List<BE.Host> hostList = new List<BE.Host>(); //hosts = bl.GetHostsByNumOfHostingUnits(); //foreach (var item in hosts) //{ // foreach (var v in item) // { // hostList.Add(v); // } //} List <BE.Host> hostList = bl.GetHostList(); HostsByNumOfHostingUnits_Grouping.ItemsSource = hostList; CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(HostsByNumOfHostingUnits_Grouping.ItemsSource); PropertyGroupDescription groupDescription = new PropertyGroupDescription("NumOfHostingUnits"); view.GroupDescriptions.Add(groupDescription); }
public AllTraineeTests(Trainee source) { InitializeComponent(); trainee = new Trainee(source); obs = new ObservableCollection <Test>(FactoryBL.GetInstance().GetTests(t => t.Trainee_id == trainee.Id)); AllTraineeTest.DataContext = obs; }
public AddOrderWindow(Host hostIN) { InitializeComponent(); myIBL = FactoryBL.GetBL(); host = hostIN; HostingUnits.ItemsSource = myIBL.GetHostingUnitsOfHost(host); }
public update_tester(Tester oldTester, log_in_tester log_In) { InitializeComponent(); log = log_In; tester = oldTester; bl = FactoryBL.GetBL(); DataContext = tester; mat1 = tester.mat; string DirPath = Directory.GetParent(Environment.CurrentDirectory).Parent.FullName; imageNotWorking.Source = new BitmapImage(new Uri(DirPath + "/images/עובד לא.jpg")); notWorking.ImageSource = imageNotWorking.Source; imageWorking.Source = new BitmapImage(new Uri(DirPath + "/images/עובד.jpg")); working.ImageSource = imageWorking.Source; foreach (Button item in buttons.Children) { int x = int.Parse(item.Name[1].ToString()); int y = int.Parse(item.Name[3].ToString()); if (mat1[x, y] == true) { item.Background = working; } if (mat1[x, y] == false) { item.Background = notWorking; } } carTypeTesterComboBox.ItemsSource = Enum.GetValues(typeof(CarType)); genderTesterComboBox.ItemsSource = Enum.GetValues(typeof(Gender)); }
public Add_Contract() { InitializeComponent(); bl = FactoryBL.GetBL(); grid.DataContext = contract; }
private void Add_Click(object sender, RoutedEventArgs e) { int house_number; try { house_number = int.Parse(HouseNumberInput.Text); } catch (Exception) { MessageBox.Show("the house number must contain only digits", "house number error", MessageBoxButton.OK, MessageBoxImage.Error); HouseNumberInput.Text = "number"; return; } Address addrees = new Address(StreetInput.Text, house_number, CityInput.Text); DateTime time = DayInput.SelectedDate.Value; int hour = int.Parse(HourInput.Text.Split(':')[0]); time = new DateTime(time.Year, time.Month, time.Day, hour, 0, 0); try { Test test = new Test(trainee.Id, addrees, time); FactoryBL.GetInstance().AddTest(test); } catch (Exception exc) { MessageBox.Show(exc.Message, "logic error", MessageBoxButton.OK, MessageBoxImage.Error); return; } Visibility = Visibility.Collapsed; }
public NannyWindow() { InitializeComponent(); bl = FactoryBL.GetBL(); Nannys_DataGrid.ItemsSource = bl.GetAllNannies(); MaxNumberOfChildren_ComboBox.SelectedIndex = 7; }
public SugestDate(Test test) { BL = FactoryBL.getInstance(); InitializeComponent(); DepositTextBox.Visibility = Visibility.Hidden; GetDate(test); }
public AddChildWindow() { InitializeComponent(); DataContext = child; bl = FactoryBL.getBL(); this.motherIDComboBox.ItemsSource = from z in bl.GetMothers() select z.ID; }