1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using Central.Control.Domain;
- using MES.Production.Service.IService;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace MES.Production.Service.ServiceImp
- {
- /// <summary>
- /// 消息接口Service实现类
- /// Liuzq 2015-11-17
- /// </summary>
- public class MsgAttachManage : RepositoryBase<SYS_MSGATTACH>, IService.IMsgAttachManage
- {
- #region 声明容器
- /// <summary>
- /// 上传的附件
- /// </summary>
- //IUploadManage UploadManage { get; set; }
- #endregion
- /// <summary>
- /// 保存文章附件
- /// </summary>
- /// <param name="ID">消息ID</param>
- /// <param name="str">附件路径字符串</param>
- public bool SaveAttachs(string ID, string str)
- {
- try
- {
- //根据路径获取附件ID
- //var upfilelist = this.UploadManage.LoadAll(p => str.Contains(p.UPFILEPATH)).Select(p => p.ID).ToList();
- //之前没有数据,新增
- //if (upfilelist != null && upfilelist.Count > 0)
- //{
- // foreach (var item in upfilelist.Select(p => new SYS_MSGATTACH()
- // {
- // MSGID =int.Parse(ID),
- // FK_UPLOADID = p,
- // CREATEDATE = DateTime.Now,
- // }))
- // {
- // this.dbSet.Add(item);
- // }
- // this.Context.SaveChanges();
- //}
- }
- catch (Exception e)
- {
- throw e;
- }
- return true;
- }
- }
- }
|