コード例 #1
0
 public static bool InitialFetchRecord(ResourceType type)
 {
     try
     {
         IInsertDataSourceFace query = new InsertSQL(TableName.FetchRecord);
         query.DataBaseAlias = Const.LogConnection;
         query.AddFieldValue("ResourceType", (int)type);
         query.AddFieldValue("FetchCount", 0);
         query.AddFieldValue("RequestCount", 0);
         query.AddFieldValue("TimeStamp", DateTime.Now);
         return(query.ExecuteNonQuery() > 0);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(false);
     }
 }
コード例 #2
0
 public static bool AddResourceRecord(int blogId, string resourceId, ResourceType type, bool continuted = false)
 {
     try
     {
         IInsertDataSourceFace query = new InsertSQL(TableName.ResourceRecord);
         query.DataBaseAlias = Const.LogConnection;
         query.AddFieldValue("BlogId", blogId);
         query.AddFieldValue("ResourceId", resourceId.Trim());
         query.AddFieldValue("ResourceType", (int)type);
         query.AddFieldValue("Continued", continuted);
         return(query.ExecuteNonQuery() > 0);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(false);
     }
 }
コード例 #3
0
 public static bool Add(ImageUrl image)
 {
     try
     {
         IInsertDataSourceFace query = new InsertSQL(TableName.ImageUrl);
         query.DataBaseAlias = Const.LogConnection;
         query.AddFieldValue("BlogId", image.BlogId);
         query.AddFieldValue("Url", image.Url);
         query.AddFieldValue("TimeStamp", DateTime.Now);
         query.AddFieldValue("YunUrl", image.YunUrl);
         query.AddFieldValue("ImageStatus", image.ImageStatus);
         return(query.ExecuteNonQuery() > 0);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(false);
     }
 }
コード例 #4
0
 public static bool Add(Recomment recomment)
 {
     try
     {
         IInsertDataSourceFace query = new InsertSQL(TableName.Recomment);
         query.DataBaseAlias = Const.LogConnection;
         query.AddFieldValue("Title", recomment.Title);
         query.AddFieldValue("BlogId", recomment.BlogId);
         query.AddFieldValue("Category", recomment.Category);
         query.AddFieldValue("CoverName", recomment.CoverName);
         query.AddFieldValue("TimeStamp", DateTime.Now);
         query.AddFieldValue("YunUrl", recomment.YunUrl);
         query.AddFieldValue("ImageStatus", recomment.ImageStatus);
         return(query.ExecuteNonQuery() > 0);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(false);
     }
 }