Пример #1
0
        private bool CheckTimeSpeakerAdd(DateTime f, DateTime t, int confID)
        {
            RelationshipQuery relaQuery = new RelationshipQuery();
            List <Speaker>    speakers  = relaQuery.getSpeakers(confID);

            return(CheckTime(f, t, speakers, confID));
        }
Пример #2
0
        private bool CheckTimeSpeakerSet(DateTime f, DateTime t, int speakerID, int confID)
        {
            RelationshipQuery relaQuery = new RelationshipQuery();
            List <Speaker>    speakers  = relaQuery.getSpeakers(confID);

            speakers = speakers.Where(Speaker => (Speaker.ID != speakerID)).ToList();
            return(CheckTime(f, t, speakers, confID));
        }
Пример #3
0
        public void Delete(int confID)
        {
            List <Conference> confs = getConferences();
            Conference        conf  = confs.Where(Conference => Conference.ID == confID).First();

            if (conf != null)
            {
                RelationshipQuery relaQuery = new RelationshipQuery();
                relaQuery.DeleteConference(conf.ID);

                confs.Remove(conf);
                try
                {
                    using (StreamWriter sr = new StreamWriter(new FileStream(PATH, FileMode.Create, FileAccess.Write), Encoding.GetEncoding("windows-1250")))
                    {
                        foreach (Conference c in confs)
                        {
                            sr.WriteLine("{0};{1};{2};{3};{4};{5};{6}", c.ID, c.Name, c.Date.ToString("yyyy-MM-dd"), c.From.ToString("HH:mm"), c.To.ToString("HH:mm"), c.Venue, c.Logo);
                        }
                    }
                }
                catch { }
            }
        }
Пример #4
0
        public void Delete(int speakerID)
        {
            List <Speaker> speakers = getSpeakers();
            Speaker        speaker  = speakers.Where(Speaker => Speaker.ID == speakerID).First();

            if (speaker != null)
            {
                RelationshipQuery relaQuery = new RelationshipQuery();
                relaQuery.DeleteSpeaker(speaker.ID);

                speakers.Remove(speaker);
                try
                {
                    using (StreamWriter sr = new StreamWriter(new FileStream(PATH, FileMode.Create, FileAccess.Write), Encoding.GetEncoding("windows-1250")))
                    {
                        foreach (Speaker s in speakers)
                        {
                            sr.WriteLine("{0};{1};{2};{3};{4}", s.ID, s.Name, s.Title, s.From.ToString("HH:mm"), s.To.ToString("HH:mm"));
                        }
                    }
                }
                catch { }
            }
        }