提交代码
This commit is contained in:
parent
02f8f10a17
commit
c2448c36cc
|
|
@ -72,7 +72,8 @@ namespace BLL
|
||||||
string url = rootPath + arrStr[i].Replace('\\', '/');
|
string url = rootPath + arrStr[i].Replace('\\', '/');
|
||||||
string[] subUrl = url.Split('/');
|
string[] subUrl = url.Split('/');
|
||||||
string fileName = subUrl[subUrl.Count() - 1];
|
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>";
|
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 fileName = postedFile.FileName;
|
||||||
// 文件名保存的服务器路径
|
// 文件名保存的服务器路径
|
||||||
string savedFileName = GetSavedFileName(fileName).Replace('#', '-'); ;
|
string savedFileName = GetSavedFileName(fileName,owner).Replace('#', '-'); ;
|
||||||
postedFile.SaveAs(context.Server.MapPath("~/" + attachPath + "/" + savedFileName));
|
postedFile.SaveAs(context.Server.MapPath("~/" + attachPath + "/" + savedFileName));
|
||||||
|
|
||||||
string shortFileName = GetFileName(fileName);
|
string shortFileName = GetFileName(fileName);
|
||||||
|
|
@ -123,11 +123,13 @@ namespace FineUIPro.Web.AttachFile
|
||||||
return shortFileName;
|
return shortFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetSavedFileName(string fileName)
|
private string GetSavedFileName(string fileName,string owner)
|
||||||
{
|
{
|
||||||
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
|
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
|
||||||
|
if (!owner.Contains("DocAttachUrl"))
|
||||||
|
{
|
||||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||||
|
}
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,12 @@
|
||||||
SortField="DocDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd"
|
SortField="DocDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd"
|
||||||
HeaderText="编制日期" HeaderTextAlign="Center" TextAlign="Center">
|
HeaderText="编制日期" HeaderTextAlign="Center" TextAlign="Center">
|
||||||
</f:RenderField>
|
</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>
|
</Columns>
|
||||||
<Listeners>
|
<Listeners>
|
||||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,15 @@ namespace FineUIPro.Web.SysManage {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.Label lblNumber;
|
protected global::System.Web.UI.WebControls.Label lblNumber;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lbtnFileUrl 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.LinkButton lbtnFileUrl;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ToolbarSeparator1 控件。
|
/// ToolbarSeparator1 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue