public async Task <IActionResult> Create([Bind("ID,MeetingID,SpeakerName,SpeakerTopic")] SpeakerAssignment speakerAssignment) { speakerAssignment.ID = 0; if (ModelState.IsValid) { _context.Add(speakerAssignment); await _context.SaveChangesAsync(); var meeting = _context.Meeting.SingleOrDefaultAsync(s => s.ID == speakerAssignment.MeetingID); return(RedirectToAction(nameof(Index), new { id = speakerAssignment.MeetingID })); } ViewData["MeetingID"] = speakerAssignment.MeetingID; return(View(speakerAssignment)); }
// GET: SpeakerAssignments/Create public IActionResult Create(int?id) { var speakerAssignment = new SpeakerAssignment(); speakerAssignment.MeetingID = id.Value; ViewData["MeetingID"] = id; var meeting = _context.Meeting.SingleOrDefaultAsync(s => s.ID == id); if (meeting == null) { return(NotFound()); } speakerAssignment.Meeting = new Meeting(); return(View(speakerAssignment)); }
public SpeakerChangeAction(IList <IFileElement> elements, bool active, bool random, SpeakerAssignment assignment) { m_Elements = elements; m_OldActive = new List <bool>(); m_OldRandom = new List <bool>(); m_OldAssignment = new List <SpeakerAssignment>(); m_OldBalance = new List <bool>(); for (int i = 0; i < m_Elements.Count; ++i) { m_OldActive.Add(elements[i].Effects.SpeakerAssignment.Active); m_OldRandom.Add(elements[i].Effects.SpeakerAssignment.Random); m_OldAssignment.Add(elements[i].Effects.SpeakerAssignment.Assignment); m_OldBalance.Add(elements[i].Effects.Balance.Active); } m_NewActive = active; m_NewRandom = random; m_NewAssignment = assignment; }
public AllFileElementsSpeakerChangeAction(IGeneralElementContainer container, bool active, bool random, SpeakerAssignment assignment) { m_FileElements = container.GetFileElements(); m_OldActives = new List <bool>(); m_OldRandoms = new List <bool>(); m_OldBalances = new List <bool>(); m_OldAssignments = new List <SpeakerAssignment>(); foreach (IFileElement element in m_FileElements) { ISpeakerAssignmentEffect effect = element.Effects.SpeakerAssignment; m_OldActives.Add(effect.Active); m_OldRandoms.Add(effect.Random); m_OldAssignments.Add(effect.Assignment); m_OldBalances.Add(element.Effects.Balance.Active); } m_NewActive = active; m_NewRandom = random; m_NewAssignment = assignment; }
public static void Initialize(SacrementPlannerContext context) { context.Database.EnsureCreated(); // Look for any students. if (context.Meeting.Any()) { return; // DB has been seeded } var meeting = new Meeting[] { new Meeting { MeetingDate = DateTime.Parse("2020-08-02"), Presiding = "Bishop John Smith", Conducting = "Greg Brown", OpeningHymn = "17. Awake, Ye Saints of God, Awake!", Invocation = "Susan Wright", SacamentHymn = "169. As Now We Take the Sacrament", ClosingHymn = "2. The Spirit of God", Benediction = "Carson Wright" }, new Meeting { MeetingDate = DateTime.Parse("2020-08-09"), Presiding = "Bishop John Smith", Conducting = "John Smith", OpeningHymn = "164. Great God, to Thee My Evening Song", Invocation = "Todd Williams", SacamentHymn = "181. Jesus of Nazareth, Savior and King", ClosingHymn = "134. I Believe in Christ", Benediction = "Amy Williams" }, new Meeting { MeetingDate = DateTime.Parse("2020-08-16"), Presiding = "Bishop John Smith", Conducting = "Henry Johnson", OpeningHymn = "211. While Shepherds Watched Their Flocks", Invocation = "Mike Jones", SacamentHymn = "183. In Remembrance of Thy Suffering", ClosingHymn = "97. Lead, Kindly Light", Benediction = "Trish Young" }, new Meeting { MeetingDate = DateTime.Parse("2020-08-23"), Presiding = "1st Counselor Greg Brown", Conducting = "Greg Brown", OpeningHymn = "5. High on the Mountain Top", Invocation = "Jeff Miller", SacamentHymn = "188. Thy Will, O Lord, Be Done", ClosingHymn = "26. Joseph Smith’s First Prayer", Benediction = "Beth Miller" }, new Meeting { MeetingDate = DateTime.Parse("2020-08-30"), Presiding = "Bishop John Smith", Conducting = "Greg Brown", OpeningHymn = "67. Glory to God on High", Invocation = "Spencer Wilson", SacamentHymn = "193. I Stand All Amazed", ClosingHymn = "227. There Is Sunshine in My Soul Today", Benediction = "Jessica Moore" }, new Meeting { MeetingDate = DateTime.Parse("2020-09-06"), Presiding = "Bishop John Smith", Conducting = "John Smith", OpeningHymn = "60. Battle Hymn of the Republic", Invocation = "Jim Taylor", SacamentHymn = "190. In Memory of the Crucified", ClosingHymn = "241. Count Your Blessings", Benediction = "Madison Taylor" }, new Meeting { MeetingDate = DateTime.Parse("2020-10-04"), SpecialNotes = "General Conference" } }; foreach (Meeting m in meeting) { context.Meeting.Add(m); } context.SaveChanges(); var meetingSpeakers = new SpeakerAssignment[] { new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-02")).ID, SpeakerName = "Hailey Thompson", SpeakerTopic = "Holy Ghost" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-09")).ID, SpeakerName = "Mark Jackson", SpeakerTopic = "Repentance" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-16")).ID, SpeakerName = "Janice White", SpeakerTopic = "Prayer" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-23")).ID, SpeakerName = "Bruce Harris", SpeakerTopic = "Temples" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-30")).ID, SpeakerName = "Kim Martin", SpeakerTopic = "Prophets" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-09-06")).ID, SpeakerName = "Don Clark", SpeakerTopic = "Service" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-02")).ID, SpeakerName = "Brenda Lewis", SpeakerTopic = "Love" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-09")).ID, SpeakerName = "Barbra Walker", SpeakerTopic = "Forgiveness" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-16")).ID, SpeakerName = "Tim Robinson", SpeakerTopic = "Prayer" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-23")).ID, SpeakerName = "Whittney Anderson", SpeakerTopic = "Baptism" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-30")).ID, SpeakerName = "Jonah Thomas", SpeakerTopic = "Priesthood Keys" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-09-06")).ID, SpeakerName = "Miranda Baker", SpeakerTopic = "Plan of Salvation" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-02")).ID, SpeakerName = "Tony Campbell", SpeakerTopic = "Faith" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-09")).ID, SpeakerName = "Kate Roberts", SpeakerTopic = "Enduring to the end" }, new SpeakerAssignment { MeetingID = meeting.Single(m => m.MeetingDate == DateTime.Parse("2020-08-16")).ID, SpeakerName = "Mickayla Hall", SpeakerTopic = "Hope" } }; foreach (SpeakerAssignment ms in meetingSpeakers) { context.SpeakerAssignment.Add(ms); } context.SaveChanges(); }
public void SetData(bool active, bool random, SpeakerAssignment assignment) { m_NewActive = active; m_NewRandom = random; m_NewAssignment = assignment; }
public SpeakerAssignmentEffect(System.Xml.XmlReader reader) : base("Speakers", reader) { Assignment = (SpeakerAssignment)reader.GetIntegerAttributeOrDefault("Speakers_Assignment", (int)SpeakerAssignment.Default); }
public SpeakerAssignmentEffect() : base("Speakers") { Assignment = SpeakerAssignment.Default; }