コード例 #1
0
        static void Main()
        {
            string localFolderPath = "E:\\FYP\\OOP Lab\\TestRepo\\";
            string fileName        = "E:\\FYP\\OOP Lab\\TestRepo\\Result.xlsx";
            string excelSheet      = "E:\\FYP\\OOP Lab\\TestRepo\\GUI.xlsx";

            //ExcelReport(fileName, student);
            Students students = ReadXLS(excelSheet);

            Console.WriteLine("Feteching Repositories");
            foreach (Student student in students.GetStudents())
            {
                student.LocalRepo = CreateLocalRepository(student.Repository, localFolderPath + student.RollNumber);
            }
            Console.WriteLine("Feteched all Repositories");



            Console.WriteLine("Feteching Commits' Details");
            foreach (Student student in students.GetStudents())
            {
                CommitDetails details = GetCommitsDetailsFromLocalRepo(student.LocalRepo);
                student.Details = details;
            }
            Console.WriteLine("Feteched Commits' Details");

            Console.WriteLine("Creating report");
            StudentsReport(students, fileName);
            Console.WriteLine("Successfully created report");

            Console.ReadKey();
        }
コード例 #2
0
        static CommitDetails GetCommitsDetailsFromLocalRepo(string localRepo)
        {
            if (localRepo == null)
            {
                return(null);
            }
            CommitDetails details = new CommitDetails();
            Repository    repo    = new Repository(localRepo);

            foreach (var commit in repo.Commits)
            {
                Commit c = new Commit
                {
                    Author = commit.Author.Name,
                    Date   = commit.Author.When.Date.ToString("d"),
                    Time   = commit.Author.When.DateTime.ToString("h:mm tt")
                };
                details.SetCommits(c);
            }
            return(details);
        }