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); }
private static List <UploadAccount> GetAccountList() { List <UploadAccount> list = new List <UploadAccount>(); DataSet ds = GetAccountDataSet(); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { UploadAccount model = new UploadAccount { AccessKey = dr["AccessKey"].ToString(), AlbumId = dr["AlbumId"].ToString(), SecretKey = dr["SecretKey"].ToString(), Email = dr["Email"].ToString(), Id = SafeValueHelper.ToInt32(dr["Id"]), Mobile = dr["Mobile"].ToString(), NickName = dr["NickName"].ToString(), OpenKey = SafeValueHelper.ToString(dr["OpenKey"]), Password = dr["Password"].ToString(), RegisterTime = SafeValueHelper.ToDateTime(dr["RegisterTime"]) }; list.Add(model); } } 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); }