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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }