Example #1
0
 private static void DisplayAddAssignment(List<Assignments> assignmentList)
        {

            Assignments newAssignments = new Assignments();
            DisplayHeader("Add New Assignment");
            Console.Write("Enter Assignemnt Name: ");
            newAssignments.AssignmentName = Console.ReadLine();

            Console.Write("Enter Assignment's Course Name: ");
            Enum.TryParse(Console.ReadLine(), out Assignments.NMCCourses nmcCourses);
            newAssignments.CourseName = nmcCourses;

            Console.Write("Enter Assignment Due Date and Time (yyyy, mm, dd hh:mm:ss AM/PM): ");
            DateTime.TryParse(Console.ReadLine(), out DateTime dueDate);
            newAssignments.DueDate = dueDate;

            Console.Write("Assignment Grade: ");
            double.TryParse(Console.ReadLine(), out double score);
            newAssignments.Score = score;

            assignmentList.Add(newAssignments);

            DisplayContinuePrompt();
        }
Example #2
0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace HomeworkTracker5000
{
    class Program
    {
        //  Quenton Buss
        //  Capstone - Homework Tracker
        //  CIT110 M/W 8:00
        //  09 Dec 2018


        //string dataInfo;
        static void Main(string[] args)
        {
            DisplayOpeningScreen();
            DisplayMenu();
            DisplayClosingScreen();
        }
        static void DisplayMenu()
        {
            string dataPath = @"/Users/quentonbuss/Desktop/HomeworkTracker5000/HomeworkTracker5000/Data/Data.csv";
            string menuChoice;
            bool exiting = false;

            #region Initialize OBJs
            //initialize 
            Assignments Qt13 = new Assignments();
            Qt13.AssignmentName = "Quick Task 13";
            Qt13.CourseName = Assignments.NMCCourses.EET102;
            Qt13.DueDate = new DateTime(2018, 12, 05);
            Qt13.Score = 100;

            Assignments Exam1 = new Assignments();
            Exam1.AssignmentName = "Exam 1 of 2";
            Exam1.CourseName = Assignments.NMCCourses.MTH121;
            Exam1.DueDate = new DateTime(2018, 12, 12);
            Exam1.Score = 0;

            Assignments Exam2 = new Assignments();
            Exam2.AssignmentName = "Exam 2 of 2";
            Exam2.CourseName = Assignments.NMCCourses.MTH121;
            Exam2.DueDate = new DateTime(2018, 12, 14);
            Exam2.Score = 0;
            #endregion

            //Add Items to list
            List<Assignments> assignmentList = new List<Assignments>();
            assignmentList.Add(Qt13);
            assignmentList.Add(Exam1);
            assignmentList.Add(Exam2);

            while (!exiting)
            {
                DisplayHeader("Main Menu");

                Console.WriteLine("\tA) Display all Homework");
                Console.WriteLine("\tB) Add an Assignment");
                Console.WriteLine("\tC) Delete an Assignment");
                Console.WriteLine("\tD) Edit Assignment");
                Console.WriteLine("\tE) Save Current Assignments");
                Console.WriteLine("\tQ) Quit");
                Console.WriteLine(" ");
                Console.Write("\tEnter Choice:");
                menuChoice = Console.ReadLine();

                switch (menuChoice)
                {
                    case "A":
                    case "a":
                        DisplayHomework(assignmentList);
                        break;

                    case "B":
                    case "b":
                        DisplayAddAssignment(assignmentList);
                        break;

                    case "C":
                    case "c":
                       DisplayDeleteHomework(assignmentList);
                        break;

                    case "D":
                    case "d":
                        DisplayEditAssignmentInfo(assignmentList);
                        break;

                    case "E":
                    case "e":
                        DisplaySaveToFile(dataPath, assignmentList);
                        break;

                    case "Q":
                    case "q":
                        exiting = true;
                        break;

                    default:
                        break;
                }

            }

        }