private void LoadFirstPlaybill()
        {
            var bill = this.LoadPlaybills().FirstOrDefault();

            if (bill != null)
            {
                List <IPlayItem> playItems = new List <IPlayItem>();
                var playbill = Playbill.Load(bill.Id, playItems);

                if (playItems.Count > 0)
                {
                    //this.Clear();

                    _playbill = playbill;

                    _bindablePlaybill = bill;

                    foreach (var item in playItems)
                    {
                        _playItemCollection.Add(_playItemCollection.CreateBindablePlayItem(item));
                    }
                }
            }
        }
        private void LoadPlaybill()
        {
            if (CanLoadPlaybill())
            {
                // TODO: 提示保存

                this.LoadPlaybillInteractionRequest.Raise(new LoadPlaybillConfirmation {
                    Title = "选择节目单", Playbills = LoadPlaybills()
                },
                                                          c =>
                {
                    if (c.Confirmed)
                    {
                        BindablePlaybill bill = c.SelectedPlaybill;

                        if (bill != null)
                        {
                            List <IPlayItem> playItems = new List <IPlayItem>();
                            var playbill = Playbill.Load(bill.Id, playItems);

                            if (playItems.Count > 0)
                            {
                                this.Clear();

                                _playbill = playbill;

                                foreach (var item in playItems)
                                {
                                    _playItemCollection.Add(_playItemCollection.CreateBindablePlayItem(item));
                                }
                            }
                        }
                    }
                });
            }
        }
        private void LoadPlaybill()
        {
            if (CanLoadPlaybill())
            {
                this.LoadPlaybillInteractionRequest.Raise(new LoadPlaybillConfirmation {
                    Title = "选择节目单", Playbills = LoadPlaybills()
                },
                                                          c =>
                {
                    if (c.Confirmed)
                    {
                        BindablePlaybill bill = c.SelectedPlaybill;

                        if (bill != null)
                        {
                            List <IPlayItem> playItems = new List <IPlayItem>();
                            var playbill = Playbill.Load(bill.Id, playItems);

                            if (playItems.Count == 0)
                            {
                                return;
                            }

                            if (_playItemCollection.Count > 0)
                            {
                                var maxStopTime = playItems[0].StartTime;
                                if (maxStopTime > _playItemCollection.Last().StopTime)
                                {
                                    int conflictCount = 0;
                                    // TODO: 提示截短。

                                    for (int i = _playItemCollection.Count - 1; i >= 0; i--)
                                    {
                                        var temp = _playItemCollection[i];
                                        if (temp.StopTime <= maxStopTime)
                                        {
                                            break;
                                        }

                                        if (temp.ScheduleMode != PlayScheduleMode.Auto)
                                        {
                                            conflictCount++;
                                        }
                                    }

                                    if (conflictCount > 0)
                                    {
                                        this.RaiseDisplayMessageInteractionRequest("错误", "新加载的节目单的开始时间为" + maxStopTime.ToString("yyyy-MM--dd HH:mm:ss") + ",在这个时间段内与现有定时播或定时插播存在时间冲突。");
                                        return;
                                    }
                                }
                            }

                            //this.Clear();

                            _playbill         = playbill;
                            _bindablePlaybill = bill;

                            _playItemCollection.Append(playItems);
                            //foreach (var item in playItems)
                            //{
                            //    _playItemCollection.Add(_playItemCollection.CreateBindablePlayItem(item));
                            //}
                        }
                    }
                });
            }
        }