This commit is contained in:
2023-03-29 16:51:31 +08:00
128 changed files with 29873 additions and 58 deletions
+35
View File
@@ -80,6 +80,25 @@ namespace BLL
return Funs.DB.AttachFile.FirstOrDefault(e => e.ToKeyId == toKey);
}
/// <summary>
/// 根据对应主键获取文件信息
/// </summary>
/// <param name="toKey">对应主键</param>
/// <returns>文件信息</returns>
public static string GetBtnFileUrl(object toKey)
{
string fileUrl = string.Empty;
if (toKey != null)
{
Model.AttachFile file = Funs.DB.AttachFile.FirstOrDefault(e => e.ToKeyId == toKey.ToString());
if (file != null && !string.IsNullOrEmpty(file.AttachUrl))
{
string url = file.AttachUrl.Replace('\\', '/');
fileUrl = BLL.UploadAttachmentService.ShowAttachment2("../../", url);
}
}
return fileUrl;
}
/// <summary>
///
/// </summary>
@@ -149,6 +168,22 @@ namespace BLL
}
/// <summary>
///
/// </summary>
/// <param name="toKeyId"></param>
/// <param name="menuId"></param>
/// <returns></returns>
public static IList<Model.AttachFile> GetBeforeFileList(string toKeyId, string menuId)
{
List<string> listToKeyId = new List<string>();
listToKeyId.Add(toKeyId);
// listToKeyId.Add(toKeyId + "r");
//listToKeyId.Add(toKeyId + "re");
var list = Funs.DB.AttachFile.Where(p => listToKeyId.Contains(p.ToKeyId) && p.MenuId == menuId).ToList();
return list;
}
/// <summary>
///
/// </summary>
+10
View File
@@ -317,6 +317,16 @@
#endregion
#region
/// <summary>
/// 安全总监岗位Id
/// </summary>
public static string WorkPost_HSSEDirector = "8A7C2CDF-AFB5-4826-9951-343253342DAC";
/// <summary>
/// 项目安全总监岗位Id
/// </summary>
public static string WorkPost_ProjectHSSEDirector = "5e6e259e-ea0a-4a63-8f52-df4a19a6c9fa";
/// <summary>
/// HSE工程师岗位Id
/// </summary>
@@ -47,6 +47,43 @@ namespace BLL
}
#endregion
#region
/// <summary>
/// 附件显示
/// </summary>
public static string ShowAttachment2(string rootPath, string path)
{
string htmlStr = string.Empty;
if (!string.IsNullOrEmpty(path))
{
htmlStr = "<table runat='server' cellpadding='5' cellspacing='5' style=\"width: 100%\">";
string[] arrStr = path.Split(new string[] { "," }, System.StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < arrStr.Length; i++)
{
if (!string.IsNullOrEmpty(arrStr[i]))
{
string[] urlArray = arrStr[i].Split('\\');
string scanUrl = string.Empty;
for (int j = 0; j < urlArray.Length; j++)
{
scanUrl += urlArray[j] + "|";
}
string url = rootPath + arrStr[i].Replace('\\', '/');
string[] subUrl = url.Split('/');
string fileName = subUrl[subUrl.Count() - 1];
string newFileName = fileName.Substring(fileName.IndexOf("_") + 1);
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 += "</table>";
}
return htmlStr;
}
#endregion
#region
/// <summary>
/// 附件显示