コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("FeedbackID,FeedbackQues")] Feedback feedback)
        {
            if (id != feedback.FeedbackID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(feedback);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FeedbackExists(feedback.FeedbackID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(feedback));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("DonorID,DonorName,DonorMessage")] Donor donor)
        {
            if (id != donor.DonorID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(donor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DonorExists(donor.DonorID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(donor));
        }
コード例 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("ParkingID,VisitorName,VisitoCarNo,ParkingPurpose")] Parking parking)
        {
            if (id != parking.ParkingID)
            {
                return(NotFound());
            }

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