Exemple #1
0
        public void Update(string Item_Number, int user_id)
        {
            History updatewishlist = new History()
            {
                Item_Number = Item_Number,
                user_id     = user_id
            };

            _context.Update(updatewishlist);
            _context.Entry(updatewishlist);
            _context.SaveChanges();
        }
Exemple #2
0
        public void Update(string Item_Number, int user_id)
        {
            Shoppingcart updatewishlist = new Shoppingcart()
            {
                Item_Number = Item_Number,
                user_id     = user_id
            };

            _context.Update(updatewishlist);
            _context.Entry(updatewishlist);
            _context.SaveChanges();
        }
 public void Update(int id, string firstName, string lastName, string userName, string emailAdress, string password, string adress, string phoneNumber, string Country, string Date_of_birth, string gender)
 {
     ClassUser updateduser = new ClassUser() {   ID = id,
                                                 FirstName = firstName,
                                                 LastName = lastName,
                                                 UserName = userName,
                                                 EmailAdress = emailAdress,
                                                 Password = password,
                                                 Adress = adress,
                                                 PhoneNumber = phoneNumber,
                                                 country = Country,
                                                 date_of_birth = Date_of_birth,
                                                 Gender = gender};
     _context.Update(updateduser);
     _context.Entry(updateduser);
     _context.SaveChanges();
 }
Exemple #4
0
        public async Task <ActionResult <User> > AddSetToWishlist(long userId, long partId)
        {
            User user = await ReturnUser(userId);

            Part part = await ReturnPart(partId);

            if (!user.WishlistParts.Contains(part))
            {
                user.WishlistParts.Add(part);
            }

            _context.Entry(user).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(user);
        }