Ejemplo n.º 1
0
        private void PageAddComment()
        {
            TextFormatting.Header("Skriv en kommentar");

            ShowAllBlogPostsBrief();

            TextFormatting.Write("Vilket inlägg vill du skriva en kommentar till? ");

            int postId = int.Parse(Console.ReadLine());

            TextFormatting.WriteLine("Kommentera blogginlägg: ");
            string Newcomment = Console.ReadLine();

            _dataAccess.AddComment(postId, Newcomment);


            TextFormatting.MenuItems3("Kommentar tillagd");
            Console.ReadKey();
            PageMainMenu();
        }
Ejemplo n.º 2
0
        private void PageWatchTags()
        {
            TextFormatting.Header("Läs Taggar");
            ShowAllBlogPostsBrief();
            TextFormatting.Write("Under vilket inlägg vill du läsa taggar? ");
            int PostId = int.Parse(Console.ReadLine());



            List <Tag> list    = _dataAccess.WatchTags(PostId);
            int        counter = 1;

            TextFormatting.MenuItems3($"\nDetta är kommentarerna för blogginlägget\n");
            foreach (Tag item in list)
            {
                TextFormatting.MenuItems($"Tag Nr: {counter}\t\t {item.Tags}");
                counter++;
            }
            TextFormatting.WriteLine();
            Console.ReadKey();
            PageMainMenu();
        }
Ejemplo n.º 3
0
        private void PageWatchComments()
        {
            TextFormatting.Header("Läs kommentarer");
            ShowAllBlogPostsBrief();
            TextFormatting.MenuItems2("\nESC) Gå tillbaka till huvudmenyn\n");
            TextFormatting.Write("Under vilket inlägg vill du läsa kommentarer? ");
            int PostId = int.Parse(Console.ReadLine());



            List <Comments> list    = _dataAccess.WatchComments(PostId);
            int             counter = 1;

            TextFormatting.MenuItems3($"\nDetta är kommentarerna för blogginlägget\n");
            foreach (Comments item in list)
            {
                TextFormatting.MenuItems($"Kommentar Nr: {counter}\t\t{item.Comment}");
                counter++;
            }
            TextFormatting.WriteLine();
            Console.ReadKey();
            PageMainMenu();
        }
Ejemplo n.º 4
0
        public void PageAddPost()
        {
            TextFormatting.Header("Skriv nytt blogginlägg");

            ShowAllBlogPostsBrief();

            TextFormatting.WriteLine("Vem har skrivit inlägget? ");

            string NewPostText = Console.ReadLine();

            TextFormatting.WriteLine("Vad står det i inlägget? ");

            string NewAuthor = Console.ReadLine();



            _dataAccess.CreateNewPost(NewPostText, NewAuthor);

            TextFormatting.WriteLine();

            TextFormatting.MenuItems3("Blogginlägg skapat");
            Console.ReadKey();
            PageMainMenu();
        }