Пример #1
0
        public void LoadResearcherDetails()
        {
            //    res.ForEach(x =>
            //    {
            //        Researcher r = ERDAdapter.completeResearcherDetails(x);
            //        Console.WriteLine("Name: {0} {1}\nTitle:{2}\nUnit: {3}\nCampus: {4}\nEmail: {5}\n" +
            //                          "Photo: {6}", r.GivenName, r.FamilyName, r.Title, r.Unit, r.Campus, r.Email, r.Photo);

            //        Console.WriteLine("Current job: {0}\nCommenced with institution: {1}\n" +
            //                              "Commenced current position: {2}\n" +
            //                              "Previous positions: \n", r.GetCurrentJob().Title(),
            //                              r.GetEarliestJob().Start,
            //                               r.GetCurrentJob().Start);
            //        r.positions.ForEach(pos =>
            //        {
            //            if (pos.Level != EmploymentLevel.Student)
            //            {
            //                Console.WriteLine(String.Format("{0}\t{1}\t{2}\n",
            //                pos.Start, pos.End, pos.Title()));
            //            };
            //        });
            //});

            foreach (Researcher x in res)
            {
                Researcher r = ERDAdapter.completeResearcherDetails(x);
                Console.WriteLine("Name: {0} {1}\nTitle:{2}\nUnit: {3}\nCampus: {4}\nEmail: {5}\n" +
                                  "Photo: {6}Current job: {7}\nCommenced with institution: {8}\n" +
                                  "Commenced current position: {9}\nPrevious positions: \n",
                                  r.GivenName, r.FamilyName, r.Title, r.Unit, r.Campus, r.Email, r.Photo,
                                  r.GetCurrentJob().Title(), r.GetEarliestJob().Start, r.GetCurrentJob().Start);
            }
        }
Пример #2
0
        //-----------------------------------------------------------End---------------------------------------------------------------------



        //----------------------------------Test to print all the researcher details and publications---------------------------
        //----------------------------------------------------Full Test Start------------------------------------------------------------------------------

        public void TestResearcherListByID(int id)
        {
            LoadResearcherDetails(new Researcher {
                ID = id
            });


            Console.WriteLine("Name: {0} {1}\nTitle:{2}\nUnit: {3}\nCampus: {4}\nEmail: {5}\n" +
                              "Photo: {6}\nCurrent job: {7}\nCommenced with institution: {8}\n" +
                              "Commenced current position: {9}\nPrevious positions: \n",
                              currentResearcher.GivenName, currentResearcher.FamilyName, currentResearcher.Title, currentResearcher.Unit,
                              currentResearcher.Campus, currentResearcher.Email, currentResearcher.Photo,
                              currentResearcher.GetCurrentJob().Title(), currentResearcher.GetEarliestJob().Start.ToString("dd/MM/yyyy"),
                              currentResearcher.GetCurrentJob().Start.ToString("dd/MM/yyyy"));

            //Test to print all the positions of the researcher (not include student)
            foreach (Position pos in currentResearcher.positions)
            {
                if (pos.End != default)
                {
                    Console.WriteLine(String.Format("{0}\t{1}\t{2}\n", pos.Start.ToString("dd/MM/yyyy"),
                                                    pos.End.ToString("dd/MM/yyyy"), pos.Title()));
                }
                ;
            }
            Console.WriteLine("Tenure: {0}\tPublications: {1}\n", currentResearcher.Tenure().ToString("0.0"),
                              currentResearcher.PublicationsCount());



            //Staff information
            Console.WriteLine("More information: \n");
            LoadStudentDetails();


            if (currentResearcher.position.Level != EmploymentLevel.Student)
            {
                Staff staff = new Staff(currentResearcher)
                {
                    students = students
                };
                TestStaff();
                DisplayNumberOfSupervisions(staff);
            }

            //Student information
            else
            {
                Student s = (from stu in students
                             where stu.ID == currentResearcher.ID
                             select stu).SingleOrDefault();
                DisplayDegreeForStudent(s);
                DisplaySupervisorName(s, res);
            }



            //List of publication
            PublicationsController pc        = new PublicationsController();
            List <Publication>     sortedPub = pc.SortPublicationList(currentResearcher);

            Console.WriteLine("Publication count:");
            pc.TestPublicationsCount(currentResearcher);

            Console.WriteLine("{0,-10}  {1}\n", "Year", "Title");
            foreach (Publication pub in sortedPub)
            {
                Console.WriteLine("{0,-10}  {1}\n", pub.Year, pub.Title);
            }

            Console.WriteLine("Publication details: \n");
            pc.LoadPublicationsFor(currentResearcher);
            pc.TestPublicationDetails(currentResearcher);
        }