public static List <AssPerCourse> CreateListsAssPerCourse() // CREATE LIST, ASSIGNMENTS per COURSE______________________________________ { List <Assignment> Assignments = ListProvider.CreateListAssignments(); List <Course> Mathima = ListProvider.CreateListCourses(); AssPerCourse APC001 = new AssPerCourse(Mathima, Assignments); List <AssPerCourse> asignemntspermathima = new List <AssPerCourse>(); asignemntspermathima.Add(APC001); return(asignemntspermathima); }
public static List <AssPerStudent> CreateListsAssPerStudents() // CREATE LIST, ASSIGNMENTS per STUDENTS_____________________________________ { List <Assignment> Assignments = ListProvider.CreateListAssignments(); List <Student> Students = ListProvider.CreateListsStudents(); AssPerStudent APS001 = new AssPerStudent(Students, Assignments); List <AssPerStudent> asignemntsperstudent = new List <AssPerStudent>(); asignemntsperstudent.Add(APS001); return(asignemntsperstudent); }
public static void PrintListAssignments() { // Output ASSIGNEMENTS List__________________________________________________________________ List <Assignment> listAss = new List <Assignment>(); listAss = ListProvider.CreateListAssignments(); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("-----------------------------------------------------------------------------------------"); Console.WriteLine($" {"TITLE",-10} |{"DESCRIPTION",-30} | {"SUBMISSION",-12} | {"ORAL",-6} | {"TOTAL"}"); Console.WriteLine("-----------------------------------------------------------------------------------------"); Console.ForegroundColor = ConsoleColor.White; foreach (var item in listAss) { item.Output(); } //------------------------------------------------------------------------------------------- }
public static void Submissions(string date) // ASSIGNMENTS per STUDENTS PRINT (DATE CHECK)______________________________________ { List <Assignment> Assignments = ListProvider.CreateListAssignments(); List <AssPerStudent> ApS = new List <AssPerStudent>(); ApS = AssPerStudent.CreateListsAssPerStudents(); foreach (var item in ApS[0].Students) { item.Output(); foreach (var ass in ApS[0].Assignments) { if (ass.Title == item.Subject && ass.subDateTime.ToString("dd/MM/yyyy") == date) { ass.Output(); } } } }
public static void DateCheckAss() { string GivenDate = "01/01/2019"; List <Assignment> Assignments = ListProvider.CreateListAssignments(); // USER DATE___________________________________________________________________________________________________________________________ try { Console.WriteLine("Input Date in this Format (DD/MM/YYYY): "); GivenDate = Console.ReadLine(); DateTime DateCheck = DateTime.ParseExact(GivenDate, "dd/MM/yyyy", CultureInfo.InvariantCulture); } catch (Exception) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Your Given Date has Bad Format, Please input: (DD/MM/YYYY)"); Console.ForegroundColor = ConsoleColor.White; } DateTime DateConv = DateTime.ParseExact(GivenDate, "dd/MM/yyyy", CultureInfo.InvariantCulture); // ASSIGNMENTS DUE DATES_______________________________________________________________________________________________________________ DateTime temDate = new DateTime(2019, 1, 1); string tempD = temDate.ToString("dd/MM/yyyy"); DateTime temDate0 = DateTime.ParseExact(tempD, "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime temDate1 = DateTime.ParseExact(Assignments[0].subDateTime.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime temDate2 = DateTime.ParseExact(Assignments[1].subDateTime.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime temDate3 = DateTime.ParseExact(Assignments[2].subDateTime.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime temDate4 = DateTime.ParseExact(Assignments[3].subDateTime.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime temDate5 = DateTime.ParseExact(Assignments[4].subDateTime.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime temDate6 = DateTime.ParseExact(Assignments[5].subDateTime.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture); if (DateConv <= temDate0) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Your Given Date is Out of the Course Dates"); Console.ForegroundColor = ConsoleColor.White; } else if (DateConv >= temDate0 && DateConv <= temDate1) { GivenDate = Assignments[0].subDateTime.ToString("dd/MM/yyyy"); AssPerStudent.Submissions(GivenDate); } else if (DateConv >= temDate1 && DateConv <= temDate2) { GivenDate = Assignments[1].subDateTime.ToString("dd/MM/yyyy"); AssPerStudent.Submissions(GivenDate); } else if (DateConv >= temDate2 && DateConv <= temDate3) { GivenDate = Assignments[2].subDateTime.ToString("dd/MM/yyyy"); AssPerStudent.Submissions(GivenDate); } else if (DateConv >= temDate3 && DateConv <= temDate4) { GivenDate = Assignments[3].subDateTime.ToString("dd/MM/yyyy"); AssPerStudent.Submissions(GivenDate); } else if (DateConv >= temDate4 && DateConv <= temDate5) { GivenDate = Assignments[4].subDateTime.ToString("dd/MM/yyyy"); AssPerStudent.Submissions(GivenDate); } else if (DateConv >= temDate5 && DateConv <= temDate6) { GivenDate = Assignments[5].subDateTime.ToString("dd/MM/yyyy"); AssPerStudent.Submissions(GivenDate); } else { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Your Given Date is Out of the Assignments Submission Dates"); Console.ForegroundColor = ConsoleColor.White; } }
public static void UserInput() { string e = "E"; string i = "I"; string userInput = null; List <Assignment> assigns = ListProvider.CreateListAssignments(); while (userInput != e) { Console.WriteLine("\nChoose Action: \n(I) INPUT DATA, \n(E) BACK "); userInput = Console.ReadLine(); if (userInput == i) { string tempTitle = "Anonimos"; string tempDescription = "Anonimopoulos"; DateTime tempDate = DateTime.Now; double tempOmark = 5; double tempmark = 5; // Input Set Up__________________________________________________ Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("Please Input Assignment Data"); Console.ForegroundColor = ConsoleColor.White; // Input NAME_____________________________________________________ string tempTitle0; Console.Write("Title: "); tempTitle0 = Console.ReadLine(); if (tempTitle0 == null) { tempTitle = "Agnosto"; } tempTitle = tempTitle0; // Input SURNAME__________________________________________________ string tempDescriptione0; Console.Write("Description: "); tempDescriptione0 = Console.ReadLine(); if (tempDescriptione0 == null) { tempDescription = "Agnoto kai auto"; } tempDescription = tempDescriptione0; // Input DATE_______________________________________________ try { Console.WriteLine("Subscription Date (DD/MM/YYYY): "); string Check = Console.ReadLine(); DateTime DateCheck = DateTime.ParseExact(Check, "dd/MM/yyyy", CultureInfo.InvariantCulture); tempDate = DateCheck; } catch (Exception) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Your Given Date has Bad Format, Please input: (DD/MM/YYYY)"); Console.ForegroundColor = ConsoleColor.White; } // Input Oral Mark_____________________________________________ try { Console.Write("Oral Mark: "); tempOmark = double.Parse(Console.ReadLine()); if (tempOmark <= 0) { tempOmark = 0; } } catch (Exception) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Mark must be a Number, Please Input a Number"); Console.ForegroundColor = ConsoleColor.White; } // Input Total Mark_____________________________________________ try { Console.Write("Total Mark: "); tempmark = double.Parse(Console.ReadLine()); if (tempmark <= 0) { tempmark = 0; } } catch (Exception) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Mark must be a Number, Please Input a Number"); Console.ForegroundColor = ConsoleColor.White; } Assignment temp = new Assignment(tempTitle, tempDescription, tempDate, tempOmark, tempmark); assigns.Add(temp); foreach (var item in assigns) { item.Output(); } } else if (userInput == e) // Step Back Command { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("BACK"); Console.ForegroundColor = ConsoleColor.White; } else // In the Case of false Data Input { Console.ForegroundColor = ConsoleColor.DarkRed; Console.WriteLine("Unindentified Input, Please Choose Again"); Console.ForegroundColor = ConsoleColor.White; } } }