Exemple #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,DeviceID,ProductID,DeviceProductStock,DeviceProductSale")] DeviceProduct deviceProduct)
        {
            if (id != deviceProduct.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(deviceProduct);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DeviceProductExists(deviceProduct.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(deviceProduct));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,UserNickName,UserOpenID,UserPhone,UserGender,UserBirthday")] 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));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,CategoryID,CategoryName,CategoryInfo")] ProductCategory productCategory)
        {
            if (id != productCategory.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(productCategory);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProductCategoryExists(productCategory.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(productCategory));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,ProductID,CategoryID,BrandID,ProductName,ProductImage,ProductWeight,ProductPrice,ProductStock,ProductSale")] CommodityManage commodityManage)
        {
            if (id != commodityManage.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(commodityManage);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CommodityManageExists(commodityManage.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(commodityManage));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,DeviceID,DeviceNumber,DeviceProductKey,DeviceSecret,DeviceProvince,DeviceCity,DeviceAddress,DeviceSetDay")] DeviceManage deviceManage)
        {
            if (id != deviceManage.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(deviceManage);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DeviceManageExists(deviceManage.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(deviceManage));
        }
Exemple #6
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,AdminUserName,AdminPassword,AdminUserNumber,AdminUserPhone,AdminUserEmail,AdminUserRole")] AdminUser adminUser)
        {
            if (id != adminUser.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(adminUser);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AdminUserExists(adminUser.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(adminUser));
        }