Browse Source

Refactored EqualsWthTolerance() into IsEffectivelyEqual()
Improved Digital Form Report Generation Code

frogsoftware 1 year ago
parent
commit
c9fba41277

+ 2 - 5
InABox.Core/CoreUtils.cs

@@ -95,10 +95,7 @@ namespace InABox.Core
     public static class CoreUtils
     {
 
-        public static bool EqualsWithTolerance(this double value, double other, double tolerance = 0.0001)
-        {
-            return Math.Abs(value - other) < tolerance;
-        }
+
         
         private static readonly List<Type> entities = new List<Type>();
 
@@ -1797,7 +1794,7 @@ namespace InABox.Core
         }
 
 
-        public static bool IsEffectivelyEqual(double a, double b, double threshold = 0.00001F)
+        public static bool IsEffectivelyEqual(this double a, double b, double threshold = 0.00001F)
         {
             return Math.Abs(a - b) < threshold;
         }

+ 7 - 4
inabox.wpf/DigitalForms/DigitalFormUtils.cs

@@ -3,8 +3,8 @@ using System.Collections.Generic;
 using System.Drawing;
 using System.Linq;
 using System.Text.RegularExpressions;
+using System.Windows.Forms;
 using FastReport;
-using FastReport.Data;
 using FastReport.Table;
 using FastReport.Utils;
 using InABox.Core;
@@ -432,7 +432,8 @@ namespace InABox.DynamicGrid
                             var picture = new PictureObject
                             {
                                 DataColumn = dataColumn,
-                                Dock = System.Windows.Forms.DockStyle.Fill
+                                Dock = DockStyle.Fill,
+                                Padding = new Padding(5,5,5,5)
                             };
                             cell.AddChild(picture);
 
@@ -443,7 +444,8 @@ namespace InABox.DynamicGrid
                             var image = new MultiImageObject
                             {
                                 DataColumn = dataColumn,
-                                Dock = System.Windows.Forms.DockStyle.Fill
+                                Dock = DockStyle.Fill,
+                                Padding = new Padding(5,5,5,5)
                             };
                             cell.AddChild(image);
 
@@ -454,7 +456,8 @@ namespace InABox.DynamicGrid
                             var image = new MultiSignatureObject
                             {
                                 DataColumn = dataColumn,
-                                Dock = System.Windows.Forms.DockStyle.Fill
+                                Dock = DockStyle.Fill,
+                                Padding = new Padding(5,5,5,5)
                             };
                             cell.AddChild(image);
 

+ 1 - 1
inabox.wpf/Reports/CustomObjects/MultiItemObject.cs

@@ -1,5 +1,4 @@
 using FastReport;
-using FastReport.DevComponents.DotNetBar;
 using FastReport.Utils;
 using InABox.Core;
 using System;
@@ -11,6 +10,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
+using System.Windows.Forms;
 using HorizontalAlignment = System.Windows.HorizontalAlignment;
 
 namespace InABox.Wpf.Reports.CustomObjects