public async Task <IActionResult> Edit(int id, [Bind("ID,MeetingDate,Conducting,OpeningHymn,Invocation,SacramentHymn,ClosingHymn,Benediction")] Meeting meeting) { if (id != meeting.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(meeting); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MeetingExists(meeting.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(meeting)); }
public async Task <IActionResult> Edit(int id, [Bind("HymnTypeId,HymnType1")] HymnType hymnType) { if (id != hymnType.HymnTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hymnType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HymnTypeExists(hymnType.HymnTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(hymnType)); }
public async Task <IActionResult> Edit(int id, [Bind("CallingId,Bishopric,OtherLeader,CallingName")] Calling calling) { if (id != calling.CallingId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(calling); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CallingExists(calling.CallingId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(calling)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Date,Conducting,OpenHymn,OpenPrayer,SacramentHymn,IntermediateHymn,CloseHymn,ClosePrayer")] Sacrament sacrament) { if (id != sacrament.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sacrament); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SacramentExists(sacrament.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(sacrament)); }
public async Task <IActionResult> Edit(int id, [Bind("SpeakerId,SpeakerDate,FkWardMember,FkTopic,FkSpeakerType")] Speaker speaker) { if (id != speaker.SpeakerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(speaker); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpeakerExists(speaker.SpeakerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } ViewData["FkSpeakerType"] = new SelectList(_context.SpeakerType, "SpeakerTypeId", "SpeakerType1", speaker.FkSpeakerType); ViewData["FkTopic"] = new SelectList(_context.Topic, "TopicId", "TopicTitle", speaker.FkTopic); ViewData["FkWardMember"] = new SelectList(_context.WardMember, "WardMemberId", "Fname", speaker.FkWardMember); return(View(speaker)); }
public async Task <IActionResult> Edit(int id, [Bind("DirectoryID,WardID,First_Name,Last_Name,Age,Sex,Calling")] Directory directory) { if (id != directory.DirectoryID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(directory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DirectoryExists(directory.DirectoryID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["WardID"] = new SelectList(_context.Ward, "WardID", "Ward_Name", directory.WardID); return(View(directory)); }
public async Task <IActionResult> Edit(int id, [Bind("SpeakerID,MeetingID,SpeakerName,Subject")] Speaker speaker) { if (id != speaker.SpeakerID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(speaker); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpeakerExists(speaker.SpeakerID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(speaker)); }
public async Task <IActionResult> Edit(int id, [Bind("HymnId,HymnTitle,HymnNum,FkHymnType")] Hymn hymn) { if (id != hymn.HymnId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hymn); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HymnExists(hymn.HymnId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } ViewData["FkHymnType"] = new SelectList(_context.HymnType, "HymnTypeId", "HymnType1", hymn.FkHymnType); return(View(hymn)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Date,Conducting,OpeningSong,OpeningPrayer,SacramentSong,FirstSpeaker,SecondSpeaker,IntermediateSong,ThirdSpeaker,ClosingSong,ClosingPrayer")] SacProgram sacProgram) { if (id != sacProgram.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sacProgram); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SacProgramExists(sacProgram.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(sacProgram)); }
public async Task <IActionResult> Edit(int id, [Bind("TopicId,TopicTitle")] Topic topic) { if (id != topic.TopicId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(topic); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TopicExists(topic.TopicId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(topic)); }
public async Task <IActionResult> Edit(int id, [Bind("MeetingSpeakerId,MeetingId,SpeakerId")] MeetingSpeaker meetingSpeaker) { if (id != meetingSpeaker.MeetingSpeakerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(meetingSpeaker); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MeetingSpeakerExists(meetingSpeaker.MeetingSpeakerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MeetingId"] = new SelectList(_context.Meeting, "MeetingId", "Date", meetingSpeaker.MeetingId); ViewData["SpeakerId"] = new SelectList(_context.Speaker, "SpeakerId", "SpeakerName", meetingSpeaker.SpeakerId); return(View(meetingSpeaker)); }
public async Task <IActionResult> Edit(int id, [Bind("WardMemberId,Fname,Lname,FkCallingId")] WardMember wardMember) { if (id != wardMember.WardMemberId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(wardMember); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WardMemberExists(wardMember.WardMemberId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } ViewData["FkCallingId"] = new SelectList(_context.Calling, "CallingId", "CallingName", wardMember.FkCallingId); return(View(wardMember)); }
public async Task <IActionResult> Edit(int id, [Bind("PrayerId,FkPrayerType,PrayerDate,FkWardMemberId")] Prayer prayer) { if (id != prayer.PrayerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(prayer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrayerExists(prayer.PrayerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } ViewData["FkPrayerType"] = new SelectList(_context.PrayerType, "PrayerTypeId", "TypePrayer", prayer.FkPrayerType); ViewData["FkWardMemberId"] = new SelectList(_context.WardMember, "WardMemberId", "Fname", prayer.FkWardMemberId); return(View(prayer)); }
public async Task <IActionResult> Edit(int id, [Bind("AgendaID,MeetingID,Section,MemberID,HymnID,Special_Event_Text,Notes,Subject")] Agenda agenda) { if (id != agenda.AgendaID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(agenda); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AgendaExists(agenda.AgendaID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MemberID"] = new SelectList(_context.Directory.OrderBy(x => x.Last_Name), "DirectoryID", "Full_Name", agenda.MemberID); ViewData["HymnID"] = new SelectList(_context.Hymn.OrderBy(x => x.Hymn_Number), "HymnID", "Hymn_Number_Name", agenda.HymnID); ViewData["MeetingID"] = new SelectList(_context.Meeting, "MeetingID", "MeetingID", agenda.MeetingID); return(View(agenda)); }
public async Task <IActionResult> Edit(int id, [Bind("SacramentMeetingId,SacramentDate,FkConducting,FkMusicLeader,FkMusicPlayer,FkMeetingTopic,BabyBlessing,Confirmation,FkOpenPrayer,FkOpenSong,FkSacramentSong,FkWardBusiness,FkYouthSpeaker,FkFirstSpeaker,FkSecondSpeaker,FkIntermediateSong,FkClosingSong,FkClosingPrayer")] SacramentMeeting sacramentMeeting) { if (id != sacramentMeeting.SacramentMeetingId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sacramentMeeting); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SacramentMeetingExists(sacramentMeeting.SacramentMeetingId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } ViewData["FkClosingPrayer"] = new SelectList(_context.Prayer, "PrayerId", "PrayerId", sacramentMeeting.FkClosingPrayer); ViewData["FkClosingSong"] = new SelectList(_context.Hymn, "HymnId", "HymnTitle", sacramentMeeting.FkClosingSong); ViewData["FkConducting"] = new SelectList(_context.WardMember, "WardMemberId", "Fname", sacramentMeeting.FkConducting); ViewData["FkIntermediateSong"] = new SelectList(_context.Hymn, "HymnId", "HymnTitle", sacramentMeeting.FkIntermediateSong); ViewData["FkMeetingTopic"] = new SelectList(_context.Topic, "TopicId", "TopicTitle", sacramentMeeting.FkMeetingTopic); ViewData["FkMusicLeader"] = new SelectList(_context.WardMember, "WardMemberId", "Fname", sacramentMeeting.FkMusicLeader); ViewData["FkMusicPlayer"] = new SelectList(_context.WardMember, "WardMemberId", "Fname", sacramentMeeting.FkMusicPlayer); ViewData["FkOpenPrayer"] = new SelectList(_context.Prayer, "PrayerId", "PrayerId", sacramentMeeting.FkOpenPrayer); ViewData["FkOpenSong"] = new SelectList(_context.Hymn, "HymnId", "HymnTitle", sacramentMeeting.FkOpenSong); ViewData["FkSacramentSong"] = new SelectList(_context.Hymn, "HymnId", "HymnTitle", sacramentMeeting.FkSacramentSong); return(View(sacramentMeeting)); }
public async Task <IActionResult> Edit(int id, [Bind("MeetingID,Date,WardID,Presiding,Conducting,Opening_Hymn,Invocation,Ward_Business,Sacrament,Sacrament_Hymn,Closing_Hymn,Benediction")] Meeting meeting) { if (id != meeting.MeetingID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(meeting); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MeetingExists(meeting.MeetingID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Benediction"] = new SelectList(_context.Directory, "DirectoryID", "First_Name", meeting.Benediction); ViewData["Closing_Hymn"] = new SelectList(_context.Hymn, "HymnID", "HymnID", meeting.Closing_Hymn); ViewData["Conducting"] = new SelectList(_context.Directory, "DirectoryID", "First_Name", meeting.Conducting); ViewData["Invocation"] = new SelectList(_context.Directory, "DirectoryID", "First_Name", meeting.Invocation); ViewData["Opening_Hymn"] = new SelectList(_context.Hymn, "HymnID", "HymnID", meeting.Opening_Hymn); ViewData["Presiding"] = new SelectList(_context.Directory, "DirectoryID", "First_Name", meeting.Presiding); ViewData["Sacrament_Hymn"] = new SelectList(_context.Hymn, "HymnID", "HymnID", meeting.Sacrament_Hymn); ViewData["WardID"] = new SelectList(_context.Ward, "WardID", "Ward_Name", meeting.WardID); return(View(meeting)); }