예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,LastName,MiddleName,FirstName,Gender,Address,Mobile")] User user)
        {
            if (id != user.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(user);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserExists(user.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,UserID,MobileID,OrderDate")] Order order)
        {
            if (id != order.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(order);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrderExists(order.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MobileID"] = new SelectList(_context.Mobile, "ID", "ID", order.MobileID);
            ViewData["UserID"]   = new SelectList(_context.Set <User>(), "ID", "ID", order.UserID);
            return(View(order));
        }
예제 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Description,Typr,Brand,Price,Image,Rating")] Mobile mobile)
        {
            if (id != mobile.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(mobile);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MobileExists(mobile.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(mobile));
        }
예제 #4
0
 public bool Update(Cart entity)
 {
     _dbContext.Update(entity);
     return(Save());
 }
예제 #5
0
 public bool Update(ProductDetails entity)
 {
     _dbContext.Update(entity);
     return(Save());
 }
예제 #6
0
 public bool Update(MobileBrand entity)
 {
     _dbContext.Update(entity);
     return(Save());
 }