예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("FileId,EventTypeId,Name,EventDate,StartTime,EndTime,ArrivalOfOrganisers,AmountOfPeople,AmountOfPeopleReception,AmountOfPeopleDiningEst,AmountOfPeopleDesertEst")] File file)
        {
            if (id != file.FileId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(file);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FileExists(file.FileId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EventTypeId"] = new SelectList(_context.EventType, "EventTypeID", "EventTypeID", file.EventTypeId);
            return(View(file));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("FileRemarkID,FileID,Remark")] FileRemark fileRemark)
        {
            if (id != fileRemark.FileRemarkID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(fileRemark);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FileRemarkExists(fileRemark.FileRemarkID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FileID"] = new SelectList(_context.Files, "Id", "Id", fileRemark.FileID);
            return(View(fileRemark));
        }
예제 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("EventTypeID,Description")] EventType eventType)
        {
            if (id != eventType.EventTypeID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(eventType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EventTypeExists(eventType.EventTypeID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(eventType));
        }
예제 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("CustomerID,Name")] 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));
        }