コード例 #1
0
ファイル: Program.cs プロジェクト: DeniooRDR/AutoSchool.CMD
        private static (DateTime Begin, DateTime End, TimeClasses TimeClasses) EnterTimeTable()
        {
            Console.Write("Введите упражнения ");
            var name = Console.ReadLine();

            var begin = ParseDateTime("Начало занятия ");
            var end   = ParseDateTime("Конец занятия ");

            var timeClassses = new TimeClasses(name);

            return(begin, end, timeClassses);
        }
コード例 #2
0
        public void Add(TimeClasses timeClasses, DateTime begin, DateTime end)
        {
            var act = TimeClasses.SingleOrDefault(a => a.NameClasses == timeClasses.NameClasses);

            if (act == null)
            {
                TimeClasses.Add(timeClasses);

                var timeTable = new TimeTable(begin, end, timeClasses, user);
                TimeTables.Add(timeTable);
            }
            else
            {
                var timeTable = new TimeTable(begin, end, timeClasses, user);
                TimeTables.Add(timeTable);
            }
            Save();
        }