Exemple #1
0
        public void AddUsers(Users users)
        {
            UsersItems.Add(users);
            ListBoxUsers.Items.Add(users.CxListBoxItem);
            var bindImg = new BindingImage();

            ListArrow.Add(bindImg);
        }
        public async Task <IActionResult> Buy(Guid?id, double amount)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var userId   = _context.Users.FirstOrDefault(x => x.Email == User.Identity.Name).Id;
            var userItem = new UsersItems()
            {
                ItemId = (Guid)id,
                UserId = userId,
                Amount = amount
            };
            await _context.AddAsync(userItem);

            await _context.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }