Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("AmazonPurchaseId,Quantity,Description,PurchasePrice,URL,ShippingCost")] AmazonPurchase amazonPurchase)
        {
            if (id != amazonPurchase.AmazonPurchaseId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(amazonPurchase);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AmazonPurchaseExists(amazonPurchase.AmazonPurchaseId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(amazonPurchase));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("CustomerId,Name,TicketNumber")] Customer customer)
        {
            if (id != customer.CustomerId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(customer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CustomerExists(customer.CustomerId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("LaborId,Quantity,Description,LaborCost")] Labor labor)
        {
            if (id != labor.LaborId)
            {
                return(NotFound());
            }

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