Beispiel #1
0
        /// <summary>
        /// Inserts a new service record into the database.
        /// </summary>
        /// <param name="date"></param>
        /// <param name="title"></param>
        /// <param name="theme"></param>
        /// <param name="songleader"></param>
        /// <returns></returns>
        public bool addService(DateTime date, string title, string theme, Person songleader)
        {
            using (var db = new WSOApp())
            {
                Service newService = new Service
                {
                    Svc_DateTime    = date,
                    Title           = title,
                    Theme           = theme,
                    Songleader_ID   = songleader.Person_ID,
                    Notes           = null,
                    Organist_Conf   = 'N',
                    Pianist_Conf    = 'N',
                    Songleader_Conf = 'N',
                    Organist_ID     = null,
                    Pianist_ID      = null
                };
                db.Services.Add(newService);

                db.SaveChanges();
            }


            return(true);
        }
Beispiel #2
0
        public bool addEvent(int serviceid, int seqNum, int?eventType)
        {
            using (var db = new WSOApp())
            {
                ServiceEvent sEvent = new ServiceEvent
                {
                    Service_ID   = serviceid,
                    Seq_Num      = seqNum,
                    EventType_ID = eventType,
                    Notes        = null,
                    Confirmed    = 'N',
                    Person_ID    = null,
                    Ensemble_ID  = null,
                    Song_ID      = null
                };

                db.ServiceEvents.Add(sEvent);

                db.SaveChanges();
            }

            return(true);
        }