Exemplo n.º 1
0
        public static async Task <FullStoragePOCO> BuildFullStorageDTO(StoragePOCO storage)
        {
            var result = new FullStoragePOCO
            {
                Component = await IDatabaseController.DatabaseController.GetComponent(storage.ComponentId),
                Count     = storage.Count
            };

            return(result);
        }
Exemplo n.º 2
0
        private async void Components_ComponentAddButton_Click(object sender, RoutedEventArgs e)
        {
            var newComponent = new ComponentPOCO()
            {
                ComponentName = "ComponentName",
                ComponentType = "ComponentType"
            };
            await DatabaseProvider.Database.AddComponent(newComponent);

            AllComponents.Add(newComponent);
            var newStorage = new StoragePOCO()
            {
                ComponentId = newComponent.Id,
                Count       = 0
            };
            await DatabaseProvider.Database.AddComponentToStorage(newStorage);

            var storage = await FullStoragePOCO.BuildFullStorageDTO(newStorage);

            AllStorage.Add(storage);

            RefreshStorageDataGrid();
            RefreshComponentsDataGrid();
        }
Exemplo n.º 3
0
 public async Task <bool> UpdateComponentInStorage(StoragePOCO storage)
 {
     return(await Connection.UpdateAsync(storage) == 1);
 }
Exemplo n.º 4
0
 public async Task <bool> AddComponentToStorage(StoragePOCO storage)
 {
     return(await Connection.SaveAsync(storage));
 }
Exemplo n.º 5
0
 public FullStoragePOCO(StoragePOCO storage)
 {
     Component = IDatabaseController.DatabaseController.GetComponent(storage.ComponentId).Result;
     Count     = storage.Count;
 }