瀏覽代碼

Added exception handling to Certificate engine and fixed PurchaseOrderItems RequiredColumns.

Kenric Nugteren 2 年之前
父節點
當前提交
f8bc21bfd3

+ 1 - 0
prs.classes/Entities/Product/ProductDimensions/ProductDimensions.cs

@@ -7,6 +7,7 @@ namespace Comal.Classes
     {
         [EditorSequence(1)]
         [Caption("Sizing", IncludePath = false)]
+        [RequiredColumn]
         public override ProductDimensionUnitLink Unit { get; set; }
         
         [DoubleEditor(Visible = Visible.Hidden)]

+ 2 - 1
prs.classes/Entities/Product/ProductLink.cs

@@ -35,7 +35,8 @@ namespace Comal.Classes
         [NullEditor]
         [Obsolete("Replaced with Dimensions", false)]
         public ProductUOMLink Units { get; set; }
-        
+
+        [RequiredColumn]
         public ProductDimensions Dimensions { get; set; }
 
         public ProductGroupLink Group { get; set; }

+ 2 - 1
prs.classes/Entities/PurchaseOrder/PurchaseOrderItem.cs

@@ -51,6 +51,7 @@ namespace Comal.Classes
         
         [EntityRelationship(DeleteAction.SetNull)]
         [EditorSequence(1)]
+        [RequiredColumn]
         public ProductLink Product { get; set; }
 
         [EntityRelationship(DeleteAction.SetNull)]
@@ -224,7 +225,7 @@ namespace Comal.Classes
                 CoreUtils.SetPropertyValue(this, col, after);
                 if (size.IsEqualTo(name))
                     ExTax = Qty * (double)after * Cost;
-            }            
+            }
             
             else if (style.IsParentOf(name))
             {

+ 14 - 7
prs.server/Engines/Certificate/CertificateEngine.cs

@@ -223,15 +223,22 @@ namespace PRSServer
 
         private void DoTheWork()
         {
-            Logger.Send(LogType.Information, "", "** DOING WORKING *****************************************");
-            Logger.Send(LogType.Information, "", $"DNS Names:  {Properties.DomainNames}");
+            try
+            {
+                Logger.Send(LogType.Information, "", "** DOING WORKING *****************************************");
+                Logger.Send(LogType.Information, "", $"DNS Names:  {Properties.DomainNames}");
 
-            var acmeUrl = new Uri(Properties.CaUrl);
-            using var acme = new AcmeProtocolClient(acmeUrl, usePostAsGet: true);
+                var acmeUrl = new Uri(Properties.CaUrl);
+                using var acme = new AcmeProtocolClient(acmeUrl, usePostAsGet: true);
 
-            ClearAuthorizations(acme).Wait();
-            var task = DoTheWorkAsync(acme);
-            task.Wait();
+                ClearAuthorizations(acme).Wait();
+                var task = DoTheWorkAsync(acme);
+                task.Wait();
+            }
+            catch(Exception e)
+            {
+                Logger.Send(LogType.Error, "", CoreUtils.FormatException(e));
+            }
         }
 
         private async Task ClearAuthorizations(AcmeProtocolClient acme)