Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,UserId,CreditNum,ExpireMonth,ExpireYear,OwnName,IdNum,CW")] Pay pay)
        {
            if (id != pay.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pay);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PayExists(pay.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(pay));
        }
Пример #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Manag,Name,Mail,City,Phone,password")] Users users)
        {
            if (id != users.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(users);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UsersExists(users.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(users));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,ProductId,NewOrderId")] ProductsNewOrder productsNewOrder)
        {
            if (id != productsNewOrder.ProductId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(productsNewOrder);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProductsNewOrderExists(productsNewOrder.ProductId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["NewOrderId"] = new SelectList(_context.NewOrder, "Id", "CW", productsNewOrder.NewOrderId);
            ViewData["ProductId"]  = new SelectList(_context.Products, "Id", "Category", productsNewOrder.ProductId);
            return(View(productsNewOrder));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Amount,Category,Type,Description,Price,NewPrice,Size,Size2,Size3,Size4,Size5,Size6,Size7,Size8,Size9,Size10,Colors,Colors2,Colors3,Colors4,Time,NumOfSale,OnSale,Pictures,Pictures2,Pictures3,Pictures4,Pictures5")] Products products)
        {
            if (id != products.Id)
            {
                return(NotFound());
            }

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