private async Task generateInventoryMuseals(string inventoryID)
        {
            var mus = await museals.GetObjectsList();

            foreach (var museal in mus)
            {
                var invMusData = new InventoryMusealData {
                    ID = Guid.NewGuid().ToString(), InventoryID = inventoryID, MusealID = museal?.Data?.ID
                };
                var invMusObj = new InventoryMuseal(invMusData);
                await inventoryMuseals.AddObject(invMusObj);
            }
        }
Example #2
0
        public static InventoryMusealView CreateInventoryMuseal(Museal o, InventoryMuseal i)
        {
            var v = new InventoryMusealView();

            setCommonValues(v, o?.Data?.ID, o?.Data?.ValidFrom, o?.Data?.ValidTo);
            setMusealCommonValues(v, o?.Data?.Author, o?.Data?.Designation,
                                  o?.Data?.Info, o?.Data?.DamagesBefore, o?.Data?.DefaultLocation, o?.Data?.CurrentLocation,
                                  o?.Data?.StateBefore);
            v.IsChecked       = i?.Data?.IsChecked ?? false;
            v.IsFound         = i?.Data?.IsFound ?? false;
            v.HasStateChanged = i?.Data?.HasStateChanged ?? false;
            v.StateNow        = i?.Data?.State ?? MusealState.Määramata;
            v.DamagesNow      = i?.Data?.Damages;
            v.MusealID        = i?.Data?.MusealID;
            v.InventoryID     = i?.Data?.InventoryID;
            return(v);
        }
 public async Task UpdateObject(InventoryMuseal o)
 {
     dbSet.Update(o.Data);
     await db.SaveChangesAsync();
 }
 public async Task DeleteObject(InventoryMuseal o)
 {
     dbSet.Remove(o.Data);
     await db.SaveChangesAsync();
 }
 public async Task AddObject(InventoryMuseal o)
 {
     dbSet.Add(o.Data);
     await db.SaveChangesAsync();
 }