Ejemplo n.º 1
0
        protected override void Initialize()
        {
            base.Initialize();

            if (ProductType == null && TypeSelectorItems.Count() > 0)
            {
                ProductType = TypeSelectorItems.FirstOrDefault();
            }

            actualCalculationTarget = Services.DataService.CalculationTargetProperty.TotalCost;
        }
Ejemplo n.º 2
0
        protected override void Initialize()
        {
            base.Initialize();

            TypeSelectorItems.Insert(0, new ProductType {
                Name = "Не обрано", Id = -1
            });

            IntervalList = AggregationInterval.GetList();

            SelectedInterval = IntervalList.FirstOrDefault();

            ProductType = TypeSelectorItems.FirstOrDefault();
        }
Ejemplo n.º 3
0
        private void RenameTypeCommandExecute(object obj)
        {
            NewProductTypeEditable = false;

            Task.Factory.StartNew(async() =>
            {
                if (await StoreService.RenameProductType(ProductType, NewProductType) > 0)
                {
                    logger.Info("Purchase type {0} renamed", NewProductType);
                    Status.Post("Тип покупки \"{0}\" перейменовано", NewProductType);

                    ProductType    = TypeSelectorItems.Single(t => t.Id == ProductType.Id);
                    NewProductType = string.Empty;
                }
                else
                {
                    logger.Warn("Purchase type {0} not renamed", NewProductType);
                    Status.Post("Помилка: тип покупки \"{0}\" не перейменовано", NewProductType);
                }
                NewProductTypeEditable = true;
            });
        }