Exemple #1
0
      public async Task <IActionResult> Edit(int id, [Bind("ID,GivenName,FamilyName,DateCreated,Creator")] ParticipantQOTD participantQOTD)
      {
          if (id != participantQOTD.ID)
          {
              return(NotFound());
          }

          if (ModelState.IsValid)
          {
              try
              {
                  _context.Update(participantQOTD);
                  await _context.SaveChangesAsync();
              }
              catch (DbUpdateConcurrencyException)
              {
                  if (!ParticipantQOTDExists(participantQOTD.ID))
                  {
                      return(NotFound());
                  }
                  else
                  {
                      throw;
                  }
              }
              return(RedirectToAction(nameof(Index)));
          }
          return(View(participantQOTD));
      }
Exemple #2
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(string id, [Bind("ID,address,cost,bathrooms,squarefootage,bedrooms,emailID,zipcode,insertionDate,type,state,city")] USAHouses uSAHouses)
        {
            if (id != uSAHouses.ID)
            {
                return(NotFound());
            }

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