示例#1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter != null)
            {
                Advice advice = e.Parameter as Advice;
                this.titlePathBox.TitlePath = advice?.Caption;
                if (advice != null)
                {
                    this._advice   = advice;
                    this.PageTitle = advice.Caption;
                    Office o = advice.Office;
                    if (o != null)
                    {
                        this._office = o;

                        TimeSpan ts = o.GetMaxOpeningToday() - DateTime.Now;
                        if (ts.TotalMinutes > 0)
                        {
                            this._progress.Maximum = ts.TotalMinutes;
                            this._progress.Value   = 10 + o.GetEstimatedWaitTimeInMinutes();
                            this.ExpectedNumber    = (o.GetCurrentWaiting()).ToString();
                            this.ExpectedTime      = DateTime.Now.AddMinutes(10 + o.GetEstimatedWaitTimeInMinutes()).ToString("h:mm tt");
                        }
                        else
                        {
                            this._progress.Maximum    = 100;
                            this._progress.Value      = 100;
                            this._progress.Foreground = new SolidColorBrush(Colors.DarkRed);
                            this.ExpectedNumber       = "Closed";
                        }
                    }
                    foreach (CheckListItem item in advice.CheckListItems)
                    {
                        this.CheckListItems.Add(item);
                    }

                    bool allChecked = CheckListItems.All(checkListItem => checkListItem.IsChecked);

                    if (!allChecked)
                    {
                        this._officeGrid.Visibility = Visibility.Visible;
                        this._itemGrid.Visibility   = Visibility.Collapsed;
                        this._lineGrid.Visibility   = Visibility.Collapsed;
                    }
                    else
                    {
                        this._officeGrid.Visibility   = Visibility.Collapsed;
                        this._itemGrid.Visibility     = Visibility.Visible;
                        this._lineGrid.Visibility     = Visibility.Collapsed;
                        this.EnableQueueNumberService = true;
                        if (o != null)
                        {
                            this._ticket = o.GetTicketForAdviceIfExists(DataService.Instance.CurrentAccount);
                            LoadTicket();
                        }
                    }
                }
            }
        }
示例#2
0
        private void OnCheckListTapped(object sender, TappedRoutedEventArgs e)
        {
            bool allChecked = CheckListItems.All(checkListItem => checkListItem.IsChecked);

            this.EnableQueueNumberService = allChecked;
        }