public NewClientPage() { Bl = FactoryBl.getBl(); Add = new Address(); Location = new Address(); InitializeComponent(); client = new Client(); this.CityComboBox.ItemsSource = Enum.GetValues(typeof(CITY)); this.DeliveryCityComboBox.ItemsSource = Enum.GetValues(typeof(CITY)); this.MainGrid.DataContext = client; this.AddressGrid.DataContext = Add; this.DeliveryAddressGrid.DataContext = Location; this.BirthDatePicker.DisplayDateStart = new DateTime(1900, 1, 1).Date; this.BirthDatePicker.DisplayDateEnd = new DateTime(DateTime.Now.Year - 18, DateTime.Now.Month, DateTime.Now.Day).Date; foreach (var child in MainGrid.Children) { if (child is TextBox) { ((TextBox)child).BorderBrush = Brushes.Black; } if (child is ComboBox) { ((ComboBox)child).BorderBrush = Brushes.Black; } } }
public AddOrderPage() { InitializeComponent(); client = new Client(); bl = FactoryBl.getBl(); this.DataContext = client; }
public GetOrderIDWindow() { bl = FactoryBl.getBl(); InitializeComponent(); order = new Order(); this.DataContext = order; }
private void Button_Click(object sender, RoutedEventArgs e) { if (this.datep.Text == "") { MessageBox.Show("you did not write a date"); } else { // MessageBox.Show("Not vailed date"); List <BE.Coordinate> myList = FactoryBl.GetBL().GetFallingsByDateOrCity(this.datep.Text); var locationList = new List <Location>(); foreach (var v in myList) { locationList.Add(new Location(v.Latitude, v.Longitude)); } var i = 1; foreach (var location in locationList) { var pushpin = new Pushpin(); MapLayer.SetPosition(pushpin, location); MyMap.Children.Add(pushpin); i++; } } }
public MapG(int id) { InitializeComponent(); System.Media.SoundPlayer suodnsPlayer = new System.Media.SoundPlayer("C://Users//Havlin//Desktop//Music//mapg.wav"); suodnsPlayer.Play(); List <BE.Coordinate> myList = FactoryBl.GetBL().KMeansG(id).ToList(); var locationList = new List <Location>(); foreach (var v in myList) { locationList.Add(new Location(v.Latitude, v.Longitude)); } var i = 1; foreach (var location in locationList) { var pushpin = new Pushpin(); MapLayer.SetPosition(pushpin, location); MyMap.Children.Add(pushpin); i++; } }
public InfoPage() { InitializeComponent(); bl = FactoryBl.getBl(); this.BranchesListBox.ItemsSource = bl.getBranchesList(); this.ClientsListBox.ItemsSource = bl.getClientsList(); this.OrdersListBox.ItemsSource = bl.getOrdersList(); }
public MainPage() { bl = FactoryBl.getBl(); InitializeComponent(); ManagementUserControl p = new ManagementUserControl(); order = new Order(); }
public DishListPage(DISH_TYPE DishT) { InitializeComponent(); bl = FactoryBl.getBl(); dt = new DishType(); dt.DT = DishT; this.DataContext = dt; this.DishListBox.ItemsSource = bl.dishesForDishType(dt.DT); }
public UpdateDeletePage() { InitializeComponent(); bl = FactoryBl.getBl(); this.BranchesDataGrid.ItemsSource = bl.getBranchesList(); this.ClientsDataGrid.ItemsSource = bl.getClientsList(); this.OrdersDataGrid.ItemsSource = bl.getOrdersList(); this.DishesDataGrid.ItemsSource = bl.getDishesList(); }
public UpdateDishPage(Dish d) { InitializeComponent(); bl = FactoryBl.getBl(); dish = d; DishTypeComboBox.ItemsSource = Enum.GetValues(typeof(DISH_TYPE)); SizeComboBox.ItemsSource = Enum.GetValues(typeof(SIZE)); KashrutComboBox.ItemsSource = Enum.GetValues(typeof(KOSHER)); MainGrid.DataContext = dish; }
public UnitsByAreaWindow() { InitializeComponent(); double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth; double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; double windowWidth = this.Width; double windowHeight = this.Height; this.Left = (screenWidth / 2) - (windowWidth / 2); this.Top = (screenHeight / 2) - (windowHeight / 2); bl = FactoryBl.getBl(); IEnumerable <IGrouping <string, HostingUnit> > unitsList = bl.UnitsByArea(); jerusalem = new List <HostingUnit>(); north = new List <HostingUnit>(); south = new List <HostingUnit>(); center = new List <HostingUnit>(); foreach (IGrouping <string, HostingUnit> g in unitsList) { switch (g.Key) { case "ירושלים": foreach (var item in g) { jerusalem.Add(item); } break; case "מרכז": foreach (var item in g) { center.Add(item); } break; case "צפון": foreach (var item in g) { north.Add(item); } break; case "דרום": foreach (var item in g) { south.Add(item); } break; } } this.areaComboBox.ItemsSource = Enum.GetValues(typeof(Enums.Area)); }
public UpdateOrderPage(Order o) { InitializeComponent(); order = o; bl = FactoryBl.getBl(); this.MainGrid.DataContext = order; this.BranchComboBox.ItemsSource = bl.getBranchesList(); this.PaymentComboBox.ItemsSource = Enum.GetValues(typeof(PAYMENT)); this.KashrutComboBox.ItemsSource = Enum.GetValues(typeof(KOSHER)); this.creditCardUserControl.DataContext = order.CreditCard; }
public AddBranchPage() { InitializeComponent(); bl = FactoryBl.getBl(); branch = new Branch(); this.MainGrid.DataContext = branch; this.AddressGrid.DataContext = branch.Add; this.KashrutComboBox.ItemsSource = Enum.GetValues(typeof(KOSHER)); this.CityComboBox.ItemsSource = Enum.GetValues(typeof(CITY)); }
public MainWindow() { bl = FactoryBl.getBl(); InitializeComponent(); bl.loadBranchesFromXML("BranchesXmlBySerilalizer.xml"); bl.loadDishesFromXML("DishesXmlBySerilalizer.xml"); bl.loadClientsFromXML("ClientsXmlBySerilalizer.xml"); bl.loadOrdersFromXML("OrdersXmlBySerilalizer.xml"); //bl.loadODFromXML("ODXmlBySerilalizer.xml"); MainFrame.Navigate(new MainPage()); }
public UpdateBranchPage(Branch b) { InitializeComponent(); bl = FactoryBl.getBl(); branch = new Branch(b.Name, b.Add.Street, b.Add.HouseNO, b.Add.City, b.Add.ZipCode, b.ManagerName, b.PhoneNumber, b.Kosher); branch.BranchID = b.BranchID; this.MainGrid.DataContext = branch; this.AddressGrid.DataContext = branch.Add; this.KashrutComboBox.ItemsSource = Enum.GetValues(typeof(KOSHER)); this.CityComboBox.ItemsSource = Enum.GetValues(typeof(CITY)); }
public PasswordWindow() { InitializeComponent(); double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth; double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; double windowWidth = this.Width; double windowHeight = this.Height; this.Left = (screenWidth / 2) - (windowWidth / 2); this.Top = (screenHeight / 2) - (windowHeight / 2); bl = FactoryBl.getBl(); }
public UpdateUnitWindow1() { InitializeComponent(); double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth; double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; double windowWidth = this.Width; double windowHeight = this.Height; this.Left = (screenWidth / 2) - (windowWidth / 2); this.Top = (screenHeight / 2) - (windowHeight / 2); unit = new HostingUnit(); bl = FactoryBl.getBl(); }
public QueriesPage() { bl = FactoryBl.getBl(); qa = new QueryAns(); InitializeComponent(); qa.AverageOrder = bl.averageOrder(); qa.MostValueOrder = bl.mostValueOrder(); this.QueryGrid.DataContext = qa; this.CityComboBox.ItemsSource = Enum.GetValues(typeof(CITY)); this.DishTypeComboBox.ItemsSource = Enum.GetValues(typeof(DISH_TYPE)); this.DishComboBox.ItemsSource = bl.getDishesList(); int MEO = bl.mostValueOrder(); this.MostExpensiveOrderLabel.Content = "Order ID: " + MEO + " Total Price: " + bl.calcTotalPrice(MEO) + "₪"; this.AverageOrderLabel.Content = bl.averageOrder() + "₪"; }
public UnitsByDayWindow() { InitializeComponent(); double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth; double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; double windowWidth = this.Width; double windowHeight = this.Height; this.Left = (screenWidth / 2) - (windowWidth / 2); this.Top = (screenHeight / 2) - (windowHeight / 2); bl = FactoryBl.getBl(); MyCalendar = CreateCalendar(); chooseViewBox.Child = null; chooseViewBox.Child = MyCalendar; }
public UpdateClientPage(Client c) { bl = FactoryBl.getBl(); InitializeComponent(); client = c; Add = c.Add; Location = c.Location; this.CityComboBox.ItemsSource = Enum.GetValues(typeof(CITY)); this.DeliveryCityComboBox.ItemsSource = Enum.GetValues(typeof(CITY)); this.MainGrid.DataContext = client; this.AddressGrid.DataContext = Add; this.DeliveryAddressGrid.DataContext = Location; this.BirthDatePicker.DisplayDateStart = new DateTime(1990, 1, 1).Date; this.BirthDatePicker.DisplayDateEnd = new DateTime(DateTime.Now.Year - 18, DateTime.Now.Month, DateTime.Now.Day).Date; }
public void LoadStudents() { ObservableCollection <ReportModel> reportL = new ObservableCollection <ReportModel>(); foreach (var v in FactoryBl.GetBL().GetAllReport()) { if (v.DateRep.Day == DateTime.Now.Day && v.DateRep.Year == DateTime.Now.Year && v.DateRep.Month == DateTime.Now.Month) { reportL.Add(new ReportModel { Address = v.Address, City = v.City, BoomsN = v.BoomsN, Intensity = v.Intensity }); } } reportCollection = reportL; }
private void btnLoad_Click(object sender, RoutedEventArgs e) { OpenFileDialog op = new OpenFileDialog(); op.Title = "Select a picture"; op.Filter = "All supported graphics|*.jpg;*.jpeg;*.png|" + "JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|" + "Portable Network Graphic (*.png)|*.png"; if (op.ShowDialog() == true) { imgPhoto.Source = new BitmapImage(new Uri(op.FileName)); } var c = FactoryBl.GetBL().PhotoToC(imgPhoto.Source.ToString()); MessageBox.Show("The hit added thanks for your help"); }
public UpdateUnitWindow2(HostingUnit unit) { InitializeComponent(); double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth; double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; double windowWidth = this.Width; double windowHeight = this.Height; this.Left = (screenWidth / 2) - (windowWidth / 2); this.Top = (screenHeight / 2) - (windowHeight / 2); unitToUpdate = unit; this.DataContext = unit; bl = FactoryBl.getBl(); this.areaComboBox.ItemsSource = Enum.GetValues(typeof(Enums.Area)); if (unitToUpdate.Area == "צפון") { this.areaComboBox.SelectedIndex = 0; } if (unitToUpdate.Area == "דרום") { this.areaComboBox.SelectedIndex = 1; } if (unitToUpdate.Area == "מרכז") { this.areaComboBox.SelectedIndex = 2; } if (unitToUpdate.Area == "ירושלים") { this.areaComboBox.SelectedIndex = 3; } this.typeComboBox.ItemsSource = Enum.GetValues(typeof(Enums.HostingUnitType)); if (unitToUpdate.Type == "צימר") { this.typeComboBox.SelectedIndex = 0; } if (unitToUpdate.Type == "מלון") { this.typeComboBox.SelectedIndex = 1; } if (unitToUpdate.Type == "קמפינג") { this.typeComboBox.SelectedIndex = 2; } }
public InformationWindow() { InitializeComponent(); this.Number.Text = "100"; DayC.Text = String.Format("{0:0.00}", FactoryBl.GetBL().todayC(int.Parse(Number.Text)) * 100) + "%"; Month.Text = DateTime.Now.Month.ToString(); List <double> m = new List <double>(); m.Add(3); m.Add(5); m.Add(7); CartesianChart ch = new CartesianChart(); CartesianChart ch2 = new CartesianChart(); var v = (FactoryBl.GetBL().YearByMonthC(int.Parse(Number.Text)).ToArray()); ch.Series = new SeriesCollection { new LineSeries { Title = "Series 1", // Values=new ChartValues<double>(m.ToArray()) Values = new ChartValues <double>(FactoryBl.GetBL().MonthBydayC(int.Parse(Number.Text), int.Parse(Month.Text)).ToArray()) } }; GridTest.Children.Add(ch); ch2.Series = new SeriesCollection { new LineSeries { Title = "Series 2", Values = new ChartValues <double>(v) } }; GridTest2.Children.Add(ch2); System.Media.SoundPlayer suodnsPlayer = new System.Media.SoundPlayer("C://Users//Havlin//Desktop//Music//information.wav"); suodnsPlayer.Play(); }
public MapWindow(String date) { InitializeComponent(); DT.DisplayDateEnd = DateTime.Now; var dt = FactoryBl.GetBL().ChangeDateToNumber(date); List <BE.Coordinate> myList1 = FactoryBl.GetBL().KMeansGByDate(dt).ToList(); List <BE.Coordinate> myList2 = FactoryBl.GetBL().FallingByDate(dt).ToList(); var locationList = new List <Location>(); foreach (var v in myList1) { locationList.Add(new Location(v.Latitude, v.Longitude)); } var locationList2 = new List <Location>(); foreach (var v in myList2) { locationList2.Add(new Location(v.Latitude, v.Longitude)); } var i = 1; foreach (var location in locationList) { var pushpin = new Pushpin(); pushpin.Background = new SolidColorBrush(Color.FromArgb(20, 20, 20, 20)); MapLayer.SetPosition(pushpin, location); MyMap.Children.Add(pushpin); i++; } foreach (var location in locationList2) { var pushpin = new Pushpin(); MapLayer.SetPosition(pushpin, location); MyMap.Children.Add(pushpin); i++; } }
public UpdateOrderWindow2(BE.Order order) { InitializeComponent(); double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth; double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; double windowWidth = this.Width; double windowHeight = this.Height; this.Left = (screenWidth / 2) - (windowWidth / 2); this.Top = (screenHeight / 2) - (windowHeight / 2); ord = order; this.DataContext = ord; bl = FactoryBl.getBl(); this.StatusComboBox.ItemsSource = Enum.GetValues(typeof(Enums.OrderStatus)); worker = new BackgroundWorker(); worker.DoWork += Worker_DoWork; worker.RunWorkerCompleted += Worker_RunWorkerCompleted; }
public AddUnitWindow() { InitializeComponent(); double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth; double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; double windowWidth = this.Width; double windowHeight = this.Height; this.Left = (screenWidth / 2) - (windowWidth / 2); this.Top = (screenHeight / 2) - (windowHeight / 2); unit = new BE.HostingUnit(); unit.Owner = new Host(); unit.Owner.BankBranchDetails = new BankBranch(); this.DataContext = unit; bl = FactoryBl.getBl(); this.areaComboBox.ItemsSource = Enum.GetValues(typeof(Enums.Area)); this.typeComboBox.ItemsSource = Enum.GetValues(typeof(Enums.HostingUnitType)); }
public AddDishesToOrderPage() { try { InitializeComponent(); bl = FactoryBl.getBl(); this.DishTypeComboBox.ItemsSource = Enum.GetValues(typeof(DISH_TYPE)); this.MainGrid.DataContext = od; this.DishDataGrid.ItemsSource = bl.getDishesList(); this.OrderedDishDataGrid.ItemsSource = bl.getOrderedDishes(od.OrderID); } catch (Exception ex) { MessageBox.Show(ex.Message, "ERROR!", MessageBoxButton.OK, MessageBoxImage.Error); } finally { InitializeComponent(); } }
private void Button_Click(object sender, RoutedEventArgs e) { if (CityTextBox.Text == "") { MessageBox.Show("Worng city"); } else if (AddressTextBox.Text == "") { MessageBox.Show("Worng street"); } else if (TimeTextBox.Text == "") { MessageBox.Show("Worng time"); } else if (DateRepTextBox.Text == "") { MessageBox.Show("Worng date"); } else { var d = FactoryBl.GetBL().ChangeDateToNumber(DateRepTextBox.Text); var h = int.Parse(TimeTextBox.Text[0].ToString()) * 10 + int.Parse(TimeTextBox.Text[1].ToString()); var m = int.Parse(TimeTextBox.Text[3].ToString()) * 10 + int.Parse(TimeTextBox.Text[4].ToString()); if (new DateTime(d.Year, d.Month, d.Day, h, m, 0) > DateTime.Now) { MessageBox.Show("Date not vailed"); } else { FactoryBl.GetBL().AddFalling(new BE.Falling(this.CityTextBox.Text, this.AddressTextBox.Text, new DateTime(d.Year, d.Month, d.Day, h, m, 0), new BE.Coordinate())); } } }
public InformationWindow(int num, int x) { InitializeComponent(); this.Number.Text = num + ""; DayC.Text = String.Format("{0:0.00}", FactoryBl.GetBL().todayC(int.Parse(Number.Text)) * 100) + "%"; Month.Text = x + ""; CartesianChart ch = new CartesianChart(); CartesianChart ch2 = new CartesianChart(); ch.Series = new SeriesCollection { new LineSeries { Title = "Series 1", // Values=new ChartValues<double>(m.ToArray()) Values = new ChartValues <double>(FactoryBl.GetBL().MonthBydayC(int.Parse(Number.Text), int.Parse(Month.Text)).ToArray()) } }; GridTest.Children.Add(ch); ch2.Series = new SeriesCollection { new LineSeries { Title = "Series 2", Values = new ChartValues <double> (FactoryBl.GetBL().YearByMonthC(int.Parse(Number.Text)).ToArray()) } }; GridTest2.Children.Add(ch2); }