예제 #1
0
 public void AddGroup(YearOfStudy year, Specialization spec)
 {
     var group = Project.Schedule.AddNewGroup(year, spec);
     var table = Tables.First(t => t.YearOfStudy == year);
     var index = Tables.IndexOf(table);
     Tables[index].AddGroup(group);
 }
예제 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            YearOfStudy yearOfStudy = db.YearOfStudies.Find(id);

            db.YearOfStudies.Remove(yearOfStudy);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #3
0
 public void RemoveYearOfStudy(YearOfStudy year)
 {
     YearsOfStudy.Remove(year);
     foreach (var @group in Groups.Where(@group => @group.YearOfStudy == year))
     {
         @group.YearOfStudy = null;
     }
 }
        public void AddGroup(YearOfStudy year, Specialization spec)
        {
            var group = Project.Schedule.AddNewGroup(year, spec);
            var table = Tables.First(t => t.YearOfStudy == year);
            var index = Tables.IndexOf(table);

            Tables[index].AddGroup(group);
        }
예제 #5
0
        public Group AddNewGroup(YearOfStudy year, Specialization spec)
        {
            var group = new Group {
                Name = "Новая группа", YearOfStudy = year, Specialization = spec
            };

            AddGroup(group);
            return(group);
        }
예제 #6
0
 public ActionResult Edit([Bind(Include = "YearOfStudyID,StudyYear")] YearOfStudy yearOfStudy)
 {
     if (ModelState.IsValid)
     {
         db.Entry(yearOfStudy).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(yearOfStudy));
 }
예제 #7
0
        public GroupClasses(Schedule schedule, YearOfStudy yearOfStudy) : base(schedule)
        {
            YearOfStudy = yearOfStudy;
            SetSubjects();
            SetSubjectIndexes();
//            CreateTable();
            CreateTableDictionary();
//            SetClasses();
            SetClassesDictionary();
        }
예제 #8
0
        public ActionResult Create([Bind(Include = "YearOfStudyID,StudyYear")] YearOfStudy yearOfStudy)
        {
            if (ModelState.IsValid)
            {
                db.YearOfStudies.Add(yearOfStudy);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(yearOfStudy));
        }
예제 #9
0
        /// <summary>
        /// Add new Specialization and Group to given YearOfStudy
        /// </summary>
        /// <param name="year"></param>
        public void AddNewSG(YearOfStudy year)
        {
            var spec = new Specialization {
                Name = "Новая специальность"
            };
            var group = new Group {
                Name = "Новая группа", YearOfStudy = year, Specialization = spec
            };

            AddSpecialization(spec);
            AddGroup(group);
        }
예제 #10
0
 private void OnYearOfStudyChanged()
 {
     if (YearOfStudy == null)
     {
         return;
     }
     TableHeader   = YearOfStudy.ToString();
     _classesTable = Project.ClassesSchedule.GetClassesTable(YearOfStudy);
     _titlesMarkup = new TitlesMarkup(_classesTable.Groups);
     InitializeTitles();
     InitLectureCards();
 }
예제 #11
0
        private void OnYearOfStudyChanged()
        {
            if (YearOfStudy == null)
            {
                return;
            }
            TableHeader = YearOfStudy.ToString();

            _groupClasses = new GroupClasses(Project.Schedule, YearOfStudy);
            _titlesMarkup = new TitlesMarkup(_groupClasses.Subjects);
            InitializeTitles();
            InitLectureCards();
        }
예제 #12
0
        // GET: YearOfStudies/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            YearOfStudy yearOfStudy = db.YearOfStudies.Find(id);

            if (yearOfStudy == null)
            {
                return(HttpNotFound());
            }
            return(View(yearOfStudy));
        }
예제 #13
0
        /// <summary>
        /// Add new YearOfStudy, Specialization and Group
        /// </summary>
        public Group AddYSG()
        {
            var year = new YearOfStudy {
                Name = "Новый курс"
            };
            var spec = new Specialization {
                Name = "Специальность"
            };
            var group = new Group {
                Name = "Группа", YearOfStudy = year, Specialization = spec
            };

            AddYearOfStudy(year);
            AddSpecialization(spec);
            AddGroup(group);
            return(group);
        }
예제 #14
0
 public void AddSpecialization(YearOfStudy yearOfStudy)
 {
     Project.Schedule.AddNewSG(yearOfStudy);
     UpdateAll();
 }
예제 #15
0
파일: Schedule.cs 프로젝트: GorelH/Schedule
 /// <summary>
 /// Add new Specialization and Group to given new YearOfStudy
 /// </summary>
 /// <param name="year"></param>
 public void AddYSG(YearOfStudy year)
 {
     var spec = new Specialization { Name = "Специальность" };
     var group = new Group { Name = "Группа", YearOfStudy = year, Specialization = spec };
     AddYearOfStudy(year);
     AddSpecialization(spec);
     AddGroup(group);
 }
예제 #16
0
 public void RemoveYearOfStudy(YearOfStudy yearOfStudy)
 {
     Project.Schedule.RemoveYearOfStudy(yearOfStudy);
     Tables.Remove(Tables.First(t => t.YearOfStudy == yearOfStudy));
 }
예제 #17
0
파일: Schedule.cs 프로젝트: GorelH/Schedule
 //        public void CreateNewTables()
 //        {
 //            Tables.Clear();
 //            foreach (var yearOfStudy in YearsOfStudy)
 //            {
 //                Tables.Add(new ClassesTable(this, yearOfStudy));
 //            }
 //        }
 public bool HasGroups(YearOfStudy year)
 {
     return Groups.Any(g => g.YearOfStudy == year);
 }
