示例#1
0
        public ContentOfferViewModel(IProductItemDataStore productItemData, ShoppingManager shoppingManager)
        {
            ProductItemDataStore = productItemData;

            ShoppingManager = shoppingManager;

            //var offers = ProductItemDataStore.GetOfferOfStore(App.ApplicationManager.CurrenstStoreGuid.ToString());


            // var products = ProductItemDataStore.GetInventoryForStore(StoreId);
            //StoreOffers = new ObservableCollection<Offer>(offers);
            //SetDataToPresenter(StoreOffers);
        }
示例#2
0
        public AdministratorViewModel(IProductItemDataStore productItemDataStore)
        {
            _ProductDataStore = productItemDataStore;
            //GetPhotoCommand = new Command()


            NewItem = new ProductItem();

            Data = new List <Entry>();

            StoreItems = new ObservableCollection <ProductItem>();
            StoreItems = GetData();

            Entry TotalAvailable = new Entry(ItemsAvailble(StoreItems))
            {
                Color = SkiaSharp.SKColor.Parse("#313d4e"),
                Label = "Available:" + ItemsAvailble(StoreItems).ToString(),
            };


            Data.Add(TotalAvailable);
            Entry TotalItems = new Entry(StoreItems.Count)
            {
                Color = SkiaSharp.SKColor.Parse("#49D19D"),
                Label = "Total" + StoreItems.Count.ToString(),
            };

            Data.Add(TotalItems);
            InventoryChart = new DonutChart()
            {
                Entries       = Data,
                LabelTextSize = 50
            };


            SalesData = GetSalesData();

            SalesChart = new PointChart()
            {
                Entries = SalesData,
            };

            OrdersItems = new ObservableCollection <Order>();
            OrdersItems = GetOrders();

            DoneCommand   = new Command(async() => await GoAdminHome());
            AddCommand    = new Command(async() => await AddItem());
            UpdateCommand = new Command(async() => await UpdateItem());
        }