Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("CustomerId,CompanyName,VAT,StreetName,StreetNo,PostalCode,City,Country,PhoneNo,Email")] 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));
        }
Esempio n. 2
0
        public async Task <IActionResult> Edit(int id, [Bind("K_AdminId,CustomerId,FirstName,LastName,PhoneNo,Email")] K_Admin k_Admin)
        {
            if (id != k_Admin.K_AdminId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(k_Admin);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!K_AdminExists(k_Admin.K_AdminId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CustomerId"] = new SelectList(_context.Customer, "CustomerId", "CompanyName", k_Admin.CustomerId);
            return(View(k_Admin));
        }
Esempio n. 3
0
        public async Task <IActionResult> Edit(int id, [Bind("JobId,JobName")] Job job)
        {
            if (id != job.JobId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(job);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!JobExists(job.JobId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(job));
        }
Esempio n. 4
0
        public async Task <IActionResult> Edit(int id, [Bind("HardwareId,HardwareName")] Hardware hardware)
        {
            if (id != hardware.HardwareId)
            {
                return(NotFound());
            }

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