예제 #18
0
파일: Schedule.cs 프로젝트: GorelH/Schedule
 /// <summary>
 /// Add new YearOfStudy, Specialization and Group
 /// </summary>
 public Group AddYSG()
 {
     var year = new YearOfStudy { Name = "Новый курс" };
     var spec = new Specialization { Name = "Специальность" };
     var group = new Group { Name = "Группа", YearOfStudy = year, Specialization = spec };
     AddYearOfStudy(year);
     AddSpecialization(spec);
     AddGroup(group);
     return group;
 }
예제 #19
0
//        public void AddLecturer(object param)
//        {
//            if (AddLecturerDelegate != null)
//            {
//                AddLecturerDelegate(param as Lecturer);
//            }
//        }
//
//        public void AddSubject(object param)
//        {
//            if (AddSubjectDelegate != null)
//            {
//                AddSubjectDelegate(param as Subject);
//            }
//        }
//
//        public void RemoveClassRecord(object param)
//        {
//            if (RemoveClassRecordDelegate != null)
//            {
//                RemoveClassRecordDelegate(param as ClassRecord);
//            }
//        }
//
        public void RemoveYearOfStudy(YearOfStudy yearOfStudy)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            _tableController.RemoveYearOfStudy(yearOfStudy);
            Mouse.OverrideCursor = Cursors.Arrow;
        }
 public void RemoveYearOfStudy(YearOfStudy yearOfStudy)
 {
     Project.Schedule.RemoveYearOfStudy(yearOfStudy);
     Tables.Remove(Tables.First(t => t.YearOfStudy == yearOfStudy));
 }
예제 #21
0
 public sYearOfStudy(YearOfStudy yearOfStudy) : base(yearOfStudy)
 {
 }
예제 #22
0
 public void AddSpecialization(YearOfStudy yearOfStudy)
 {
     Mouse.OverrideCursor = Cursors.Wait;
     _tableController.AddSpecialization(yearOfStudy);
     Mouse.OverrideCursor = Cursors.Arrow;
 }
예제 #23
0
//        public void CreateNewTables()
//        {
//            Tables.Clear();
//            foreach (var yearOfStudy in YearsOfStudy)
//            {
//                Tables.Add(new ClassesTable(this, yearOfStudy));
//            }
//        }

        public bool HasGroups(YearOfStudy year)
        {
            return(Groups.Any(g => g.YearOfStudy == year));
        }
예제 #24
0
 public void AddYearOfStudy(YearOfStudy year)
 {
     YearsOfStudy.Add(year);
 }
예제 #25
0
파일: Schedule.cs 프로젝트: GorelH/Schedule
 public void AddYearOfStudy(YearOfStudy year)
 {
     YearsOfStudy.Add(year);
 }
예제 #26
0
 public void AddSpecialization(YearOfStudy yearOfStudy)
 {
     UpdateStatus("Создание новой специальности...");
     Mouse.OverrideCursor = Cursors.Wait;
     _tableController.AddSpecialization(yearOfStudy);
     Mouse.OverrideCursor = Cursors.Arrow;
     UpdateStatus("Новая специальность создана");
 }
예제 #27
0
 //        public void AddLecturer(object param)
 //        {
 //            if (AddLecturerDelegate != null)
 //            {
 //                AddLecturerDelegate(param as Lecturer);
 //            }
 //        }
 //
 //        public void AddSubject(object param)
 //        {
 //            if (AddSubjectDelegate != null)
 //            {
 //                AddSubjectDelegate(param as Subject);
 //            }
 //        }
 //
 //        public void RemoveClassRecord(object param)
 //        {
 //            if (RemoveClassRecordDelegate != null)
 //            {
 //                RemoveClassRecordDelegate(param as ClassRecord);
 //            }
 //        }
 //
 public void RemoveYearOfStudy(YearOfStudy yearOfStudy)
 {
     UpdateStatus("Удаление курса...");
     Mouse.OverrideCursor = Cursors.Wait;
     _tableController.RemoveYearOfStudy(yearOfStudy);
     Mouse.OverrideCursor = Cursors.Arrow;
     UpdateStatus("Курс удален");
 }
 public void AddSpecialization(YearOfStudy yearOfStudy)
 {
     Project.Schedule.AddNewSG(yearOfStudy);
     UpdateAll();
 }
예제 #29
0
파일: Schedule.cs 프로젝트: GorelH/Schedule
 public void RemoveYearOfStudy(YearOfStudy year)
 {
     YearsOfStudy.Remove(year);
     foreach (var @group in Groups.Where(@group => @group.YearOfStudy == year))
     {
         @group.YearOfStudy = null;
     }
 }
예제 #30
0
        private static void LoadYearsOfStudy(Schedule schedule, SQLiteCommand command)
        {
            command.CommandText = "select * from years_of_study";

            var reader = command.ExecuteReader();
            while (reader.Read())
            {
                var year = new YearOfStudy {Name = (string) reader["name"]};
                schedule.YearsOfStudy.Add(year);
            }
            reader.Close();
        }
예제 #31
0
파일: Schedule.cs 프로젝트: GorelH/Schedule
 public Group AddNewGroup(YearOfStudy year, Specialization spec)
 {
     var group = new Group { Name = "Новая группа", YearOfStudy = year, Specialization = spec };
     AddGroup(group);
     return group;
 }