Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("KitId,KitName,Cost,Details")] Kits kits)
        {
            if (ModelState.IsValid)
            {
                _context.Add(kits);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(kits));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("CustomerID,FirstName,LastName,Address1,Address2,City,State,ZipCode,Phone,EmailAddress,UserAccountId")] Customers customers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(RedirectToAction(nameof(Details)));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("SeminarId,SeminarTitle,Seasonal,DeliveryType,MaterialKit1,MaterialKit2,MaterialKit3,Details,EventDate")] Seminars seminars)
        {
            if (ModelState.IsValid)
            {
                _context.Add(seminars);
                await _context.SaveChangesAsync();

                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));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("TransactionId,CustomerId,SeminarId,KitSelection,ChangeDate,ChangeAction")] Transactions transactions)
        {
            if (ModelState.IsValid)
            {
                _context.Add(transactions);
                await _context.SaveChangesAsync();

                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));
        }
Exemplo n.º 5
0
        Create([Bind("EnrollmentId,CustomerId,SeminarId,KitSelection,EnrollmentDate,Notes")] Enrollments enrollments)
        {
            if (ModelState.IsValid)
            {
                enrollments.EnrollmentDate = DateTime.Now;
                _context.Add(enrollments);
                await _context.SaveChangesAsync();

                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));
        }