You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.2 KiB

  1. namespace CounsellorBL.GROUP
  2. {
  3. using CounsellorBL.Common;
  4. using CounsellorBL.Helper;
  5. using Newtonsoft.Json;
  6. using Newtonsoft.Json.Linq;
  7. using OT.COM.ArsenalDB;
  8. using OT.COM.LogisticsUtil;
  9. using OT.COM.SignalerMessage;
  10. using SoldierData.EnterprizeV4;
  11. using System;
  12. using System.Collections.Generic;
  13. using System.Linq;
  14. class ArticleMediaService : SingleDataTableTemplate<tb_grp_article_media>
  15. {
  16. public ArticleMediaService()
  17. {
  18. dgReadCommandPostDataHandler = readCommandPostDataHandler;
  19. }
  20. [Auth(false)]
  21. public new CResponseMessage Read(CRequestMessage i_crmInput) => base.Read(i_crmInput);
  22. protected string readCommandPostDataHandler(CRequestMessage i_crmInput, ArsenalInterface i_aiArsenal, Command i_cCmd, JArray i_jaData, tb_sys_session i_sSessionUser, out object o_oReault,
  23. [System.Runtime.CompilerServices.CallerLineNumber] int i_nCodeLine = 0,
  24. [System.Runtime.CompilerServices.CallerMemberName] string i_sMemberName = "",
  25. [System.Runtime.CompilerServices.CallerFilePath] string i_sSourcePath = "")
  26. {
  27. string sMsg = null;
  28. object oResultData = null;
  29. try
  30. {
  31. do
  32. {
  33. List<tb_grp_article_media> qds = i_aiArsenal.RunQueryList<tb_grp_article_media>(i_cCmd);
  34. if (!i_cCmd.IsSuccess)
  35. {
  36. sMsg = i_cCmd.LastErrorCode;
  37. break;
  38. }
  39. oResultData = qds.OrderBy(x => x.seq);
  40. }
  41. while (false);
  42. }
  43. catch (Exception ex)
  44. {
  45. LogHelper.DBLog(Util.GetLastExceptionMsg(ex), i_nCodeLine, i_sMemberName, i_sSourcePath);
  46. sMsg = $"{nameof(readCommandPostDataHandler)} unknwon exception. i_crmInput={JsonConvert.SerializeObject(i_crmInput)}. Call from {i_sMemberName} {i_sSourcePath}({i_nCodeLine}).";
  47. #if DEBUG
  48. System.Diagnostics.Debug.WriteLine(sMsg);
  49. #endif
  50. }
  51. o_oReault = oResultData;
  52. return sMsg;
  53. }
  54. }
  55. }