Ejemplo n.º 1
0
 public void InsertArticle()
 {
     MySqlArticle msa = new MySqlArticle(str);
     int id = msa.Insert(new Article()
     {
         Desc = "desc",
         Kwd = "kwd",
         AuthorID = 0,
         InDate = DateTime.Now,
         CP2 = 1,
         CP1 = 5,
         CID = 8,
         Click = 0,
         Content = Guid.NewGuid().ToString() + "this is the article content ",
         Icon = "",
         Title = Guid.NewGuid().ToString(),
         Url = ""
     });
     Console.WriteLine("idx is :" + id
         );
 }
Ejemplo n.º 2
0
 public void TestartList()
 {
     MySqlArticle msa = new MySqlArticle(str);
     List<Article> list = new List<Article>();
     Article ap = new Article();
     ap.CID = 1;
     PageModel pm = msa.GetPageModelList(1, 2, ap);
     list = pm.List as List<Article>;
     foreach (Article art in list)
     {
         Console.WriteLine("idx:" + art.IDx + ", title=" + art.Title);
     }
     Console.WriteLine("TotalRecord:" + pm.TotalRecord);
     Console.WriteLine("TotalPage:" + pm.TotalPage);
     Console.WriteLine("CurrentPage:" + pm.Page);
 }
Ejemplo n.º 3
0
 public void TestUpdateArtInfo()
 {
     MySqlArticle msa = new MySqlArticle(str);
     Article art = msa.Get(17);
     Console.WriteLine(art.Title);
     art.Title = "njhtitile update ";
     msa.Update(art);
     art = msa.Get(17);
     Console.WriteLine(art.Title);
 }
Ejemplo n.º 4
0
 public void TestartInfo()
 {
     MySqlArticle msa = new MySqlArticle(str);
     Article art = msa.Get(17);
     Console.WriteLine(art.Title);
 }