纽威
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.

113 lines
3.8 KiB

3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
  1. using NFine.Data.Extensions;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using NFine.Code;
  9. using NFine.Repository;
  10. using System.Data.Common;
  11. using NFine.Domain._03_Entity.SRM;
  12. using ICS.Application.Entity;
  13. using Newtonsoft.Json;
  14. using System.Configuration;
  15. using System.Data.SqlClient;
  16. using ICS.Data;
  17. using Newtonsoft.Json.Linq;
  18. namespace NFine.Application.WMS
  19. {
  20. public class PrintApp : RepositoryFactory<ICSVendor>
  21. {
  22. public DataTable GetLableType()
  23. {
  24. string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(',');
  25. string sql = @"
  26. select '' as F_ItemCode,'' as F_ItemName
  27. union all
  28. SELECT DISTINCT a.F_ItemCode,isnull(a.F_ItemName,'') as F_ItemName FROM dbo.Sys_SRM_ItemsDetail a left join Sys_SRM_Items b on a.F_ItemId=b.F_Id where b.F_EnCode='BQ001'";
  29. string role = NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode;
  30. DataTable dt = SqlHelper.GetDataTableBySql(sql);
  31. return dt;
  32. }
  33. public DataTable GetLableSourceID()
  34. {
  35. string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(',');
  36. string sql = @"
  37. select '' as ID,'' as SourceName
  38. union all
  39. select distinct ID,SourceName from Sys_LableDataSource";
  40. string role = NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode;
  41. DataTable dt = SqlHelper.GetDataTableBySql(sql);
  42. return dt;
  43. }
  44. public DataTable GetSys_LablesID(string LableType)
  45. {
  46. string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(',');
  47. string sql = @"
  48. select '' as ID,'' as LableName
  49. union all
  50. select distinct ID,LableName from Sys_Lables where LableType='{0}'";
  51. sql = string.Format(sql, LableType);
  52. string role = NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode;
  53. DataTable dt = SqlHelper.GetDataTableBySql(sql);
  54. return dt;
  55. }
  56. public DataTable SelectColumnName(string BeginTime, string EndTime)
  57. {
  58. string sql = @"select ColCode, ColName from ICSExtensionEnable
  59. where Enable=1
  60. order by cast(EATTRIBUTE1 as int)";
  61. DataTable dt = SqlHelper.GetDataTableBySql(sql);
  62. return dt;
  63. }
  64. public string GetCnValue(string Code)
  65. {
  66. try
  67. {
  68. object MultipleLanguageSetting = GetMultipleLanguageSetting();
  69. string content = "";
  70. string sql = string.Format(@"select {1} from Sys_Language where Code='{0}'", Code, MultipleLanguageSetting);
  71. DataTable dt = SqlHelper.GetDataTableBySql(sql);
  72. if (dt != null && dt.Rows.Count > 0)
  73. {
  74. content = dt.Rows[0]["" + MultipleLanguageSetting + ""].ToString().ToUpper();
  75. }
  76. else
  77. {
  78. content = "";
  79. }
  80. return content;
  81. }
  82. catch (Exception ex)
  83. {
  84. throw new Exception(ex.Message.ToString());
  85. }
  86. }
  87. public object GetMultipleLanguageSetting()
  88. {
  89. try
  90. {
  91. string sql = string.Format(@"select top 1 b.F_Define1
  92. from Sys_SRM_Items a left join Sys_SRM_ItemsDetail b on a.F_Id=b.F_ItemId
  93. where a.F_EnCode='LGG0001' and b.F_EnabledMark='1' order by b.F_ItemCode");
  94. object MultipleLanguageSetting = SqlHelper.ExecuteScalar(sql);
  95. return MultipleLanguageSetting;
  96. }
  97. catch (Exception ex)
  98. {
  99. throw new Exception(ex.Message.ToString());
  100. }
  101. }
  102. }
  103. }