public async Task <IActionResult> Create([Bind("ID,MeetingDate,Conducting,OpeningHymn,Invocation,SacramentHymn,ClosingHymn,Benediction")] Meeting meeting)
        {
            if (ModelState.IsValid)
            {
                _context.Add(meeting);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(meeting));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("ID,LastName,FirstName,Subject")] Speaker speaker)
        {
            if (ModelState.IsValid)
            {
                _context.Add(speaker);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(speaker));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("PrayerTypeId,TypePrayer")] PrayerType prayerType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(prayerType);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(prayerType));
        }
        public async Task <IActionResult> Create([Bind("TopicId,TopicTitle")] Topic topic)
        {
            if (ModelState.IsValid)
            {
                _context.Add(topic);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(topic));
        }
Пример #5
0
        public async Task <IActionResult> Create([Bind("Id,Date,Conductor,OpeningHymn,ClosingHymn,SacramentHymn,IntermediateSong,OpeningPrayer,ClosingPrayer,Speakers")] Sunday sunday)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sunday);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sunday));
        }
        public async Task <IActionResult> Create([Bind("CallingId,Bishopric,OtherLeader,CallingName")] Calling calling)
        {
            if (ModelState.IsValid)
            {
                _context.Add(calling);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(calling));
        }
Пример #7
0
        public async Task <IActionResult> Create([Bind("ID,Date,Conducting,OpeningSong,OpeningPrayer,SacramentSong,FirstSpeaker,SecondSpeaker,IntermediateSong,ThirdSpeaker,ClosingSong,ClosingPrayer")] SacProgram sacProgram)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sacProgram);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sacProgram));
        }
        public async Task <IActionResult> Create([Bind("HymnTypeId,HymnType1")] HymnType hymnType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(hymnType);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(hymnType));
        }
Пример #9
0
        public async Task <IActionResult> Create([Bind("SpeakerID,SundayID,Name,Subject")] Speaker speaker)
        {
            if (ModelState.IsValid)
            {
                _context.Add(speaker);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SundayID"] = new SelectList(_context.Sunday, "Id", "Date", speaker.SundayID);
            return(View(speaker));
        }
        public async Task <IActionResult> Create([Bind("WardMemberId,Fname,Lname,FkCallingId")] WardMember wardMember)
        {
            if (ModelState.IsValid)
            {
                _context.Add(wardMember);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewData["FkCallingId"] = new SelectList(_context.Calling, "CallingId", "CallingName", wardMember.FkCallingId);
            return(View(wardMember));
        }
Пример #11
0
        public async Task <IActionResult> Create([Bind("MeetingID,MeetingDate,ConductingLeader,OpeningSong,SacramentSong,IntermediateSong,ClosingSong,OpeningPrayer,ClosingPrayer")] Meeting meeting)
        {
            if (ModelState.IsValid)
            {
                _context.Add(meeting);
                await _context.SaveChangesAsync();

                //return RedirectToAction(nameof(Index));
                return(Redirect("../Speakers/Create/" + meeting.MeetingID));
            }
            return(View(meeting));
        }
        public async Task <IActionResult> Create([Bind("Id,Date,Conducting,OpenHymn,OpenPrayer,SacramentHymn,IntermediateHymn,CloseHymn,ClosePrayer")] Sacrament sacrament)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sacrament);
                await _context.SaveChangesAsync();

                //return RedirectToAction("Edit", "Sacraments", new { id = sacrament.Id });
                return(RedirectToAction(nameof(Edit), new { id = sacrament.Id }));
            }
            return(View(sacrament));
        }
Пример #13
0
        public async Task <IActionResult> Create([Bind("DirectoryID,WardID,First_Name,Last_Name,Age,Sex,Calling")] Directory directory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(directory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["WardID"] = new SelectList(_context.Ward, "WardID", "Ward_Name", directory.WardID);
            return(View(directory));
        }
Пример #14
0
        public async Task <IActionResult> Create([Bind("HymnId,HymnTitle,HymnNum,FkHymnType")] Hymn hymn)
        {
            if (ModelState.IsValid)
            {
                _context.Add(hymn);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewData["FkHymnType"] = new SelectList(_context.HymnType, "HymnTypeId", "HymnType1", hymn.FkHymnType);
            return(View(hymn));
        }
        public async Task <IActionResult> Create([Bind("PrayerId,FkPrayerType,PrayerDate,FkWardMemberId")] Prayer prayer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(prayer);
                await _context.SaveChangesAsync();

                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> Create([Bind("MeetingSpeakerId,MeetingId,SpeakerId")] MeetingSpeaker meetingSpeaker)
        {
            if (ModelState.IsValid)
            {
                _context.Add(meetingSpeaker);
                await _context.SaveChangesAsync();

                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));
        }
Пример #17
0
        public async Task <IActionResult> Create([Bind("AgendaID,MeetingID,Section,MemberID,HymnID,Special_Event_Text,Notes,Subject")] Agenda agenda)
        {
            if (ModelState.IsValid)
            {
                _context.Add(agenda);
                await _context.SaveChangesAsync();

                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> Create([Bind("SpeakerId,SpeakerDate,FkWardMember,FkTopic,FkSpeakerType")] Speaker speaker)
        {
            if (ModelState.IsValid)
            {
                _context.Add(speaker);
                await _context.SaveChangesAsync();

                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));
        }
Пример #19
0
        public async Task <IActionResult> Create([Bind("SpeakerID,MeetingID,SpeakerName,Subject")] Speaker speaker, string submit)
        {
            if (ModelState.IsValid)
            {
                _context.Add(speaker);
                await _context.SaveChangesAsync();

                if (submit == "Add Another")
                {
                    return(Redirect("../Create/" + speaker.MeetingID));
                }
                else
                {
                    return(Redirect("../../Meetings/Details/" + speaker.MeetingID));
                }
            }
            return(View(speaker));
        }
Пример #20
0
        public async Task <IActionResult> Create([Bind("MeetingID,Date,WardID,Presiding,Conducting,Opening_Hymn,Invocation,Ward_Business,Sacrament,Sacrament_Hymn,Closing_Hymn,Benediction")] Meeting meeting)
        {
            if (ModelState.IsValid)
            {
                _context.Add(meeting);
                await _context.SaveChangesAsync();

                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));
        }
        public async Task <IActionResult> Create([Bind("SacramentMeetingId,SacramentDate,FkConducting,FkMusicLeader,FkMusicPlayer,FkMeetingTopic,BabyBlessing,Confirmation,FkOpenPrayer,FkOpenSong,FkSacramentSong,FkWardBusiness,FkYouthSpeaker,FkFirstSpeaker,FkSecondSpeaker,FkIntermediateSong,FkClosingSong,FkClosingPrayer")] SacramentMeeting sacramentMeeting)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sacramentMeeting);
                await _context.SaveChangesAsync();

                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));
        }