コード例 #1
0
        public IActionResult RemoveEntity(string valueToDelete)
        {
            int val = Int32.Parse(valueToDelete);

            switch (Rooms.CurrentEditType)
            {
            case 1:
                TableEntries.DeleteEntriesWhenTeacherDeleted(val);
                Teachers.TeachersList.RemoveAt(val);
                break;

            case 2:
                TableEntries.DeleteEntriesWhenClassDeleted(val);
                Classes.ClassesList.RemoveAt(val);
                break;

            case 3:
                Rooms.RoomList.RemoveAt(val);
                TableEntries.CurrentRoomId = 0;
                TableEntries.DeleteRoom(val);     //Deletes all data associated with this room from list of entries
                break;

            case 4:
                TableEntries.DeleteEntriesWhenCourseDeleted(val);
                Courses.CoursesList.RemoveAt(val);
                break;
            }
            return(View("Views/Home/Privacy.cshtml"));
        }
コード例 #2
0
        public IActionResult AddEntity(string value)
        {
            if (!String.IsNullOrEmpty(value))
            {
                switch (Rooms.CurrentEditType)
                {
                case 1:
                    if (!Teachers.GetTeachersList().Contains(value))     //Duplicates not allowed
                    {
                        Teachers.TeachersList.Add(value);
                    }
                    break;

                case 2:
                    if (!Classes.GetClassesList().Contains(value))     //Duplicates not allowed
                    {
                        Classes.ClassesList.Add(value);
                    }
                    break;

                case 3:
                    if (!Rooms.GetRoomsList().Contains(value))     //Duplicates not allowed
                    {
                        Rooms.RoomList.Add(value);
                    }
                    TableEntries.AppendRoom();
                    break;

                case 4:
                    if (!Courses.GetCoursesList().Contains(value))     //Duplicates not allowed
                    {
                        Courses.CoursesList.Add(value);
                    }
                    break;
                }
            }
            return(View("Views/Home/Privacy.cshtml"));
        }
コード例 #3
0
 public IActionResult Save()
 {
     TableEntries.SlotCollisionDetection();
     TableEntries.SaveCurrent();
     return(View("Views/Home/Index.cshtml"));
 }
コード例 #4
0
 public IActionResult EditTimetableEntry(string TimetableEntry)
 {
     TableEntries.CurrentEntrySelected = Int32.Parse(TimetableEntry);
     TableEntries.LoadSelected();
     return(View("Views/Home/TableEnterData.cshtml"));
 }