private void setBlackOutDates(BO.HostingUnit HostingUnit) { DateTime Start = new DateTime(); DateTime End = new DateTime(); bool XOR = false; DateTime temp = DateTime.Today; DateTime check = DateTime.Today; check = check.AddMonths(11); while (temp < check) { if (HostingUnit.GetDate(temp) ^ XOR) { if (!XOR) { Start = temp; XOR = XOR ^ (!XOR); } else { End = temp; XOR = XOR ^ XOR; DatesCalendar.BlackoutDates.Add(new CalendarDateRange(Start, End)); } } temp = temp.AddDays(1); } }
public ViewHostingUnitWindow(BO.HostingUnit hostingUnit, BlApi.IBl bl) { InitializeComponent(); HostingUnit = hostingUnit; try { Image1.Source = new BitmapImage(new Uri(HostingUnit.ImageLink1)); Image2.Source = new BitmapImage(new Uri(HostingUnit.ImageLink2)); Image3.Source = new BitmapImage(new Uri(HostingUnit.ImageLink3)); } catch (ArgumentNullException) { } catch (UriFormatException) { } ViewGrid.DataContext = HostingUnit; var areacollection = MyDictionary.Locations.Select(x => MyDictionary.TranslateEnumToString(x)).ToList(); areacollection.Remove("הכל"); areaComboBox.ItemsSource = areacollection; List <int> hip = new List <int>(); HostingUnit = hostingUnit; this.bl = bl; //setBlackOutDates(hostingUnit); }
public HostingUnitDetails(BO.HostingUnit hostingUnit, BlApi.IBl bl) { InitializeComponent(); this.bl = bl; HostingUnit = hostingUnit; calendarDates = new List <CalendarDateRange>(); setBlackOutDates(HostingUnit); MainGrid.DataContext = HostingUnit; OrdersDataGrid.ItemsSource = bl.GetOrdersOfHost(hostingUnit.Owner).Where(x => x.HostingUnit.Key == hostingUnit.Key && x.Status == BO.Order_Status.APPROVED); MonthlyProgressBar.Value = Math.Round(CalculateMonthlyPercentage(), 2); TotalProgressBar.Value = Math.Round(CalculateTotalPercentage(), 2); }
public AddHostingUnitPage(BlApi.IBl bl, BO.Host host, ListBox listBox) { InitializeComponent(); Host = host; HostingUnit = new BO.HostingUnit(); HostingUnit.Diary = new bool[12, 31]; AddHUGrid.DataContext = HostingUnit; LB = listBox; this.bl = bl; // areaComboBox.ItemsSource = BO.MyDictionary.Locations.Select(x=>BO.MyDictionary.TranslateE(x)); areaComboBox.ItemsSource = MyDictionary.Locations.Select(x => MyDictionary.TranslateEnumToString(x)); }
private void DeleteHU_Click(object sender, RoutedEventArgs e) { MessageBoxResult mbr = MessageBox.Show("אתה בטוח שברצונך למחוק?", "הודעה", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No, MessageBoxOptions.RtlReading); if (mbr == MessageBoxResult.No) { return; } Button button = sender as Button; BO.HostingUnit HU = (BO.HostingUnit)(button.DataContext); HU.Status = BO.Status.INACTIVE; try { bl.UpdateHostingUnit(HU); this.Host = bl.GetHost(HostId); MainListBox.ItemsSource = Host.HostingUnits; MainListBox.Items.Refresh(); } catch (MissingMemberException ex) { MessageBox.Show(ex.Message); } }