public async Task <IActionResult> Edit(int id, [Bind("Detail,Timestamp,WebinarMeetingId,ParticipantId,Id,Modified")] Post post) { if (id != post.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(post); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PostExists(post.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(post)); }
public async Task <IActionResult> Edit(string id, [Bind("Id,Value")] Configuration configuration) { if (id != configuration.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(configuration); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConfigurationExists(configuration.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(configuration)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Modified")] Role role) { if (id != role.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(role); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoleExists(role.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(role)); }
public async Task <IActionResult> Edit(int id, [Bind("Name,EmailAddress,Subject,Message,Accepted,WebinarMeetingId,Id,Modified")] Invitation invitation) { if (id != invitation.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(invitation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InvitationExists(invitation.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(invitation)); }
public async Task <IActionResult> Edit(int id, [Bind("Name,Origin,JoinDate,RegisterId,Id,Modified")] Participant participant) { if (id != participant.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(participant); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ParticipantExists(participant.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(participant)); }
public async Task <IActionResult> Edit(string id, [Bind("AñoDeCreacion,Pais,Ciudad,Dirección,TipoEscuela,Id,Nombre")] Escuela escuela) { if (id != escuela.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(escuela); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EscuelaExists(escuela.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(escuela)); }
public async Task <IActionResult> Edit(int id, [Bind("PasswordHash,Username,LastLogin,Active,Id,Modified")] Login login) { if (id != login.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(login); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LoginExists(login.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(login)); }
public async Task <IActionResult> Edit(string id, [Bind("AlumnoId,AsignaturaId,Nota,Id,Nombre")] Evaluación evaluación) { if (id != evaluación.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(evaluación); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EvaluaciónExists(evaluación.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AlumnoId"] = new SelectList(_context.Alumnos, "Id", "Id", evaluación.AlumnoId); ViewData["AsignaturaId"] = new SelectList(_context.Asignaturas, "Id", "Id", evaluación.AsignaturaId); return(View(evaluación)); }
public async Task <IActionResult> Edit(string id, [Bind("Nombre,Jornada,Direccion,EscuelaId,Id,Descripicion")] Curso curso) { if (id != curso.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(curso); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CursoExists(curso.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EscuelaId"] = new SelectList(_context.Escuelas, "Id", "Id", curso.EscuelaId); return(View(curso)); }
public async Task <IActionResult> Edit(int id, [Bind("Name,Data,WebinarMeetingId,ExpireDate,Id,Modified")] MediaRecord mediaRecord) { if (id != mediaRecord.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mediaRecord); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MediaRecordExists(mediaRecord.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["WebinarMeetingId"] = new SelectList(_context.WebinarMeeting, "Id", "Description", mediaRecord.WebinarMeetingId); return(View(mediaRecord)); }
public async Task <IActionResult> Edit(string id, [Bind("CursoId,Id,Nombre")] Asignatura asignatura) { if (id != asignatura.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(asignatura); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AsignaturaExists(asignatura.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CursoId"] = new SelectList(_context.Cursos, "Id", "Id", asignatura.CursoId); return(View(asignatura)); }
public IActionResult Edit(Curso curso) { ViewBag.Fecha = DateTime.UtcNow.ToString(); if (ModelState.IsValid) { var editCurso = (from cur in _context.Cursos where cur.Id == curso.Id select cur).FirstOrDefault(); if (editCurso == null) { return(View("MultiCurso", _context.Cursos)); } editCurso.Nombre = curso.Nombre; editCurso.Dirección = curso.Dirección; editCurso.Jornada = curso.Jornada; _context.Update(editCurso); _context.SaveChanges(); ViewBag.mensaje = "Curso Editado"; return(View("Index", curso)); } else { return(View(curso)); } }
public async Task <IActionResult> Edit(int id, [Bind("Name,UtcOffset,Dst,Id,Modified")] MTimeZone mTimeZone) { if (id != mTimeZone.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mTimeZone); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MTimeZoneExists(mTimeZone.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mTimeZone)); }
public async Task <IActionResult> Edit(int id, [Bind("Event,Timestamp,Description,WebinarMeetingId,Id,Modified")] InteractionLog interactionLog) { if (id != interactionLog.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(interactionLog); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InteractionLogExists(interactionLog.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(interactionLog)); }
public async Task <IActionResult> Edit(int id, [Bind("StartDate,Duration,Password,HostVideoEnabled,ParticipantVideoEnabled,MaxParticipants,Description,Name,BannerUrl,UserId,Price,Id,Modified")] WebinarMeeting webinarMeeting) { if (id != webinarMeeting.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(webinarMeeting); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WebinarMeetingExists(webinarMeeting.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["UserId"] = new SelectList(_context.User, "Id", "FirstName", webinarMeeting.UserId); return(View(webinarMeeting)); }
public async Task <IActionResult> Edit(int id, [Bind("Username,FirstName,LastName,DateOfBirth,CompanyName,PhoneNumber,LanguageId,PhotoUrl,Id,Modified")] User user) { if (id != user.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["LanguageId"] = new SelectList(_context.Language, "Id", "Id", user.LanguageId); return(View(user)); }
public async Task <IActionResult> Edit(string id, [Bind("Name,Id")] Language language) { if (id != language.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(language); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LanguageExists(language.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(language)); }
public async Task <IActionResult> Edit(int id, [Bind("Date,ParticipantId,WebinarMeetingId,Id,Modified")] Register register) { if (id != register.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(register); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RegisterExists(register.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(register)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Nombre,CursoId,Id")] Alumno alumno) { if (id != alumno.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(alumno); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AlumnoExists(alumno.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CursoId"] = new SelectList(_context.Cursos, "Id", "Direccion", alumno.CursoId); return(View(alumno)); }
public async Task <IActionResult> Edit(int id, [Bind("RoleId,UserId,Id,Modified")] UserRoleMapping userRoleMapping) { if (id != userRoleMapping.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(userRoleMapping); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserRoleMappingExists(userRoleMapping.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(userRoleMapping)); }
public IActionResult Edit(Asignatura asignatura) { if (ModelState.IsValid) { _context.Update(asignatura); _context.SaveChanges(); ViewBag.mensaje = "Asignatura Actualizado"; return(View("Index", asignatura)); } else { return(View(asignatura)); } }
public IActionResult Edit(Alumno alumno) { if (ModelState.IsValid) { _context.Update(alumno); _context.SaveChanges(); ViewBag.mensaje = "Alumno Actualizado"; return(View("Index", alumno)); } else { return(View(alumno)); } }
public IActionResult Edit(Curso curso) { if (ModelState.IsValid) { var escuela = _context.Escuelas.FirstOrDefault(); curso.EscuelaId = escuela.Id; _context.Update(curso); _context.SaveChanges(); ViewBag.mensaje = "Curso Actualizado"; return(View("Index", curso)); } else { return(View(curso)); } }
public async Task <IActionResult> Edit(string id, [Bind("Nombre,CursoId,Id")] Asignatura asignatura) { if (id != asignatura.Id) { return(NotFound()); } if (ModelState.IsValid) { try { var checkIfExist = await _context.Asignaturas.Where(x => x.Nombre == asignatura.Nombre && x.CursoId == asignatura.CursoId) .FirstOrDefaultAsync(); if (checkIfExist != null) { TempData.Add("ModelError", $"Curso {checkIfExist.CursoId} already have a Asigatura with name {checkIfExist.Nombre}"); return(RedirectToAction(nameof(Edit), new { Id = id })); //View("Edit"); } _context.Update(asignatura); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AsignaturaExists(asignatura.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CursoId"] = new SelectList(_context.Cursos, "Id", "Nombre", asignatura.CursoId); return(View(asignatura)); }