Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("OrderId,Username,FirstName,LastName,AddressLineOne,AddressLineTwo,City,State,ZipCode,PhoneNumber,Email,Total,OrderDate")] ServiceInstallOrder serviceInstallOrder)
        {
            if (id != serviceInstallOrder.OrderId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(serviceInstallOrder);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ServiceInstallOrderExists(serviceInstallOrder.OrderId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(serviceInstallOrder));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("OrderId,Username,FirstName,LastName,AddressLineOne,AddressLineTwo,City,State,ZipCode,PhoneNumber,Email,Total,OrderDate")] ServiceInstallOrder serviceInstallOrder)
        {
            if (ModelState.IsValid)
            {
                _context.Add(serviceInstallOrder);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(serviceInstallOrder));
        }