修改WBS基础库内容
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using WIA;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using WIA;
|
||||
|
||||
namespace FineUIPro.Web.AttachFile
|
||||
{
|
||||
@@ -240,6 +240,7 @@ namespace FineUIPro.Web.AttachFile
|
||||
/// <returns></returns>
|
||||
private JArray SourceData()
|
||||
{
|
||||
|
||||
if (Session[sessionName] == null && !string.IsNullOrEmpty(ToKeyId))
|
||||
{
|
||||
//Session[sessionName] = new JArray();
|
||||
@@ -334,7 +335,75 @@ namespace FineUIPro.Web.AttachFile
|
||||
DeleteRow(e.RowID);
|
||||
BindGrid();
|
||||
}
|
||||
if (e.CommandName == "Preview")
|
||||
{
|
||||
JArray source = GetSourceData();
|
||||
for (int i = 0, count = source.Count; i < count; i++)
|
||||
{
|
||||
JObject item = source[i] as JObject;
|
||||
if (item.Value<string>("id") == e.RowID)
|
||||
{
|
||||
try
|
||||
{
|
||||
string savedName = item.Value<string>("savedName");
|
||||
string folder = item.Value<string>("folder");
|
||||
string xnUrl = AttachPath + "\\" + savedName;
|
||||
if (!string.IsNullOrEmpty(folder))
|
||||
{
|
||||
xnUrl = folder + savedName;
|
||||
}
|
||||
|
||||
string url = Funs.RootPath + xnUrl;
|
||||
if (savedName.Contains("FileUpLoad"))
|
||||
{
|
||||
url = Funs.RootPath + savedName.Replace('/', '\\');
|
||||
}
|
||||
FileInfo info = new FileInfo(url);
|
||||
if (!info.Exists || string.IsNullOrEmpty(savedName))
|
||||
{
|
||||
url = Funs.RootPath + "Images//Null.jpg";
|
||||
info = new FileInfo(url);
|
||||
}
|
||||
var FiletExtension = Path.GetExtension(savedName);
|
||||
bool isSupportType = AttachFileService.IsSupportFileType(FiletExtension);
|
||||
if (isSupportType)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", url, "查看 -")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("不支持预览", MessageBoxIcon.Warning);
|
||||
|
||||
}
|
||||
//if (FiletExtension == ".docx" || FiletExtension == ".pdf")
|
||||
//{
|
||||
// string httpUrl = BLL.AsposeWordHelper.WordToHtml(url);
|
||||
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", httpUrl, "查看 -")));
|
||||
|
||||
//}
|
||||
//else if (FiletExtension == ".txt")
|
||||
//{
|
||||
|
||||
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", url, "查看 -")));
|
||||
//}
|
||||
//else if (FiletExtension == ".xls")
|
||||
//{
|
||||
// string httpUrl = BLL.AsposeWordHelper.PriviewExcel(url);
|
||||
|
||||
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", httpUrl, "查看 -")));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// ShowNotify("不支持预览", MessageBoxIcon.Warning);
|
||||
//}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.CommandName == "Attach")
|
||||
{
|
||||
JArray source = GetSourceData();
|
||||
@@ -393,7 +462,7 @@ namespace FineUIPro.Web.AttachFile
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user