public static List <Recomment> GetToUploadList() { List <Recomment> list = new List <Recomment>(); try { ISelectDataSourceFace query = new SelectSQL(TableName.Recomment); query.DataBaseAlias = Const.LogConnection; query.AddWhere("ImageStatus", ImageStatus.Local); DataSet ds = query.ExecuteDataSet(); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { list.AddRange(from DataRow dr in ds.Tables[0].Rows select new Recomment() { BlogId = SafeValueHelper.ToInt32(dr["BlogId"]), Category = (RecommentCategory)SafeValueHelper.ToInt32(dr["Category"]), CoverName = SafeValueHelper.ToString(dr["CoverName"]), Id = SafeValueHelper.ToInt32(dr["Id"]), Title = SafeValueHelper.ToString(dr["Title"]), }); } } catch (Exception ex) { Logger.Error(ex); } return(list); }
public static List <ImageUrl> GetToUploadList() { List <ImageUrl> list = new List <ImageUrl>(); try { ISelectDataSourceFace query = new SelectSQL(TableName.ImageUrl); query.DataBaseAlias = Const.LogConnection; query.AddWhere("ImageStatus", ImageStatus.Local); DataSet ds = query.ExecuteDataSet(); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { list.AddRange(from DataRow dr in ds.Tables[0].Rows select new ImageUrl() { BlogId = SafeValueHelper.ToInt32(dr["BlogId"]), Url = SafeValueHelper.ToString(dr["Url"]), Id = SafeValueHelper.ToInt32(dr["Id"]) }); } } catch (Exception ex) { Logger.Error(ex); } return(list); }
private static DataSet GetAccountDataSet() { try { ISelectDataSourceFace query = new SelectSQL("UploadAccount"); query.DataBaseAlias = "LogConnection"; query.AddWhere("Enabled", true); return(query.ExecuteDataSet()); } catch (Exception ex) { Logger.Error(ex); return(null); } }