锐腾搅拌上料功能
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.

154 lines
4.7 KiB

5 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using ICSSoft.Base.UserControl.MessageControl;
  6. using ICSSoft.Base.Language.Tool;
  7. using System.Windows.Forms;
  8. using ICSSoft.Base.Config.AppConfig;
  9. namespace ICSSoft.Frame.APP
  10. {
  11. public class ICSBaseSimpleCode
  12. {
  13. private static readonly int defaultTipType = 0;
  14. #region MessageBox OverriWrite
  15. /// <summary>
  16. ///
  17. /// </summary>
  18. /// <param name="info"></param>
  19. /// <returns></returns>
  20. public static void AppshowMessageBox(string info)
  21. {
  22. List<LangObj> langList = new List<LangObj>();
  23. LangObj langObj = new LangObj();
  24. langObj.LConvertString = info;
  25. langObj.LParameters = new object[] { };
  26. langList.Add(langObj);
  27. if (langList.Count > 0)
  28. {
  29. MessageDialog messBox = new MessageDialog(defaultTipType, langList);
  30. messBox.ShowDialog();
  31. return;
  32. }
  33. }
  34. /// <summary>
  35. ///
  36. /// </summary>
  37. /// <param name="info"></param>
  38. /// <returns></returns>
  39. public static void AppshowMessageBox(int TipType, string info)
  40. {
  41. List<LangObj> langList = new List<LangObj>();
  42. LangObj langObj = new LangObj();
  43. langObj.LConvertString = info;
  44. langObj.LParameters = new object[] { };
  45. langList.Add(langObj);
  46. if (langList.Count > 0)
  47. {
  48. MessageDialog messBox = new MessageDialog(TipType, langList);
  49. messBox.ShowDialog();
  50. return;
  51. }
  52. }
  53. /// <summary>
  54. ///
  55. /// </summary>
  56. /// <param name="info"></param>
  57. /// <returns></returns>
  58. public static void AppshowMessageBox(List<string> info)
  59. {
  60. List<LangObj> langList = new List<LangObj>();
  61. foreach (string str in info)
  62. {
  63. LangObj langObj = new LangObj();
  64. langObj.LConvertString = str;
  65. langObj.LParameters = new object[] { };
  66. langList.Add(langObj);
  67. }
  68. if (langList.Count > 0)
  69. {
  70. MessageDialog messBox = new MessageDialog(defaultTipType, langList);
  71. messBox.ShowDialog();
  72. return;
  73. }
  74. }
  75. /// <summary>
  76. ///
  77. /// </summary>
  78. /// <param name="info"></param>
  79. /// <returns></returns>
  80. public static void AppshowMessageBox(int TipType, List<string> info)
  81. {
  82. List<LangObj> langList = new List<LangObj>();
  83. foreach (string str in info)
  84. {
  85. LangObj langObj = new LangObj();
  86. langObj.LConvertString = str;
  87. langObj.LParameters = new object[] { };
  88. langList.Add(langObj);
  89. }
  90. if (langList.Count > 0)
  91. {
  92. ICSSoft.Base.UserControl.MessageControl.MessageDialog messBox = new MessageDialog(TipType, langList);
  93. messBox.ShowDialog();
  94. return;
  95. }
  96. }
  97. public static DialogResult AppshowMessageBoxRepose(string strinfo)
  98. {
  99. List<LangObj> langList = new List<LangObj>();
  100. LangObj obj = new LangObj();
  101. obj.LConvertString = strinfo;
  102. obj.LParameters = new object[] { };
  103. langList.Add(obj);
  104. RequestionDialog formRequestion = new RequestionDialog(langList);
  105. return formRequestion.ShowDialog();
  106. }
  107. public static DialogResult AppshowMessageBoxRepose(List<string> info)
  108. {
  109. List<LangObj> langList = new List<LangObj>();
  110. foreach (string str in info)
  111. {
  112. LangObj obj = new LangObj();
  113. obj.LConvertString = str;
  114. obj.LParameters = new object[] { };
  115. langList.Add(obj);
  116. }
  117. RequestionDialog formRequestion = new RequestionDialog(langList);
  118. return formRequestion.ShowDialog();
  119. }
  120. #endregion
  121. public static string GetWorkPointErpData()
  122. {
  123. //return AppConfig.GetDataBaseNameByConnectString(AppConfig.GetDataBaseConnectStringByKey("[DB.ERP]"));
  124. string con = AppConfig.GetDataBaseConnectStringByKey("[DB.ERP]");
  125. string conbegin = "Data Source=";
  126. int begin = con.IndexOf(conbegin);
  127. int end = con.IndexOf(";Database=");
  128. string IP = con.Substring(begin + conbegin.Length, end - begin - conbegin.Length);
  129. return "[" + IP + "]." + AppConfig.GetDataBaseNameByConnectString(con);
  130. }
  131. }
  132. }