Advertisement
Guest User

College Management Software

a guest
Jan 2nd, 2015
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 29.63 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace DBSManagementSoftwarePackage
  8. {
  9.     class College
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int choice,menuOption;
  14.             string switchChoice;
  15.             bool running = true;
  16.  
  17.             Person p=new Person();
  18.  
  19.             mainmenu:
  20.             Console.WriteLine("\n====DBS Management Software====");
  21.             Console.WriteLine("\nPlease select an option from the following");
  22.             Console.WriteLine("\n1: Enter Student details \n2: Enter Employee details");
  23.             Console.Write("\nChoice: ");
  24.             choice = int.Parse(Console.ReadLine());
  25.  
  26. /*-------------------------------------------------------------------------------------------STUDENT MENU-------------------------------------------------------------------------------------------*/            
  27.             if (choice == 1)
  28.             {
  29.                 StudentList sList = new StudentList();
  30.                /* Name n1=new Name();
  31.                 n1.FirstName="John";
  32.                 n1.LastName="Baiege";
  33.                
  34.                 Address a1=new Address();
  35.                 a1.HouseNo="1234";
  36.                 a1.Street="Same street";
  37.                 a1.City="Dublin";
  38.                 a1.County="Dublin";*/
  39.              
  40.  
  41.  
  42.  
  43.  
  44.                 //StudentList sl1 = new StudentList("S123","Mr",n1 ,new DateTime(1982,10,03),"F", a1,"01-364899","no@email.com", "Postgrad","Law", "Full Time","Level 8",38.69M, new DateTime(2010,10,20), new DateTime(2014,10,20));
  45.                // StudentList sl2 = new StudentList();
  46.  
  47.                 //string id, string title, Name name, DateTime dob, string gender, Address address, string phone, string email, StudentStatus status, string course, string mode, string level, decimal fees, DateTime startDate, DateTime endDate
  48.  
  49.                 while (running)
  50.                 {
  51.                     Console.WriteLine("\n====STUDENT MENU====");
  52.                     Console.WriteLine("\nPlease select an option from the following");
  53.                     Console.WriteLine("1: Add a record");
  54.                     Console.WriteLine("2: Find a record by Id");
  55.                     Console.WriteLine("3: Remove a record by Id");
  56.                     Console.WriteLine("4: Show all records");
  57.                     Console.WriteLine("5: Main Menu");
  58.                     Console.WriteLine("6: Quit");
  59.                     Console.Write("\nChoice: ");
  60.                                      
  61.                     menuOption = int.Parse(Console.ReadLine());
  62.                     Console.Clear();
  63.  
  64.                         switch (menuOption)
  65.                         {
  66.                             case 1:
  67.  
  68.                            do
  69.                              {
  70.  
  71.                                     sList.AddStudent();
  72.                              
  73.                                    
  74.                                Console.Write("\nPress \"Y\" to add another record or any other key to return to the Student menu: ");
  75.                                  switchChoice = Console.ReadLine();
  76.  
  77.  
  78.                             } while (switchChoice.ToLower() == "y");
  79.  
  80.  
  81.  
  82.                                 break;
  83.  
  84.                             case 2:
  85.                                  do
  86.                                 {
  87.                                   sList.FindStudent();
  88.                                  
  89.                                 Console.Write("\nPress \"Y\" to add another record or any other key to return to the Student menu: ");
  90.                                 switchChoice = Console.ReadLine();
  91.  
  92.  
  93.                                 } while (switchChoice.ToLower() == "y");
  94.  
  95.                                 break;
  96.  
  97.                             case 3:
  98.  
  99.                                 sList.RemoveStudent();
  100.  
  101.                                 break;
  102.  
  103.                             case 4:
  104.  
  105.                                 sList.ShowAll();
  106.                                
  107.  
  108.                                break;
  109.  
  110.                             case 5:
  111.  
  112.                                goto mainmenu;
  113.  
  114.                              
  115.  
  116.                             case 6:
  117.                                 running = false;
  118.                                 break;
  119.  
  120.  
  121.                             default: Console.WriteLine("Invalid option");
  122.  
  123.                                 break;
  124.                         }//end if switch-student
  125.                    
  126.                 }//end of while-student
  127.             }//end of if(choice == 1)-student
  128.  
  129. /*-------------------------------------------------------------------------------------------EMPLOYEE MENU-------------------------------------------------------------------------------------------*/
  130.             else if (choice == 2)
  131.             {
  132.            
  133.                 Console.WriteLine("\nPlease select an option from the following");
  134.                 Console.WriteLine("\n1: Enter Staff details \n2: Enter Teacher details");
  135.                 Console.Write("\nChoice: ");
  136.                 choice = int.Parse(Console.ReadLine());
  137.  
  138.  
  139.                     if (choice==1)
  140.                     {
  141.                         StaffList stList = new StaffList();
  142.     /*-------------------------------------------------------------------------------------------STAFF-------------------------------------------------------------------------------------------*/
  143.                        
  144.                         while (running)
  145.                         {
  146.                             Console.WriteLine("\n====STAFF MENU====");
  147.                             Console.WriteLine("\nPlease select an option from the following");
  148.                             Console.WriteLine("1: Add a record");
  149.                             Console.WriteLine("2: Find a record by Id");
  150.                             Console.WriteLine("3: Remove a record by Id");
  151.                             Console.WriteLine("4: Show all records");
  152.                             Console.WriteLine("5: Main Menu");
  153.                             Console.WriteLine("6: Quit");
  154.                             menuOption = int.Parse(Console.ReadLine());
  155.  
  156.                                 switch (menuOption)
  157.                                 {
  158.                                     case 1:
  159.  
  160.                                         do
  161.                                         {
  162.  
  163.                                             stList.AddStaff();
  164.  
  165.  
  166.  
  167.                                             Console.Write("\nPress \"Y\" to add another record or any other key to return to the Staff menu: ");
  168.                                             switchChoice = Console.ReadLine();
  169.  
  170.  
  171.                                         } while (switchChoice.ToLower() == "y");
  172.  
  173.  
  174.  
  175.                                         break;
  176.  
  177.                                     case 2:
  178.  
  179.                                         stList.FindStaff();
  180.  
  181.                                         break;
  182.  
  183.                                     case 3:
  184.  
  185.                                         stList.RemoveStaff();
  186.  
  187.                                         break;
  188.  
  189.                                     case 4:
  190.  
  191.                                         stList.ShowAllStaff();
  192.  
  193.                                         break;
  194.  
  195.                                     case 5:
  196.                                         Console.Clear();
  197.                                         goto mainmenu;
  198.  
  199.                                        
  200.                                     case 6:
  201.  
  202.                                         running = false;
  203.  
  204.                                         break;
  205.  
  206.                                     default: Console.WriteLine("Invalid option");
  207.  
  208.                                         break;
  209.                                 }//end if switch-Staff
  210.  
  211.                          }//end of while-Staff
  212.                     }//end of if(choice == 1)-Staff
  213.  
  214.                     else if (choice==2)
  215.                     {
  216.                         TeacherList tList = new TeacherList();
  217.     /*-------------------------------------------------------------------------------------------TEACHER-------------------------------------------------------------------------------------------*/
  218.                         while (running)
  219.                         {
  220.                             Console.WriteLine("\n====TEACHER MENU====");
  221.                             Console.WriteLine("\nPlease select an option from the following");
  222.                             Console.WriteLine("1: Add a record");
  223.                             Console.WriteLine("2: Find a record by Id");
  224.                             Console.WriteLine("3: Remove a record by Id");
  225.                             Console.WriteLine("4: Show all records");
  226.                             Console.WriteLine("5: Main Menu");
  227.                             Console.WriteLine("6: Quit");
  228.                             Console.Write("\nChoice: ");
  229.                             menuOption = int.Parse(Console.ReadLine());
  230.  
  231.                                 switch (menuOption)
  232.                                 {
  233.                                     case 1:
  234.  
  235.                                         do
  236.                                         {
  237.                                             tList.AddTeacher();
  238.  
  239.  
  240.                                             Console.Write("\nPress \"Y\" to add another record or any other key to return to the Teacher menu: ");
  241.                                             switchChoice = Console.ReadLine();
  242.  
  243.  
  244.                                         } while (switchChoice.ToLower() == "y");
  245.  
  246.  
  247.  
  248.                                         break;
  249.  
  250.                                     case 2:
  251.  
  252.                                         tList.FindTeacher();
  253.  
  254.                                         break;
  255.  
  256.                                     case 3:
  257.  
  258.                                         tList.RemoveTeacher();
  259.  
  260.                                         break;
  261.  
  262.                                     case 4:
  263.  
  264.                                         tList.ShowAllTeachers();
  265.  
  266.                                         break;
  267.  
  268.                                     case 5:
  269.                                          Console.Clear();
  270.                                         goto mainmenu;
  271.  
  272.                                     case 6:
  273.  
  274.                                         running = false;
  275.  
  276.                                         break;
  277.  
  278.                                     default: Console.WriteLine("Invalid option");
  279.  
  280.                                         break;
  281.                                 }//end if switch-teacher
  282.  
  283.                         }//end of while-teacher
  284.                     }//end of if(choice == 2)-teacher
  285.  
  286.             }//end of else if(choice == 2)-Employee    
  287.            
  288.            
  289.             else
  290.             {
  291.                 Console.WriteLine("Invalid option");
  292.             }//end of else main menu
  293.  
  294.             }//end of static main
  295.  
  296.  
  297.      
  298.        
  299.     }//end of class College
  300.  
  301. }//end of namespace
  302.  
  303.       /*  //student and teacher list created
  304.  
  305.        static List<Student> studentList = new List<Student>();  
  306.         //static List<Teacher> teacherList = new List<Teacher>();    
  307.        
  308.         static void Main(string[] args)
  309.         {
  310.             int option; //choice;
  311.             string inputStatus;
  312.             bool running = true;
  313.  
  314.             Address a = new Address();
  315.             Name n = new Name();
  316.          
  317.  
  318.             Console.WriteLine("\n====DBS Management Software====");
  319.  
  320.             Console.WriteLine("\nPlease select an option from the following");
  321.            // Console.WriteLine("\n1: Enter Student details \n2: Enter Teacher details");
  322.           //  choice = int.Parse(Console.ReadLine());
  323.  
  324.             //**** menu for student ****
  325.  
  326.            // if (choice == 1)
  327.             //{
  328.            
  329.                 while (running)
  330.                 {
  331.                     Console.ForegroundColor = ConsoleColor.White;
  332.                     Console.WriteLine("\n====STUDENT MENU====");
  333.                     Console.WriteLine("\nPlease select an option from the following");
  334.                     Console.WriteLine("1: Add a record");
  335.                     Console.WriteLine("2: Find a record by Id");
  336.                     Console.WriteLine("3: Remove a record by Id");
  337.                     Console.WriteLine("4: Show all records");
  338.                     Console.WriteLine("5: Quit");
  339.  
  340.                     option = int.Parse(Console.ReadLine());
  341.                     //string id, string title, Name name, DateTime dob, string gender, Address address,
  342.                     //string phone, string email, StudentStatus status, string course, string mode, string level, decimal fees, DateTime startDate, DateTime endDate
  343.                    
  344.                     //Populate records
  345.                     a.HouseNo = "12 Holywell Cresent";
  346.                     a.Street="Main Street";
  347.                     a.City = "Dublin";
  348.                     a.County = "Dublin";
  349.                     n.FirstName = "John";
  350.                     n.LastName = "Murphy";
  351.                     Student s1 = new Student();
  352.                     //StudentList studentCollection = new StudentList();
  353.  
  354.                     switch (option)
  355.                     {
  356.                         case 1:
  357.  
  358.                             Student s = new Student();
  359.                             //string id, string title, Name name, DateTime dob, string gender, Address address,
  360.                             //string phone, string email, StudentStatus status, string course, string mode, string level, decimal fees, DateTime startDate, DateTime endDate
  361.                            
  362.                             Console.WriteLine("\nPlease enter the following details\n-------------------------------------------");
  363.  
  364.                             Console.Write("\nStudent Id: ");
  365.                             s.StudentId = Console.ReadLine();
  366.                            
  367.                             Console.Write("\nTitle: ");
  368.                             s.Title = Console.ReadLine();
  369.  
  370.                             Console.Write("\nFirst Name: ");
  371.                             n.FirstName = Console.ReadLine();
  372.  
  373.                             Console.Write("\nLast Name: ");
  374.                             n.LastName = Console.ReadLine();
  375.  
  376.                             Console.Write("\nDate of Birth(mm/dd/yyyy): ");
  377.                             //DateTime dob=
  378.                             s.DateOfBirth = DateTime.Parse(Console.ReadLine());
  379.  
  380.                             Console.Write("\nGender: ");
  381.                             s.Gender= Console.ReadLine();
  382.  
  383.                             Console.Write("\nHouse Number: ");
  384.                             a.HouseNo= Console.ReadLine();
  385.                             Console.Write("\nStreet: ");                            
  386.                             a.Street= Console.ReadLine();
  387.                             Console.Write("\nCity: ");
  388.                             a.City= Console.ReadLine();
  389.                             Console.Write("\nCounty: ");
  390.                             a.County= Console.ReadLine();            
  391.                            
  392.                             Console.Write("\nPhone: ");
  393.                             s.Phone = Console.ReadLine();
  394.  
  395.                             Console.Write("\nEmail: ");
  396.                             s.Email = Console.ReadLine();
  397.  
  398.                             Console.Write("\nStatus(Postgrad/Undergrad): ");
  399.                             inputStatus = Console.ReadLine();
  400.                             s.StudentStatus=(StudentStatus)Enum.Parse(typeof(StudentStatus),inputStatus);
  401.                            
  402.                             Console.Write("\nCourse: ");
  403.                             s.StudentCourseName = Console.ReadLine();
  404.                            
  405.                             Console.Write("\nMode(Full Time/Part Time): ");
  406.                             s.StudentCourseMode = Console.ReadLine();
  407.  
  408.                             Console.Write("\nLevel(6,7,8,9): ");
  409.                             s.StudentCourseLevel = Console.ReadLine();
  410.                            
  411.                             Console.Write("\nFees(euro): ");
  412.                             s.StudentCourseFees = Convert.ToDecimal(Console.ReadLine());
  413.  
  414.                             Console.Write("\nCourse Start Date(mm/dd/yyyy): ");
  415.                             s.CourseStartDate = DateTime.Parse(Console.ReadLine());
  416.  
  417.  
  418.                             Console.Write("\nCourse End Date(mm/dd/yyy): ");
  419.                             s.CourseEndDate= DateTime.Parse(Console.ReadLine());
  420.  
  421.                            // studentCollection.Add(s);
  422.                             studentList.Add(s);
  423.  
  424.                             Console.ForegroundColor = ConsoleColor.DarkCyan;
  425.                             Console.WriteLine("\nStudent added successfully");
  426.  
  427.  
  428.                             Console.ForegroundColor = ConsoleColor.DarkMagenta;
  429.                             foreach (Student st in studentList)
  430.                             {
  431.                                Console.WriteLine("\n**************************");
  432.                                Console.WriteLine(st);
  433.                                Console.WriteLine("**************************");
  434.                            }//foreach
  435.                             // do
  436.                             // {
  437.                            
  438.  
  439.                             // Console.Write("\nPress y to add another record and q to return to the Student menu: ");
  440.                             // choice=Console.ReadLine();
  441.  
  442.  
  443.                             // }while(choice.ToLower() == "y");
  444.  
  445.                             break;
  446.  
  447.                         case 2:
  448.  
  449.                             if (studentList.Count == 0)
  450.                             {
  451.                                 Console.WriteLine("\nNo student records in the list. Please add a student record");
  452.                             }
  453.                             else
  454.                             {
  455.  
  456.                                 Console.ForegroundColor = ConsoleColor.White;
  457.                                 Console.Write("\nPlease enter a Student Id: ");
  458.                                 string id = Console.ReadLine();
  459.  
  460.                                 foreach (Student sFind in studentList)
  461.                                 {
  462.                                     if (sFind.StudentId == id)
  463.                                     {
  464.  
  465.                                         //studentCollection.Contains(sFind);
  466.                                         Console.ForegroundColor = ConsoleColor.DarkYellow;
  467.                                         Console.WriteLine("\nStudent with id {0} found\n The details are as follows:", id);
  468.                                         Console.ForegroundColor = ConsoleColor.DarkMagenta;
  469.                                         Console.WriteLine("\n**************************");
  470.                                         Console.WriteLine(sFind);
  471.                                         Console.WriteLine("**************************");
  472.                                     }
  473.                                 }
  474.  
  475.                             }
  476.  
  477.                              
  478.  
  479.                             break;
  480.  
  481.                         case 3:
  482.  
  483.                           //  RemoveStudent();
  484.  
  485.                             break;
  486.  
  487.                         case 4:
  488.                             Console.ForegroundColor = ConsoleColor.DarkYellow;
  489.                             if (studentList.Count == 0)
  490.                             {
  491.                             Console.WriteLine("\nNo student records in the list. Please add a student record"); }
  492.                             else {
  493.                            
  494.                                 foreach (Student studentShow in studentList)
  495.                                 {
  496.                                     Console.WriteLine("\n**************************");
  497.                                     Console.WriteLine(studentShow);
  498.                                     Console.WriteLine("**************************");
  499.                                 }//foreach
  500.                             }
  501.                            
  502.  
  503.                             break;
  504.  
  505.                         case 5:
  506.  
  507.                             running = false;
  508.  
  509.                             break;
  510.  
  511.                         default:
  512.  
  513.                             Console.WriteLine("Invalid option");
  514.  
  515.                             break;
  516.  
  517.                     }//end of switch
  518.                 }//end of while
  519.  
  520.             //}//end of if
  521.  
  522.             //    //**** menu for teacher ****
  523.  
  524.             // else if (choice == 2)
  525.                
  526.             //    {
  527.             //        while (running)
  528.             //        {
  529.             //            Console.WriteLine("\n====TEACHER MENU====");
  530.             //            Console.WriteLine("\nPlease select an option from the following");
  531.             //            Console.WriteLine("1: Add a record");
  532.             //            Console.WriteLine("2: Find a record by Id");
  533.             //            Console.WriteLine("3: Remove a record by Id");
  534.             //            Console.WriteLine("4: Show all records");
  535.             //            Console.WriteLine("5: Quit");
  536.  
  537.             //            option = int.Parse(Console.ReadLine());
  538.  
  539.             //            switch (option)
  540.             //            {
  541.             //                case 1:
  542.  
  543.             //                    AddTeacher();
  544.  
  545.             //                    break;
  546.  
  547.             //                case 2:
  548.  
  549.             //                    FindTeacher();
  550.  
  551.             //                    break;
  552.  
  553.             //                case 3:
  554.  
  555.             //                    RemoveTeacher();
  556.  
  557.             //                    break;
  558.  
  559.             //                case 4:
  560.  
  561.             //                    ShowAllTeachers();
  562.  
  563.             //                    break;
  564.  
  565.             //                case 5:
  566.  
  567.             //                    running = false;
  568.  
  569.             //                    break;
  570.  
  571.             //                default: Console.WriteLine("Invalid option");
  572.  
  573.             //                    break;
  574.  
  575.             //            }//end of switch
  576.  
  577.             //        }//end of while
  578.  
  579.             //    }//end of elseif
  580.  
  581.             //    else
  582.             //    {
  583.             //        Console.WriteLine("Invalid option");
  584.             //    }
  585.  
  586.        
  587.  
  588.            
  589.  
  590.  
  591.  
  592.             //methods
  593.  
  594.  
  595.  
  596.             // Console.ReadLine();
  597.         }//end of main()
  598.  
  599.     /*    public void subMenu(int opt)
  600.             {
  601.                     Console.WriteLine("Please select an option from the following");
  602.                     Console.WriteLine("1: Add a teacher");
  603.                     Console.WriteLine("2: Find a teacher by Id");
  604.                     Console.WriteLine("3: Remove a teacher by Id");
  605.                     Console.WriteLine("4: Show all teachers");
  606.                     Console.WriteLine("5: Quit");
  607.             }*/
  608.  
  609.  
  610.         //****************************STUDENT***********************************
  611.  
  612.         //*******method to Add student record********
  613.  
  614.         //static void AddStudent()
  615.         //{
  616.         //    Student s = new Student();
  617.  
  618.            
  619.         //    Console.Write("\nEnter student id: ");
  620.         //    s.StudentId = Console.ReadLine();
  621.  
  622.         //    //Need to compare the id in the list then display the below statements
  623.  
  624.         //    Console.Write("\nEnter student name:");
  625.         //    s.Name = Console.ReadLine();
  626.  
  627.         //    Console.Write("\nEnter student phone:");
  628.         //    s.Phone = Console.ReadLine();
  629.  
  630.         //    Console.Write("\nEnter student email:");
  631.         //    s.Email = Console.ReadLine();
  632.            
  633.         //    Console.Write("\nEnter student status(Undergrad or Postgrad): ");
  634.         //    string inputStatus = Console.ReadLine();
  635.         //    s.StudentStatus = (StudentStatus)Enum.Parse(typeof(StudentStatus), inputStatus);
  636.            
  637.         //    studentList.Add(s);
  638.  
  639.         //    Console.WriteLine("\nStudent added successfully");
  640.  
  641.         //    ShowAll();
  642.  
  643.         //}//end of AddStudent()
  644.  
  645.  
  646.         ////*******method to Find student record********
  647.  
  648.         //static void FindStudent()
  649.         //{
  650.         //    Console.Write("\nEnter student id: ");
  651.         //    string id = Console.ReadLine();
  652.  
  653.         //    foreach(Student student in studentList)
  654.         //    {
  655.         //    //studentList.Find(s.StudentId=>s.StudentId=id);
  656.  
  657.         //        if(student.StudentId == id)
  658.         //        {
  659.         //            Console.WriteLine("\nStudent with id {0} found\n The details are as follows:",id);
  660.         //            Console.WriteLine("\n**************************");
  661.         //            Console.WriteLine(student);
  662.         //            Console.WriteLine("**************************");
  663.  
  664.         //        }
  665.         //        else
  666.         //        {
  667.         //            Console.WriteLine("\nStudent with id {0} not found", id);
  668.         //        }
  669.         //    }
  670.         //}//end of method Find Student()
  671.  
  672.  
  673.  
  674.  
  675.        
  676.         ////*******method to Remove student record********
  677.  
  678.         //static void RemoveStudent()
  679.         //{
  680.         //    Console.Write("\nEnter student id: ");
  681.         //    string id = Console.ReadLine();
  682.  
  683.         //   for(int i = 0; i < studentList.Count ; i++)
  684.         //   {
  685.         //       if(studentList[i].StudentId == id)
  686.         //       {
  687.         //           studentList.Remove(studentList[i]);
  688.         //           Console.WriteLine("\nStudent removed successfully");
  689.  
  690.         //       }//end of if
  691.         //       else
  692.         //       {
  693.         //           Console.WriteLine("\nError! Student record with id {0} not found in the list",id);
  694.                
  695.         //       }//end of else
  696.            
  697.            
  698.         //    }//end of for
  699.  
  700.         //}//end of RemoveStudent()
  701.  
  702.  
  703.  
  704.         ////*******method to Show all student records********
  705.  
  706.         //static void ShowAll()
  707.         //{
  708.         //    foreach (Student student in studentList)
  709.         //    {
  710.         //        Console.WriteLine("\n**************************");
  711.         //        Console.WriteLine(student);
  712.         //        Console.WriteLine("**************************");
  713.         //    }//foreach
  714.  
  715.         //}//end of ShowAll
  716.  
  717.  
  718.         ////****************************TEACHER***********************************
  719.  
  720.         ////*******method to teacher record********
  721.         //static void AddTeacher()
  722.         //{
  723.         //    Teacher t = new Teacher();
  724.  
  725.  
  726.         //   //Need to compare the id in the list then display the below statements
  727.  
  728.         //    Console.Write("\nEnter teacher name:");
  729.         //    t.Name = Console.ReadLine();
  730.  
  731.         //    Console.Write("\nEnter teacher phone:");
  732.         //    t.Phone = Console.ReadLine();
  733.  
  734.         //    Console.Write("\nEnter teacher email:");
  735.         //    t.Email = Console.ReadLine();
  736.  
  737.         //    Console.Write("\nEnter teacher subject taught:");
  738.         //    t.SubjectTaught = Console.ReadLine();
  739.  
  740.         //    Console.Write("\nEnter salary:");
  741.         //    t.Salary = Convert.ToDecimal(Console.ReadLine());
  742.  
  743.         //    teacherList.Add(t);
  744.            
  745.         //    Console.WriteLine("\nStudent added successfully");
  746.  
  747.         //    ShowAllTeachers();
  748.  
  749.         //}//end of AddStudent()
  750.  
  751.  
  752.         ////*******method to Find teacher record********
  753.  
  754.         //static void FindTeacher()
  755.         //{
  756.         //    Console.Write("\nEnter teacher's full name: ");
  757.         //    string teacherName = Console.ReadLine();
  758.  
  759.         //    foreach (Teacher teacher in teacherList)
  760.         //    {
  761.                
  762.  
  763.         //        if (teacher.Name == teacherName)
  764.         //        {
  765.         //            Console.WriteLine("\nTeacher with name {0} found\n The details are as follows:", teacherName);
  766.         //            Console.WriteLine("\n**************************");
  767.         //            Console.WriteLine(teacher);
  768.         //            Console.WriteLine("**************************");
  769.  
  770.         //        }
  771.         //        else
  772.         //        {
  773.         //            Console.WriteLine("\nTeacher with name {0} not found", teacherName);
  774.         //        }
  775.         //    }
  776.         //}//end of method Find Teacher()
  777.  
  778.  
  779.  
  780.  
  781.  
  782.         ////*******method to Remove teacher record********
  783.  
  784.         //static void RemoveTeacher()
  785.         //{
  786.         //    Console.Write("\nEnter teacher name: ");
  787.         //    string teacherName = Console.ReadLine();
  788.  
  789.         //    for (int i = 0; i < teacherList.Count; i++)
  790.         //    {
  791.         //        if (teacherList[i].Name==teacherName)
  792.         //        {
  793.         //            teacherList.Remove(teacherList[i]);
  794.         //            Console.WriteLine("\nTeacher removed successfully");
  795.  
  796.         //        }//end of if
  797.         //        else
  798.         //        {
  799.         //            Console.WriteLine("\nError! Teacher record with name {0} not found in the list", teacherName);
  800.  
  801.         //        }//end of else
  802.  
  803.  
  804.         //    }//end of for
  805.  
  806.         //}//end of RemoveTeacher()
  807.  
  808.  
  809.  
  810.         ////*******method to Show all student records********
  811.  
  812.         //static void ShowAllTeachers()
  813.         //{
  814.         //    foreach (Teacher teacher in teacherList)
  815.         //    {
  816.         //        Console.WriteLine("\n**************************");
  817.         //        Console.WriteLine(teacher);
  818.         //        Console.WriteLine("**************************");
  819.         //    }//foreach
  820.  
  821.         //}//end of ShowAll*/
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.   /*  }//end of class College
  837. }//end of namespace
  838. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement