Пример #1
0
        public void UpdateFromSvc(OrderModel svcOrder)
        {
            if (this.Updated)
            {
                this.Updated = false;
            }

            if (OrderStatusId != svcOrder.OrderStatusId)
            {
                OrderStatusId = svcOrder.OrderStatusId;
                _status       = (StatusEnum)OrderStatusId;
                OnPropertyChanged("Status");
            }

            if (UID != svcOrder.Uid)
            {
                UID = svcOrder.Uid;
            }

            if (Number != svcOrder.Number)
            {
                Number = svcOrder.Number;
                OnPropertyChanged("Number");
            }

            if (CreateDate != svcOrder.CreateDate)
            {
                CreateDate = svcOrder.CreateDate;
                OnPropertyChanged("CreateDate");
            }

            if (WaitingTimerString != svcOrder.WaitingTimerString)
            {
                WaitingTimerString = svcOrder.WaitingTimerString;
                OnPropertyChanged("WaitingTimerString");
            }

            if (Waiter != svcOrder.Waiter)
            {
                Waiter = svcOrder.Waiter;
                OnPropertyChanged("Waiter");
            }

            if (HallName != svcOrder.HallName)
            {
                HallName = svcOrder.HallName;
                OnPropertyChanged("HallName");
            }

            if (TableName != svcOrder.TableName)
            {
                TableName = svcOrder.TableName;
                OnPropertyChanged("TableName");
            }

            if (DivisionColorRGB != svcOrder.DivisionColorRGB)
            {
                DivisionColorRGB = svcOrder.DivisionColorRGB;
                OnPropertyChanged("DivisionColorRGB");
            }

            // ОБНОВИТЬ БЛЮДА В ЗАКАЗЕ
            // выставить флаг _isDishesListUpdated в true, если была изменена коллекция блюд или изменен порядок блюд
            // и необходимо перерисовать все панели
            _isDishesListUpdated = AppLib.JoinSortedLists <OrderDishViewModel, OrderDishModel>(Dishes, svcOrder.Dishes.Values.ToList());
            if (_isDishesListUpdated && !this.Updated)
            {
                this.Updated = true;
            }
        }