public async Task <IActionResult> Edit(int id, [Bind("id,MetroArea,YearBuilt,insertionDate,Creator,RecentEdit")] REProperty rEProperty)
        {
            if (id != rEProperty.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(rEProperty);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!REPropertyExists(rEProperty.id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(rEProperty));
        }
      public async Task <IActionResult> Edit(int id, [Bind("id,Question,QuestionAuthor,QuestionDate,Theme")] ParticipantQOTD Participant)
      {
          if (id != Participant.id)
          {
              return(NotFound());
          }

          if (ModelState.IsValid)
          {
              try
              {
                  _context.Update(Participant);
                  await _context.SaveChangesAsync();
              }
              catch (DbUpdateConcurrencyException)
              {
                  if (!QOTDExists(Participant.id))
                  {
                      return(NotFound());
                  }
                  else
                  {
                      throw;
                  }
              }
              return(RedirectToAction(nameof(Index)));
          }
          return(View(Participant));
      }
Example #3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Question,Author,QuestionAuthor,QuestionDate")] QOTDAnswer qOTDAnswer)
        {
            if (id != qOTDAnswer.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(qOTDAnswer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!QOTDAnswerExists(qOTDAnswer.id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(qOTDAnswer));
        }
        public async Task <IActionResult> Edit(int id, [Bind("id,Contractorid,MetroArea,ZipCode,ProjectType,FreeformDescription,insertionDate,Creator")] REProject rEProject)
        {
            if (id != rEProject.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(rEProject);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!REProjectExists(rEProject.id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(rEProject));
        }
Example #5
0
        public async Task <IActionResult> Edit(int id, [Bind("id,CreditScore,Lease,Month2Month,FamilyLetter,insertionDate,Creator")] Renter renter)
        {
            if (id != renter.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(renter);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RenterExists(renter.id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(renter));
        }
        public async Task <IActionResult> Edit(string id, [Bind("id,ContractorName,MetroArea,ZipCode,Specialty,insertionDate,Creator")] Contractor contractor)
        {
            if (id != contractor.id)
            {
                return(NotFound());
            }

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