예제 #1
0
        public static bool UpdateViewPost(this SqlContext context, ViewPostHelperClass mo)
        {
            context.ViewPost.Update(mo);
            var count = context.SaveChanges();

            return(count == 1);
        }
예제 #2
0
 public static bool UpdateViewPost(ViewPostHelperClass mo)
 {
     using (var conn = GetDbConnection())
     {
         var count = conn.Execute("UPDATE ViewPostHelperClass SET Post=?,viewTime=? WHERE epId=?;", mo.Post, DateTime.Now.ToLocalTime(), mo.epId);
         if (count == 1)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
예제 #3
0
 public static bool AddViewPost(ViewPostHelperClass mo)
 {
     using (var conn = GetDbConnection())
     {
         // 受影响行数。
         var count = conn.Insert(mo);
         if (count == 1)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }