public async Task <IActionResult> Edit(string id, [Bind("CustomerID,LastAmount,Balance")] Deposit deposit)
        {
            if (id != deposit.CustomerID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(deposit);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DepositExists(deposit.CustomerID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(deposit));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("OrderID,CustomerCID,PriceAmount,TansportAmount,AdvanceBalance")] Order order)
        {
            if (id != order.OrderID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(order);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrderExists(order.OrderID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(order));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("ProductID,ProductName,Price,Rate")] Product product)
        {
            if (id != product.ProductID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(product);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProductExists(product.ProductID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
Exemplo n.º 4
0
 public async void Update(Site site)
 {
     _context.Update(site);
     await _context.SaveChangesAsync();
 }
Exemplo n.º 5
0
 public async void Update(Customer customer)
 {
     _context.Update(customer);
     await _context.SaveChangesAsync();
 }