Exemplo n.º 1
0
        public async Task <IActionResult> Edit(string id, [Bind("Item_Number,Name,Year,Theme,Subtheme,Pieces,Minifigures,Image_URL,GBP_MSRP,USD_MSRP,CAD_MSRP,EUR_MSRP,Packaging,Availability")] Lego lego)
        {
            if (id != lego.Item_Number)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(lego);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LegoExists(lego.Item_Number))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(lego));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,FirstName,LastName,UserName,EmailAdress,Password,Adress,PhoneNumber,country,date_of_birth,Gender")] ClassUser classUser)
        {
            if (id != classUser.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(classUser);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClassUserExists(classUser.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(classUser));
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
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();
 }