فهرست منبع

pref: 优化自定义函数

zhengjie 1 سال پیش
والد
کامیت
5e5c40a775
3فایلهای تغییر یافته به همراه11 افزوده شده و 5 حذف شده
  1. 8 4
      Common/FastReportScript.cs
  2. 2 0
      Forms/SettlementChecklist.cs
  3. 1 1
      HeFeiMI.csproj

+ 8 - 4
Common/FastReportScript.cs

@@ -6,7 +6,7 @@ using System.Text;
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 
-namespace AnHuiMI.Common
+namespace PTMedicalInsurance.Common
 {
     public class FastReportFunction
     {
@@ -39,10 +39,14 @@ namespace AnHuiMI.Common
 
         public static void Register()
         {
-            MethodInfo method = typeof(FastReportFunction).GetMethod("moneyToChinese");
-            if(method != null)
+            
+            Type funType = typeof(FastReportFunction);
+
+            MethodInfo method = funType.GetMethod("moneyToChinese");
+            if(!FastReport.Utils.RegisteredObjects.IsTypeRegistered(funType) && method != null)
             {
-                FastReport.Utils.RegisteredObjects.AddFunction(method, "Custom");
+                FastReport.Utils.RegisteredObjects.Add(funType, "Functions,CustomFunctions",0x34);
+                FastReport.Utils.RegisteredObjects.AddFunction(method, "CustomFunctions");
             }
             
         }

+ 2 - 0
Forms/SettlementChecklist.cs

@@ -295,6 +295,8 @@ namespace PTMedicalInsurance.Forms
         {
             try
             {
+                FastReportFunction.Register();
+
                 string chineseSimpleFrl = Global.curEvt.path + @"\Chinese (Simplified).frl";
                 FastReport.Utils.Res.LoadLocale(chineseSimpleFrl);
 

+ 1 - 1
HeFeiMI.csproj

@@ -7,7 +7,7 @@
     <ProjectGuid>{E9B4D618-13F0-4864-9C4C-28B8A6532653}</ProjectGuid>
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>AnHuiMI</RootNamespace>
+    <RootNamespace>PTMedicalInsurance</RootNamespace>
     <AssemblyName>AnHuiMI</AssemblyName>
     <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>