Преглед изворни кода

Merge remote-tracking branch 'origin/frank' into kenric

Kenric Nugteren пре 1 година
родитељ
комит
1ea933bb1c

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

@@ -93,7 +93,8 @@ namespace Comal.Classes
         public string Description { get; set; }
 
         [NotesEditor]
-        public string Notes { get; set; }
+        [EditorSequence("Notes",1)]
+        public string[] Notes { get; set; }
         
         [EditorSequence(3)]
         public PurchaseOrderCategoryLink Category { get; set; }

+ 8 - 7
prs.desktop/Panels/Factory/FactoryPanel.xaml.cs

@@ -686,12 +686,12 @@ namespace PRSDesktop
             //).Rows.FirstOrDefault()?.ToObject<Supplier>());
             order.SupplierLink.ID = window.SupplierID;
             order.SupplierLink.Name = window.SupplierName; //supplier != null ? supplier.Name : "Unknown Supplier";
-            order.Description = string.Format("Materials Processing Request raised by {0} from Factory Floor", App.EmployeeName);
             order.RaisedBy.ID = App.EmployeeID;
             order.IssuedBy.ID = App.EmployeeID;
             order.IssuedDate = DateTime.Today;
             order.DueDate = DateTime.Today.AddDays(7);
-            new Client<PurchaseOrder>().Save(order, "Created Treatment Purchase Order");
+            new Client<PurchaseOrder>().Save(order,
+                $"Materials Processing Request raised by {App.EmployeeName} from Factory Floor");
 
             Progress.SetMessage("Processing Order");
             var orderitems = new List<PurchaseOrderItem>();
@@ -746,17 +746,18 @@ namespace PRSDesktop
                 item.Cost = (jobprice != null ? jobprice.CostPrice : stdcost) * treatment.Parameter;
 
                 var description = new List<string>();
-                description.Add(string.Format("{0} x {1} - {2}", packet.BarcodeQty, packet.Serial, packet.Title));
+                description.Add($"{packet.BarcodeQty} x {packet.Serial} - {packet.Title}");
                 var dimensions = new List<string>();
                 if (packet.Height > 0.0F)
-                    dimensions.Add(string.Format("H:{0:F2}mm", packet.Height));
+                    dimensions.Add($"H:{packet.Height:F2}mm");
                 if (packet.Width > 0.0F)
-                    dimensions.Add(string.Format("W:{0:F2}mm", packet.Width));
+                    dimensions.Add($"W:{packet.Width:F2}mm");
                 if (packet.Length > 0.0F)
-                    dimensions.Add(string.Format("L:{0:F2}mm", packet.Length));
-                dimensions.Add(string.Format("Param:{0:F4}", treatment.Parameter));
+                    dimensions.Add($"L:{packet.Length:F2}mm");
+                dimensions.Add($"Param:{treatment.Parameter:F4}");
                 if (dimensions.Any())
                     description.Add(string.Format("Dimensions: {0}", string.Join(" ", dimensions)));
+                description.Add($"Treatment: {treatment.Product.Code}: {treatment.Product.Name}");
                 item.Description = string.Join("\n", description);
 
                 orderitems.Add(item);

+ 1 - 0
prs.desktop/Panels/Factory/ManufacturingTreatmentWindow.xaml.cs

@@ -46,6 +46,7 @@ namespace PRSDesktop
         }
 
         public Guid ProductID => (Guid)Treatments.SelectedValue;
+        //public String ProductName => (Treatments.SelectedItem as KeyValuePair<Guid, String>?)?.Value ?? "";
         public Guid SupplierID => (Guid)Suppliers.SelectedValue;
         public string SupplierName => ((KeyValuePair<Guid, string>)Suppliers.SelectedItem).Value;
 

+ 2 - 2
prs.desktop/Panels/Stock Forecast/OrderScreen/StockForecastOrderingGrid.cs

@@ -263,11 +263,11 @@ public class StockForecastOrderingGrid : DynamicItemsListGrid<StockForecastOrder
     {
         _observing = observing;
     }
-    public override void DoChanged()
+    protected override void Changed()
     {
         if (_observing)
         {
-            base.DoChanged();
+            base.Changed();
         }
     }
 

+ 1 - 1
prs.shared/Database Update Scripts/Update_7_24a.cs

@@ -17,7 +17,7 @@ namespace PRS.Shared
             var pos = DbFactory.Provider.Query<PurchaseOrder>().ToObjects<PurchaseOrder>().ToList();
             foreach(var po in pos)
             {
-                po.Description = po.Description.NotWhiteSpaceOr(po.Notes);
+                po.Description = po.Description.NotWhiteSpaceOr(String.Join("\n",po.Notes ??  new String[] { }));
             }
             DbFactory.Provider.Save(pos);
             return true;