//特殊处理图片子表 public List <FilesInfo> GetImageWithDetail(string strwhere) { List <FilesInfo> dals = new List <FilesInfo>(); string sql = "select * from Ananas_File where " + strwhere; SqlDataReader data = SqlServerDBHelper.GetReader(sql); while (data.Read()) { FilesInfo dal = new FilesInfo() { ID = data["ID"].ToString(), UID = data["UID"].ToString(), Name = data["Name"].ToString(), State = data["State"].ToString(), Type = data["Type"].ToString(), Extension = data["Extension"].ToString(), CreateDate = (DateTime)data["CreateDate"], Url = data["Url"].ToString(), Describe = data["Describe"].ToString(), Owner = data["Owner"].ToString(), ParentID = data["ParentID"].ToString(), IsPrivate = data["IsPrivate"].ToString(), Custom = data["Custom"].ToString(), FirstSize = this.GetFirstSize(data["Custom"].ToString()), SizeList = this.GetSizeList(data["Custom"].ToString()), Remark = data["Remark"].ToString(), CoverUrl = data["CoverUrl"].ToString() }; dals.Add(dal); } return(dals); }
public FilesInfo FirstImageOne(string sql) { DataTable dt = SqlServerDBHelper.GetDataSet(sql); if (dt.Rows.Count == 0) { return(null); } var data = dt.Select().First(); FilesInfo dal = new FilesInfo() { ID = data["ID"].ToString(), UID = data["UID"].ToString(), Name = data["Name"].ToString(), State = data["State"].ToString(), Type = data["Type"].ToString(), Extension = data["Extension"].ToString(), CreateDate = (DateTime)data["CreateDate"], Url = data["Url"].ToString(), Describe = data["Describe"].ToString(), Owner = data["Owner"].ToString(), ParentID = data["ParentID"].ToString(), IsPrivate = data["IsPrivate"].ToString(), Custom = data["Custom"].ToString(), Size = data["Custom"].ToString().Split(';'), Remark = data["Remark"].ToString(), CoverUrl = data["CoverUrl"].ToString() }; return(dal); }