BizComponent_MFN.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. //using MediII.Adapter.BaseBiz;
  6. using MediII.Common;
  7. using Microsoft.Practices.EnterpriseLibrary.Data;
  8. using MediII.Adapter.BizComponent.Base;
  9. namespace MediII.Adapter.BizComponent.MFN
  10. {
  11. public class BizComponent_MFN : BaseBizComponent, IBizComponent
  12. {
  13. //数据库连接
  14. protected Database ctx
  15. {
  16. get { return base.ctx; }
  17. }
  18. public override string DoProcess(string m,string msgType)
  19. {
  20. try
  21. {
  22. try
  23. {
  24. //根据不同的类型再分开不同的类处理
  25. MFNBase processor = MFNBase.GetProcessor("MFN^Z2B", ctx);//
  26. int result = processor.Process(m);
  27. return string.Empty;
  28. //string ack = SetACK(m, "ACK", mType, "ACK");
  29. //return ack;
  30. }
  31. catch (Exception ex)
  32. {
  33. if (ex.InnerException == null)
  34. {
  35. return ex.Message;
  36. }
  37. else
  38. {
  39. return ex.Message + " InnerException:" + ex.InnerException.Message;
  40. }
  41. }
  42. }
  43. catch (Exception ex)
  44. {
  45. //var tmp = ex.EntityValidationErrors.FirstOrDefault().ValidationErrors;
  46. //string errString = "";
  47. //foreach (var item in tmp)
  48. //{
  49. // errString += item.ErrorMessage;
  50. //}
  51. //string ack = SetACK(m, "ACK", mType, "ACK", ex.EntityValidationErrors.ToString());
  52. //throw new Exception(string.Format("{0}\r\n{1}", ex.EntityValidationErrors.ToString()));
  53. return ex.Message;
  54. }
  55. }
  56. }
  57. }