Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Meeting,Conductor,OpeningSong,StartPrayer,SacramentSong,Sacrament,SpeakerOne,SpeakerTwo,OptionalSong,SpeakerThree,ClosingSong,EndPrayer")] PlannedMeeting plannedMeeting)
        {
            if (id != plannedMeeting.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(plannedMeeting);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PlannedMeetingExists(plannedMeeting.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(plannedMeeting));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,FirstName,LastName")] Member member)
        {
            if (id != member.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(member);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MemberExists(member.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(member));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,MeetingDate,ConductingLeader,OpeningSong,SacramentHymn,ClosingSong,IntermediateNumber,OpeningPrayer,ClosingPrayer")] SacramentMeeting sacramentMeeting)
        {
            if (id != sacramentMeeting.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sacramentMeeting);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SacramentMeetingExists(sacramentMeeting.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(sacramentMeeting));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,DateOfMeeting,OpeningPrayer,ConductingLeader,OpeningHymn,SacramentHymn,ClosingHymn,ClosingPrayer")] Message message)
        {
            if (id != message.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(message);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MessageExists(message.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(message));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,MeetingID,SpeakerName,Subject,Block,Order")] Speaker speaker)
        {
            if (id != speaker.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(speaker);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SpeakerExists(speaker.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index), new { meetingId = speaker.MeetingID }));
            }
            ViewData["MeetingID"] = speaker.MeetingID;
            return(View(speaker));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Edit(int id, [Bind("SpeakerID,MeetingID,SpeakerName,Topic")] 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("Details", "Meetings", new { id = speaker.MeetingID }));
            }
            ViewData["MeetingID"] = speaker.MeetingID;
            return(RedirectToAction("Details", "Meetings", new { id = speaker.MeetingID }));
        }
        public async Task <IActionResult> Edit(int id, [Bind("SpeakersID,Speaker1,Speaker2,Speaker3")] Speakers speakers)
        {
            if (id != speakers.SpeakersID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(speakers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SpeakersExists(speakers.SpeakersID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(speakers));
        }
Ejemplo n.º 8
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,SpeakerID,Topic,SMPID")] Speakers speakers)
        {
            if (id != speakers.ID)
            {
                return(NotFound());
            }

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

            ViewData["SpeakerID"] = new SelectList(_context.Member, "ID", "ID", speakers.SpeakerID);
            ViewData["SMPID"]     = new SelectList(_context.SMP, "ID", "ID", speakers.SMPID);
            return(View(speakers));
        }
Ejemplo n.º 9
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,MeetingDate,Conducting,Subjects")] 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("HymnsID,OpeningHymn,OpeningHyNumber,SacramentHymn,SacrHyNumber,ClosingHymn,ClosingNumber")] Hymns hymns)
        {
            if (id != hymns.HymnsID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(hymns);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HymnsExists(hymns.HymnsID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(hymns));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Value")] Setting setting)
        {
            if (id != setting.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(setting);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SettingExists(setting.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(setting));
        }
Ejemplo n.º 12
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,MeetingDate,Conducting,Presiding,Invocation,Benediction,OpeningHymn,SacramentHymn,ClosingHymn,Topic")] 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("PrayersID,OpeningPrayers,ClosingPrayers")] Prayers prayers)
        {
            if (id != prayers.PrayersID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(prayers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PrayersExists(prayers.PrayersID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(prayers));
        }
Ejemplo n.º 14
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,BishopID,FirstID,SecondID")] Ward ward)
        {
            if (id != ward.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(ward);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WardExists(ward.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            var members = _context.Member.Select(s => new
            {
                ID       = s.ID,
                FullName = string.Format("{0} {1}", s.FirstName, s.LastName)
            }).ToList();

            ViewData["BishopID"] = new SelectList(members, "ID", "FullName", ward.BishopID);
            ViewData["FirstID"]  = new SelectList(members, "ID", "FullName", ward.FirstID);
            ViewData["SecondID"] = new SelectList(members, "ID", "FullName", ward.SecondID);
            return(View(ward));
        }
Ejemplo n.º 15
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,WardID,PresidingID,ConductingID,Date,OpeningHymnID,SacramentHymnID,IntermediateHymnID,ClosingHymnID,InvocationID,BenedictionID")] SMP sMP)
        {
            if (id != sMP.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sMP);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SMPExists(sMP.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BenedictionID"]      = new SelectList(_context.Member, "ID", "ID", sMP.BenedictionID);
            ViewData["ClosingHymnID"]      = new SelectList(_context.Hymn, "ID", "ID", sMP.ClosingHymnID);
            ViewData["ConductingID"]       = new SelectList(_context.Member, "ID", "ID", sMP.ConductingID);
            ViewData["IntermediateHymnID"] = new SelectList(_context.Hymn, "ID", "ID", sMP.IntermediateHymnID);
            ViewData["InvocationID"]       = new SelectList(_context.Member, "ID", "ID", sMP.InvocationID);
            ViewData["OpeningHymnID"]      = new SelectList(_context.Hymn, "ID", "ID", sMP.OpeningHymnID);
            ViewData["PresidingID"]        = new SelectList(_context.Member, "ID", "ID", sMP.PresidingID);
            ViewData["SacramentHymnID"]    = new SelectList(_context.Hymn, "ID", "ID", sMP.SacramentHymnID);
            ViewData["WardID"]             = new SelectList(_context.Ward, "ID", "ID", sMP.WardID);
            return(View(sMP));
        }