public IActionResult InventoryList()
        {
            var users = _context.Users.ToList();
            var items = _context.Inventories.ToList();

            var result = new RelationListViewModel
            {
                Inventory = items,
                Users     = users
            };

            return(View(result));
        }
Ejemplo n.º 2
0
        public IActionResult Inventory(int id)
        {
            var inventories = (from user in _context.Users
                               where user.Id == id
                               join aratablo in _context.UserAndInventoriyRelationship on user.Id equals aratablo.UserId
                               join inventory in _context.Inventories on aratablo.InventoriyId equals inventory.Id
                               select inventory)
                              .ToList();

            var userr = _context.Users.FirstOrDefault(x => x.Id == id);

            var items = _context.Inventories.ToList();

            var model = new RelationListViewModel
            {
                Inventory = inventories,
                User      = userr,
                Items     = items
            };

            //var model = _context.Users.Where(x => x.Id == id).Include(x => x.UserAndInventoriyRelationships).ThenInclude(x => x.Item).ToList();

            return(View(model));
        }
Ejemplo n.º 3
0
        public void NotifyRelationsReportReady(string title, IEnumerable <IDsmResolvedRelation> relations)
        {
            RelationListViewModel viewModel = new RelationListViewModel(title, relations);

            RelationsReportReady?.Invoke(this, viewModel);
        }