Esempio n. 1
0
        public async Task <IActionResult> Edit(string id, [Bind("SeminarId,SeminarTitle,Seasonal,DeliveryType,MaterialKit1,MaterialKit2,MaterialKit3,Details,EventDate")] Seminars seminars)
        {
            if (id != seminars.SeminarId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(seminars);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SeminarsExists(seminars.SeminarId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MaterialKit1"] = new SelectList(_context.Kits, "KitId", "KitId", seminars.MaterialKit1);
            ViewData["MaterialKit2"] = new SelectList(_context.Kits, "KitId", "KitId", seminars.MaterialKit2);
            ViewData["MaterialKit3"] = new SelectList(_context.Kits, "KitId", "KitId", seminars.MaterialKit3);
            return(View(seminars));
        }
        public async Task <IActionResult> Edit(int id, [Bind("EnrollmentId,CustomerId,SeminarId,KitSelection,EnrollmentDate,Notes")] Enrollments enrollments)
        {
            if (id != enrollments.EnrollmentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(enrollments);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EnrollmentsExists(enrollments.EnrollmentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CustomerId"]   = new SelectList(_context.Customers, "CustomerId", "CustomerId", enrollments.CustomerId);
            ViewData["KitSelection"] = new SelectList(_context.Enrollments, "KitSelection", "KitSelection", enrollments.KitSelection);
            ViewData["SeminarId"]    = new SelectList(_context.Seminars, "SeminarId", "SeminarId", enrollments.SeminarId);
            return(View(enrollments));
        }
Esempio n. 3
0
        public async Task <IActionResult> Edit(int id, [Bind("KitId,KitName,Cost,Details")] Kits kits)
        {
            if (id != kits.KitId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(kits);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KitsExists(kits.KitId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(kits));
        }
Esempio n. 4
0
        public async Task <IActionResult> Edit(int id, [Bind("TransactionId,CustomerId,SeminarId,KitSelection,ChangeDate,ChangeAction")] Transactions transactions)
        {
            if (id != transactions.TransactionId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(transactions);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TransactionsExists(transactions.TransactionId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CustomerId"]   = new SelectList(_context.Customers, "CustomerId", "CustomerId", transactions.CustomerId);
            ViewData["KitSelection"] = new SelectList(_context.Kits, "KitSelection", "KitSelection", transactions.KitSelection);
            ViewData["SeminarId"]    = new SelectList(_context.Seminars, "SeminarId", "SeminarId", transactions.SeminarId);
            return(View(transactions));
        }
        public async Task <IActionResult> Edit(int id, [Bind("CustomerId,FirstName,LastName,Address1,Address2,City,State,ZipCode,Phone,EmailAddress,UserAccountId")] Customers customers)
        {
            if (id != customers.CustomerId)
            {
                return(NotFound());
            }

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