示例#1
0
        //删除帖子
        static void DeletePost()
        {
            BloBussinessLayer bbl = new BloBussinessLayer();

            Console.WriteLine("请输入要删除的帖子:");
            int  id   = int.Parse(Console.ReadLine());
            Post post = bbl.Querypost(id);

            bbl.Delete(post);
        }
示例#2
0
        //删除
        static void Delete()
        {
            BloBussinessLayer bbl = new BloBussinessLayer();

            Console.WriteLine("请输入id");
            int       id = int.Parse(Console.ReadLine());
            ClassName CN = bbl.Query(id);

            bbl.Delete(CN);
        }
示例#3
0
        //显示全部博客
        static void QueryClassName()
        {
            BloBussinessLayer bbl = new BloBussinessLayer();
            var ClassNames        = bbl.Query();

            foreach (var item in ClassNames)
            {
                Console.Write(item.ClassNameId + " ");
                Console.WriteLine(item.Name);
            }
        }
示例#4
0
        //增加
        static void createClassName()
        {
            Console.WriteLine("输入一个班级名称");
            string    name = Console.ReadLine();
            ClassName CN   = new ClassName();

            CN.Name = name;
            BloBussinessLayer bbl = new BloBussinessLayer();

            bbl.Add(CN);
        }
示例#5
0
        //显示全部博客
        static void QueryBlog()
        {
            BloBussinessLayer bbl = new BloBussinessLayer();
            var blogs             = bbl.Query();

            foreach (var item in blogs)
            {
                Console.Write(item.BlogId + " ");
                Console.WriteLine(item.Name);
            }
        }
示例#6
0
        //增加--交互
        static void createBlog()
        {
            Console.WriteLine("请输入一个博客名称");
            string name = Console.ReadLine();
            Blog   blog = new Blog();

            blog.Name = name;
            BloBussinessLayer bbl = new BloBussinessLayer();

            bbl.Add(blog);
        }
示例#7
0
        //更新
        static void Update()
        {
            Console.WriteLine("请输入ID:");
            int id = int.Parse(Console.ReadLine());
            BloBussinessLayer bbl = new BloBussinessLayer();
            ClassName         CN  = bbl.Query(id);

            Console.WriteLine("请输入新名字:");
            string name = Console.ReadLine();

            CN.Name = name;
            bbl.Update(CN);
        }
示例#8
0
        //新增帖子
        static void createPost(int blogId)
        {
            Console.WriteLine("请创建新帖子:");
            string title = Console.ReadLine();

            Console.WriteLine("请输入帖子的内容");
            string content = Console.ReadLine();
            Post   post    = new Post();

            post.BlogId  = blogId;
            post.Title   = title;
            post.Content = content;
            BloBussinessLayer bbl = new BloBussinessLayer();

            bbl.Add(post);
        }
示例#9
0
        //更新帖子
        static void UpdatePost()
        {
            Console.WriteLine("输入帖子Id:");
            int id = int.Parse(Console.ReadLine());
            BloBussinessLayer bbl = new BloBussinessLayer();
            Post post             = bbl.Querypost(id);

            Console.WriteLine("输入新的帖子:");
            string content = Console.ReadLine();
            string title   = Console.ReadLine();

            //int blogId = int.Parse(Console.ReadLine());
            //post.BlogId = blogId;
            post.Title   = title;
            post.Content = content;
            bbl.Update(post);
        }