static void Delete() { Console.Write("请输入ID:"); int id = int.Parse(Console.ReadLine()); BlogBusinessLayert bbl = new BlogBusinessLayert(); Classandgrade cla = bbl.Query(id); bbl.Delete(cla); }
static void Delete() { Console.Write("请输入ID:"); int id = int.Parse(Console.ReadLine()); BlogBusinessLayert bbl = new BlogBusinessLayert(); Blog blog = bbl.Query(id); bbl.Delete(blog); Console.WriteLine("删除完成!"); }
static void QueryBlog() { BlogBusinessLayert bbl = new BlogBusinessLayert(); var blogs = bbl.Query(); foreach (var item in blogs) { Console.WriteLine("ID:{0} 消息:{1}", item.BlogId, item.Name); } }
static void QueryBlog() { BlogBusinessLayert bbl = new BlogBusinessLayert(); var blogs = bbl.Query(); foreach (var item in blogs) { Console.WriteLine("ID:{0} 消息:{1}", item.Classandgradeid, item.Curriculum); } }
/// <summary> /// -------这里是全部博客的列表-------- /// </summary> static void crateBlog() { Console.WriteLine("请输入一条消息!"); string name = Console.ReadLine(); Blog blog = new Blog(); blog.Name = name; BlogBusinessLayert bll = new BlogBusinessLayert(); bll.Add(blog); }
static void QueryClass() { Console.WriteLine("请输入一个课程:"); string b = Console.ReadLine(); Classandgrade cla = new Classandgrade(); cla.Curriculum = b; BlogBusinessLayert bbl = new BlogBusinessLayert(); bbl.Add(cla); }
static void Update() { Console.Write("请输入要修改的ID:"); int id = int.Parse(Console.ReadLine()); BlogBusinessLayert bbl = new BlogBusinessLayert(); Blog blog = bbl.Query(id); Console.Write("请输入要修改的消息:"); string name = Console.ReadLine(); blog.Name = name; bbl.Update(blog); }
static void Update() { Console.Write("请输入要修改的ID:"); int id = int.Parse(Console.ReadLine()); BlogBusinessLayert bbl = new BlogBusinessLayert(); Classandgrade cla = bbl.Query(id); Console.Write("请输入要修改的消息:"); string name = Console.ReadLine(); cla.Curriculum = name; bbl.Update(cla); }