public ActionResult Create([Bind(Include = "GroupID,TimetableID")] GroupTimetable groupTimetable)
        {
            if (ModelState.IsValid)
            {
                db.CreateGroupTimetable(groupTimetable);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.GroupID     = new SelectList(db.GetGroup(), "GroupID", "GroupID", groupTimetable.GroupID);
            ViewBag.TimetableID = new SelectList(db.GetTimetable(), "TimeTableId", "Day", groupTimetable.TimetableID);
            return(View(groupTimetable));
        }
Esempio n. 2
0
        public GroupTimetableVM(GroupTimetable groupTimetable)
        {
            this.group_name = groupTimetable.GroupName;

            this.group_department = groupTimetable.GroupDepartment;

            this.group_employment = groupTimetable.GroupEmployment;

            this.group_tasks = groupTimetable.GroupTasks;

            this.group_advice = groupTimetable.GroupAdvice;

            this.group_tasks2 = groupTimetable.GroupTasks2;

            this.group_advice2 = groupTimetable.GroupAdvice2;

            this.group_answers = groupTimetable.Answers;

            this.group_recs = groupTimetable.Recs;
        }
Esempio n. 3
0
        private void button16_Click(object sender, EventArgs e)
        {
            int courseCounter = 1;

            foreach (var course in Courses)
            {
                StreamWriter writer = new StreamWriter($"{courseCounter}.html");
                foreach (var division in course.Divisions)
                {
                    foreach (var group in division.Groups)
                    {
                        GroupTimetable gtt = new GroupTimetable(group.Name);
                        for (int i = 0; i < group.Days.Capacity; i++)
                        {
                            gtt.AddElement(group.Days[i].ToString("dd MMM ddd").ToLower(),
                                           group.Lessons[i].GetExamInfo());
                        }
                        writer.Write(gtt.CreateTable());
                    }
                }
                courseCounter++;
                writer.Close();
            }
        }