/// <summary> /// 读取文件 /// </summary> /// <param name="file"></param> /// <returns></returns> public byte[] GetFile(VersionFileDataContract file) { byte[] result = null; string sql = "select file_data from VERSION_FILE where obj_no = '{0}' "; sql = string.Format(sql, file.GuidNo); object value = databaseMan.ExecuteScalar(sql); if (value != null) { result = (byte[])value; } return(result); }
/// <summary> /// 得到要下载的清单 /// </summary> /// <param name="ProductCode"></param> /// <param name="VersionNo"></param> /// <returns></returns> public List <VersionFileDataContract> GetDownLoadList(string ProductCode, string VersionNo) { List <VersionFileDataContract> result = new List <VersionFileDataContract>(); string sql = "select * from VERSION_FILE where product_code = '{0}' and version = '{1}'"; sql = string.Format(sql, ProductCode, VersionNo); DataSet ds = this.databaseMan.ExecuteDataSet(sql); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows) { VersionFileDataContract versionFile = new VersionFileDataContract(); versionFile.GuidNo = row["obj_no"].ToString(); versionFile.ProductCode = row["product_code"].ToString(); versionFile.Version = row["version"].ToString(); versionFile.FileName = row["file_name"].ToString(); versionFile.FilePath = row["file_path"].ToString(); result.Add(versionFile); } } return(result); }