MsgAttachManage.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Central.Control.Domain;
  2. using MES.Production.Service.IService;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. namespace MES.Production.Service.ServiceImp
  8. {
  9. /// <summary>
  10. /// 消息接口Service实现类
  11. /// Liuzq 2015-11-17
  12. /// </summary>
  13. public class MsgAttachManage : RepositoryBase<SYS_MSGATTACH>, IService.IMsgAttachManage
  14. {
  15. #region 声明容器
  16. /// <summary>
  17. /// 上传的附件
  18. /// </summary>
  19. //IUploadManage UploadManage { get; set; }
  20. #endregion
  21. /// <summary>
  22. /// 保存文章附件
  23. /// </summary>
  24. /// <param name="ID">消息ID</param>
  25. /// <param name="str">附件路径字符串</param>
  26. public bool SaveAttachs(string ID, string str)
  27. {
  28. try
  29. {
  30. //根据路径获取附件ID
  31. //var upfilelist = this.UploadManage.LoadAll(p => str.Contains(p.UPFILEPATH)).Select(p => p.ID).ToList();
  32. //之前没有数据,新增
  33. //if (upfilelist != null && upfilelist.Count > 0)
  34. //{
  35. // foreach (var item in upfilelist.Select(p => new SYS_MSGATTACH()
  36. // {
  37. // MSGID =int.Parse(ID),
  38. // FK_UPLOADID = p,
  39. // CREATEDATE = DateTime.Now,
  40. // }))
  41. // {
  42. // this.dbSet.Add(item);
  43. // }
  44. // this.Context.SaveChanges();
  45. //}
  46. }
  47. catch (Exception e)
  48. {
  49. throw e;
  50. }
  51. return true;
  52. }
  53. }
  54. }