Example #1
0
        /// <summary>
        /// Auto-save work on exit.
        /// </summary>
        /// <param name="e">Contains the arguments for the Exit event.</param>
        protected override void OnExit(ExitEventArgs e)
        {
            SaveBase saveWork = new SaveBase();

            saveWork.SaveWork();
            base.OnExit(e);
        }
        /// <summary>
        /// Constructor for ReassignmentPage
        /// </summary>
        /// <param name="c">The course</param>
        /// <param name="capacity">The new capacity to search for for a course.</param>
        /// <param name="type">The room type to search for.</param>
        public ReassignmentPage(Course c, string capacity, string type)
        {
            saveWork = new SaveBase();

            LinkedReassignments node = new LinkedReassignments();

            Type     = type;
            Capacity = capacity;

            var courses = from course in CourseRepo.Courses
                          where course.CourseName == c.CourseName && course.SectionNumber == c.SectionNumber
                          select course;

            foreach (Course course in courses)
            {
                course.RoomCapRequest = capacity;
            }

            c.RoomCapRequest = capacity;

            // initializes the head node
            node.steps          = 0;
            node.courseSteps    = c.CourseName;
            node.courseSections = c.SectionNumber;
            node.roomSteps      = c.RoomAssignment.ToString();
            node.next           = null;

            InitializeComponent();
            node        = recursiveReassign(node, c);
            viewModel   = new ReassignmentViewModel(node);
            DataContext = viewModel;

            if (viewModel.ReassignPath.Count() == 0)
            {
                PathDisplay.Text = "Couldn't reassign the course.\nPlease change the course time or manually reassign the room";
                RoomInfo.Text    = "";
            }
        }
Example #3
0
        public MainWindowViewModel()
        {
            SaveBase sb = new SaveBase();

            sb.SaveJson();
        }