コード例 #1
0
 public static int ExistContinutedRecord(string resourceId, ResourceType type)
 {
     try
     {
         ISelectDataSourceFace query = new SelectSQL(TableName.ResourceRecord);
         query.DataBaseAlias = Const.LogConnection;
         query.SelectColumn("BlogId");
         query.AddWhere("ResourceId", resourceId.Trim());
         query.AddWhere("ResourceType", (int)type);
         query.AddWhere("Continued", true);
         return(SafeValueHelper.ToInt32(query.ExecuteScalar()));
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(0);
     }
 }
コード例 #2
0
 public static int GetFetchId(ResourceType type)
 {
     try
     {
         ISelectDataSourceFace query = new SelectSQL(TableName.FetchRecord);
         query.DataBaseAlias = Const.LogConnection;
         query.SelectColumn("Id");
         query.AddWhere("ResourceType", (int)type);
         query.AddOrderBy("Id", Sort.Descending);
         query.Top = 1;
         return(SafeValueHelper.ToInt32(query.ExecuteScalar()));
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(0);
     }
 }