全局处理问题:public static Model.SGGLDB db = Funs.DB;
This commit is contained in:
@@ -12,7 +12,7 @@ namespace BLL
|
||||
{
|
||||
public static class AttachFileService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加附件存储信息
|
||||
@@ -20,6 +20,7 @@ namespace BLL
|
||||
/// <param name="workArea"></param>
|
||||
public static void AddAttachFile(Model.AttachFile attachFile)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.AttachFile));
|
||||
Model.AttachFile newAttachFile = new Model.AttachFile();
|
||||
newAttachFile.AttachFileId = newKeyID;
|
||||
@@ -38,6 +39,7 @@ namespace BLL
|
||||
/// <param name="workArea"></param>
|
||||
public static void updateAttachFile(Model.AttachFile attachFile)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.AttachFile newAttachFile = db.AttachFile.FirstOrDefault(x => x.AttachFileId == attachFile.AttachFileId);
|
||||
newAttachFile.ToKeyId = attachFile.ToKeyId;
|
||||
newAttachFile.AttachSource = attachFile.AttachSource;
|
||||
@@ -53,6 +55,7 @@ namespace BLL
|
||||
/// <param name="workAreaId"></param>
|
||||
public static void DeleteAttachFile(string rootPath, string toKeyId, string menuId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.AttachFile att = db.AttachFile.FirstOrDefault(e => e.ToKeyId == toKeyId && e.MenuId == menuId);
|
||||
if (att != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user