GetNextEvent() public static méthode

public static GetNextEvent ( ) : Event
Résultat Event
Exemple #1
0
        public static List <Session> GetAllSessions()
        {
            var ctx = new ICCData();


            int eId = Event.GetNextEvent().Id;



            var sessions = from s in ctx.Sessions
                           where s.EventId == eId && s.IsApproved
                           select s;

            var sessions1 = ctx.Sessions.Where(sess => sess.EventId == eId);

            return(sessions.ToList());
        }
Exemple #2
0
        public static List <Session> GetAcceptedSessions()
        {
            var ctx = new ICCData();

            int   eId = 0;
            Event ev  = Event.GetNextEvent();

            if (ev != null)
            {
                eId = ev.Id;
            }


            var sessions = from s in ctx.Sessions
                           where s.IsApproved && s.EventId == eId
                           //let SpeakerName = s.Speakers.
                           select s;

            return(sessions.ToList());
        }
Exemple #3
0
        public static void Propose(string Email, string SessionTitle, string SessionAbstract)
        {
            var ctx = new ICCData();

            int eId = Event.GetNextEvent().Id;

            var session = new Session()
            {
                Title = SessionTitle, Abstract = SessionAbstract, EventId = eId
            };

            ctx.Sessions.InsertOnSubmit(session);
            ctx.SubmitChanges();

            var user = ctx.Users.Where(u => string.Compare(u.Email, Email, true) == 0).FirstOrDefault();

            Speaker speak = new Speaker()
            {
                SessionId = session.Id, UserId = user.Id
            };

            ctx.Speakers.InsertOnSubmit(speak);
            ctx.SubmitChanges();
        }