예제 #1
0
        public async Task <IActionResult> Create([Bind("EventTypeID,Description")] EventType eventType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(eventType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(eventType));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("CustomerID,Name")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("FileId,EventTypeId,Name,EventDate,StartTime,EndTime,ArrivalOfOrganisers,AmountOfPeople,AmountOfPeopleReception,AmountOfPeopleDiningEst,AmountOfPeopleDesertEst")] File file)
        {
            if (ModelState.IsValid)
            {
                _context.Add(file);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EventTypeId"] = new SelectList(_context.EventType, "EventTypeID", "EventTypeID", file.EventTypeId);
            return(View(file));
        }
예제 #4
0
        public async Task <IActionResult> Create([Bind("FileRemarkID,FileID,Remark")] FileRemark fileRemark)
        {
            if (ModelState.IsValid)
            {
                _context.Add(fileRemark);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FileID"] = new SelectList(_context.Files, "Id", "Id", fileRemark.FileID);
            return(View(fileRemark));
        }
예제 #5
0
        public async Task <IActionResult> Create([Bind("FileCustomerID,Name,FileID,CustomerID")] FileCustomer fileCustomer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(fileCustomer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CustomerID"] = new SelectList(_context.Customers, "CustomerID", "CustomerID", fileCustomer.CustomerID);
            ViewData["FileID"]     = new SelectList(_context.Files, "FileId", "FileId", fileCustomer.FileID);
            return(View(fileCustomer));
        }