Procházet zdrojové kódy

PRS DESKTOP - minor bug fixes (random errors being caught when strict error filter on)

Nick-PRSDigital@bitbucket.org před 2 roky
rodič
revize
5b854b80a4

+ 2 - 1
prs.desktop/Forms/AssignmentView2.xaml.cs

@@ -458,7 +458,8 @@ namespace PRSDesktop
         {
             try
             {
-                Bookings.DaysViewSettings.TimeInterval = IntervalToTimeSpan(TimeInterval);
+                if (Bookings.IsVisible)
+                    Bookings.DaysViewSettings.TimeInterval = IntervalToTimeSpan(TimeInterval);
             }
             catch (Exception e)
             {

+ 19 - 1
prs.desktop/Panels/Products/Locations/StockTakeWindow.xaml.cs

@@ -539,7 +539,23 @@ namespace PRSDesktop
         {
             if (Product.ID != Guid.Empty)
             {
-                CoreTable table = new Client<Product>().Query(new Filter<Product>(x => x.ID).IsEqualTo(Product.ID));
+                CoreTable table = new Client<Product>().Query(new Filter<Product>(x => x.ID).IsEqualTo(Product.ID),
+                        new Columns<Product>(
+                            x => x.Dimensions.Unit.ID,
+                            x => x.Dimensions.Unit.HasQuantity,
+                            x => x.Dimensions.Unit.HasLength,
+                            x => x.Dimensions.Unit.HasHeight,
+                            x => x.Dimensions.Unit.HasWeight,
+                            x => x.Dimensions.Unit.HasWidth,
+                            x => x.Dimensions.Quantity,
+                            x => x.Dimensions.Length,
+                            x => x.Dimensions.Height,
+                            x => x.Dimensions.Weight,
+                            x => x.Dimensions.Width,
+                            x => x.Dimensions.Unit.Format,
+                            x => x.Dimensions.Unit.Formula,
+                            x => x.Dimensions.UnitSize
+                            ));
                 Product product = table.Rows.FirstOrDefault().ToObject<Product>();
 
                 Dimensions.Unit.ID = product.Dimensions.Unit.ID;
@@ -557,6 +573,8 @@ namespace PRSDesktop
 
                 Dimensions.Unit.Format = product.Dimensions.Unit.Format;
                 Dimensions.Unit.Formula = product.Dimensions.Unit.Formula;
+
+                Dimensions.UnitSize = product.Dimensions.UnitSize;
             }
         }
 

+ 13 - 8
prs.desktop/Panels/Tasks/TasksByStatusControl.xaml.cs

@@ -787,18 +787,23 @@ namespace PRSDesktop
                         model.Locked = row.Get<IKanban, bool>(x => x.Locked); // ? _lockimg : null;
 
                         var notes = new List<List<string>> { new() };
-                        foreach (var line in row.Get<IKanban, string[]>(x => x.Notes))
+                        if ((row.Get<IKanban, string[]>(x => x.Notes) != null))
                         {
-                            if (line == "===================================")
-                            {
-                                notes.Add(new());
-                            }
-                            else
+
+
+                            foreach (var line in row.Get<IKanban, string[]>(x => x.Notes))
                             {
-                                notes.Last().Add(line);
+                                if (line == "===================================")
+                                {
+                                    notes.Add(new());
+                                }
+                                else
+                                {
+                                    notes.Last().Add(line);
+                                }
                             }
+                            model.Notes = string.Join("\n===================================\n", notes.Reverse<List<string>>().Select(x => string.Join('\n', x)));
                         }
-                        model.Notes = string.Join("\n===================================\n", notes.Reverse<List<string>>().Select(x => string.Join('\n', x)));
 
                         model.EmployeeID = empid;
                         model.ManagerID = mgrid;