提交代码
This commit is contained in:
parent
02f8f10a17
commit
c2448c36cc
|
|
@ -72,7 +72,8 @@ namespace BLL
|
|||
string url = rootPath + arrStr[i].Replace('\\', '/');
|
||||
string[] subUrl = url.Split('/');
|
||||
string fileName = subUrl[subUrl.Count() - 1];
|
||||
string newFileName = fileName.Substring(fileName.IndexOf("_") + 1);
|
||||
//string newFileName = fileName.Substring(fileName.IndexOf("_") + 1);
|
||||
string newFileName = fileName;
|
||||
htmlStr += "<tr><td style=\"width: 60%\" align=\"left\"><span style='cursor:pointer;cursor:pointer;cursor:pointer;TEXT-DECORATION: underline;color:blue' onclick=\"window.open('" + url + "')\">" + newFileName + "</span></td>";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace FineUIPro.Web.AttachFile
|
|||
// 文件名完整路径
|
||||
string fileName = postedFile.FileName;
|
||||
// 文件名保存的服务器路径
|
||||
string savedFileName = GetSavedFileName(fileName).Replace('#', '-'); ;
|
||||
string savedFileName = GetSavedFileName(fileName,owner).Replace('#', '-'); ;
|
||||
postedFile.SaveAs(context.Server.MapPath("~/" + attachPath + "/" + savedFileName));
|
||||
|
||||
string shortFileName = GetFileName(fileName);
|
||||
|
|
@ -123,11 +123,13 @@ namespace FineUIPro.Web.AttachFile
|
|||
return shortFileName;
|
||||
}
|
||||
|
||||
private string GetSavedFileName(string fileName)
|
||||
private string GetSavedFileName(string fileName,string owner)
|
||||
{
|
||||
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
|
||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||
|
||||
if (!owner.Contains("DocAttachUrl"))
|
||||
{
|
||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||
}
|
||||
return fileName;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,12 @@
|
|||
SortField="DocDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd"
|
||||
HeaderText="编制日期" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:TemplateField ColumnID="AttachFile" Width="150px" HeaderText="附件" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lbtnFileUrl" runat="server" CssClass="ItemLink"
|
||||
Text='<%# BLL.AttachFileService.GetBtnFileUrl(Eval("DocId")) %>' ToolTip="附件查看"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
|
|
|
|||
|
|
@ -93,6 +93,15 @@ namespace FineUIPro.Web.SysManage {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumber;
|
||||
|
||||
/// <summary>
|
||||
/// lbtnFileUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtnFileUrl;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue