Пример #1
0
        private static void HandleProjectLevel()
        {
            Console.Clear();
            switch (NavigationBar.Selection)
            {
            case 1:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Projects;

                    foreach (var p in query)
                    {
                        Console.WriteLine();
                        Console.WriteLine($"{p.Id}: {p.Name}, {p.Client.Name}, {p.StartDate}");

                        foreach (var t in p.Tasks)
                        {
                            Console.WriteLine($"  -{t.Name}\n    start date: {t.StartDate}, Hours worked: {t.HoursWorked}, Developer: {t.Developer.Name}");
                        }
                    }
                }
                Console.ReadLine();
                break;

            case 2:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Projects;

                    foreach (var p in query)
                    {
                        Console.WriteLine();
                        Console.WriteLine($"{p.Id}: {p.Name}, {p.Client.Name}, {p.StartDate}");

                        foreach (var n in p.ProjectNotes)
                        {
                            Console.WriteLine($"  -{n.Note}, by: {n.Developer.Name}");
                        }
                    }
                }
                Console.ReadLine();
                break;

            case 3:
                ChangeViewLevel();
                break;

            case 4:
                NavigationBar.ViewLevel = 4;
                break;

            case 5:
                break;
            }
            NavigationBar.Selection = 0;
        }
Пример #2
0
        private static void HandleIndustryLevel()
        {
            Console.Clear();
            switch (NavigationBar.Selection)
            {
            case 1:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Industries;

                    foreach (var p in query)
                    {
                        Console.WriteLine();
                        Console.WriteLine($"{p.Id}: {p.Name}");

                        foreach (var t in p.Clients)
                        {
                            Console.WriteLine($"  -{t.Name}");
                        }
                    }
                }
                Console.ReadLine();
                break;

            case 2:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Industries;

                    foreach (var p in query)
                    {
                        Console.WriteLine();
                        Console.WriteLine($"{p.Id}: {p.Name}");

                        foreach (var n in p.IndustryNotes)
                        {
                            Console.WriteLine($"  -{n.Note}, by: {n.Developer.Name}");
                        }
                    }
                }
                Console.ReadLine();
                break;

            case 3:
                ChangeViewLevel();
                break;

            case 4:
                break;

            case 5:
                break;
            }
            NavigationBar.Selection = 0;
        }
Пример #3
0
        private static void HandleClientLevel()
        {
            Console.Clear();
            switch (NavigationBar.Selection)
            {
            case 1:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Clients;

                    foreach (var c in query)
                    {
                        Console.WriteLine();
                        Console.WriteLine($"{c.Id}: {c.Name}");

                        foreach (var p in c.Projects)
                        {
                            Console.WriteLine($"  -{p.Name}\n    start date: {p.StartDate}, project: {p.Name}");
                        }
                    }
                }
                Console.ReadLine();
                break;

            case 2:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Clients;

                    foreach (var c in query)
                    {
                        Console.WriteLine();
                        Console.WriteLine($"{c.Id}: {c.Name}");

                        foreach (var n in c.ClientNotes)
                        {
                            Console.WriteLine($"  -{n.Note}, by {n.Developer.Name}");
                        }
                    }
                }
                Console.ReadLine();
                break;

            case 3:
                ChangeViewLevel();
                break;

            case 4:
                break;

            case 5:
                break;
            }
            NavigationBar.Selection = 0;
        }
Пример #4
0
        public static void DrawLevel()
        {
            Console.Clear();
            switch (NavigationBar.ViewLevel)
            {
            case 0:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Developers;

                    foreach (var d in query)
                    {
                        Console.WriteLine($"{d.Id}: {d.Name}, {d.Email}, {d.StartDate.Date}");
                    }
                }
                break;

            case 1:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Clients;

                    foreach (var c in query)
                    {
                        Console.WriteLine($"{c.Id}: {c.Name}");
                    }
                }
                break;

            case 2:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Projects;

                    foreach (var p in query)
                    {
                        Console.WriteLine($"{p.Id}: {p.Name}, {p.Client.Name}, {p.StartDate}");
                    }
                }
                break;

            case 3:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Industries;

                    foreach (var i in query)
                    {
                        Console.WriteLine($"{i.Id}: {i.Name}");
                    }
                }
                break;

            case 4:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Projects;

                    foreach (var p in query)
                    {
                        int total = 0;

                        foreach (var t in p.Tasks)
                        {
                            total += t.HoursWorked;
                        }
                        Console.WriteLine($"{p.Id}: {p.Name}, {p.Client.Name}, {p.StartDate}\n    Hours Worked: {total}");
                    }
                }
                break;
            }
        }
Пример #5
0
        private static void HandleDeveloperLevel()
        {
            Console.Clear();
            switch (NavigationBar.Selection)
            {
            case 1:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Developers;

                    foreach (var d in query)
                    {
                        Console.WriteLine();
                        Console.WriteLine($"{d.Id}: {d.Name}, {d.Email}, {d.StartDate.Date}");

                        foreach (var t in d.Tasks)
                        {
                            Console.WriteLine($"  -{t.Name}\n    start date: {t.StartDate}, project: {t.Project.Name}, client: {t.Project.Client.Name}");
                        }
                    }
                }
                Console.ReadLine();
                break;

            case 2:
                using (TimeEntryDB context = new TimeEntryDB())
                {
                    var query = context.Developers;

                    foreach (var d in query)
                    {
                        Console.WriteLine();
                        Console.WriteLine($"{d.Id}: {d.Name}, {d.Email}, {d.StartDate.Date}");

                        foreach (var n in d.ClientNotes)
                        {
                            Console.WriteLine($"  -Client Note:\n   {n.Note}, {n.Client.Name}");
                        }
                        foreach (var n in d.ProjectNotes)
                        {
                            Console.WriteLine($"  -Project Note:\n   {n.Note}, {n.Project.Name}");
                        }
                        foreach (var n in d.IndustryNotes)
                        {
                            Console.WriteLine($"  -Industry Note:\n   {n.Note}, {n.Industry.Name}");
                        }
                    }
                }
                Console.ReadLine();
                break;

            case 3:
                ChangeViewLevel();
                break;

            case 4:
                break;

            case 5:
                break;
            }
            NavigationBar.Selection = 0;
        }