Explorar o código

Fixed some default columns stuff

Kenric Nugteren hai 6 meses
pai
achega
81f2c1767e

+ 5 - 0
prs.classes/Entities/Customer/Customer.cs

@@ -149,6 +149,11 @@ namespace Comal.Classes
             LinkedProperties.Register<Customer,PaymentTermsLink,String>(x=>x.Account.Terms,x=>x.Description, x=>x.Terms.Description);
             LinkedProperties.Register<Customer,PaymentTermsLink,String>(x=>x.Account.Terms,x=>x.Calculation, x=>x.Terms.Calculation);
             LinkedProperties.Register<Customer,SalesGLCodeLink,Guid>(x=>x.Account.GLCode,x=>x.ID, x=>x.GLCode.ID);
+
+            DefaultColumns.Add<Customer>(x => x.Code);
+            DefaultColumns.Add<Customer>(x => x.Name);
+            DefaultColumns.Add<Customer>(x => x.Delivery.Street);
+            DefaultColumns.Add<Customer>(x => x.Delivery.City);
         }
     }
 }

+ 7 - 1
prs.classes/Entities/DeliveryItem/DeliveryItem.cs

@@ -142,7 +142,13 @@ namespace Comal.Classes
 
         static DeliveryItem()
         {
-            LinkedProperties.Register<DeliveryItem, ShipmentLink, String>(x=>x.ShipmentLink, x => x.Code, x => x.ShipmentCode);
+            LinkedProperties.Register<DeliveryItem, ShipmentLink, String>(x => x.ShipmentLink, x => x.Code, x => x.ShipmentCode);
+
+            DefaultColumns.Add<DeliveryItem>(x => x.Barcode, width: 100);
+            DefaultColumns.Add<DeliveryItem>(x => x.SetoutLink.JobLink.Name, width: 200);
+            DefaultColumns.Add<DeliveryItem>(x => x.Title, width: 0);
+            DefaultColumns.Add<DeliveryItem>(x => x.SetoutLink.Description, width: 0);
+            DefaultColumns.Add<DeliveryItem>(x => x.DueDate, width: 60, caption: "Due Date", format: "dd/MM/yy", alignment: Alignment.MiddleCenter);
         }
     }
 }

+ 9 - 0
prs.classes/Entities/GPSTracker/GPSTracker.cs

@@ -74,6 +74,15 @@ namespace Comal.Classes
 
         public Location Location { get; set; }
 
+        static GPSTracker()
+        {
+            DefaultColumns.Add<GPSTracker>(x => x.DeviceID, width: 200);
+            DefaultColumns.Add<GPSTracker>(x => x.Description, width: 0);
+            DefaultColumns.Add<GPSTracker>(x => x.Location.Latitude, width: 100, caption: "Latitude", format: "F6", alignment: Alignment.MiddleCenter);
+            DefaultColumns.Add<GPSTracker>(x => x.Location.Longitude, width: 100, caption: "Longitude", format: "F6", alignment: Alignment.MiddleCenter);
+            DefaultColumns.Add<GPSTracker>(x => x.Location.Timestamp, width: 100, caption: "Last Update", format: "dd/MM/yy HH:mm", alignment: Alignment.MiddleCenter);
+        }
+
         public override string ToString()
         {
             return string.Format("{0}: {1} ({2})", DeviceID, Description, DeviceType);

+ 3 - 0
prs.classes/Entities/Job/Job.cs

@@ -233,6 +233,9 @@ namespace Comal.Classes
             LinkedProperties.Register<Job,Address,double>(x=>x.Customer.Delivery, x=>x.Location.Longitude, x=>x.SiteAddress.Location.Longitude);
             LinkedProperties.Register<Job,Address,DateTime>(x=>x.Customer.Delivery, x=>x.Location.Timestamp, x=>x.SiteAddress.Location.Timestamp);
             LinkedProperties.Register<Job, AccountLink, Guid>(x => x.Customer.Account, x => x.ID, x => x.Account.ID);
+
+            DefaultColumns.Add<Job>(x => x.JobNumber, width: 50, caption: "Job #");
+            DefaultColumns.Add<Job>(x => x.Name);
         }
     }
 }

+ 7 - 0
prs.classes/Entities/Setout/Setout.cs

@@ -51,5 +51,12 @@ namespace Comal.Classes
         {
             return string.Format("{0}: {1}", Number, Reference);
         }
+
+        static Setout()
+        {
+            DefaultColumns.Add<Setout>(x => x.Number);
+            DefaultColumns.Add<Setout>(x => x.Description);
+            DefaultColumns.Add<Setout>(x => x.DueDate);
+        }
     }
 }

+ 6 - 0
prs.classes/Entities/Shipment/Shipment.cs

@@ -59,5 +59,11 @@ namespace Comal.Classes
         {
             return string.Format("{0}: {1}", Code, Description);
         }
+
+        static Shipment()
+        {
+            DefaultColumns.Add<Shipment>(x => x.Code);
+            DefaultColumns.Add<Shipment>(x => x.Description);
+        }
     }
 }

+ 7 - 10
prs.desktop/Panels/DailyReports/WindowTrackerHistory.cs

@@ -52,16 +52,13 @@ public class WindowTrackerHistoryGrid : DynamicGrid<WindowTrackerHistory>
         //ActionColumns.Add(new DynamicRowMovementColumn(DynamicRowMovement.Down, SwapRows));
         HiddenColumns.Add(x => x.Employee.ID);
         HiddenColumns.Add(x => x.Tracker);
-        var columns = new DynamicGridColumns
-        {
-            new() { ColumnName = "Start", Width = 70, Format = "hh:mm", Alignment = Alignment.MiddleCenter },
-            new() { ColumnName = "Finish", Width = 70, Format = "hh:mm", Alignment = Alignment.MiddleCenter },
-            new() { ColumnName = "Window", Width = 0 },
-            new() { ColumnName = "Job.ID", Width = 200 },
-            new() { ColumnName = "ITP.ID", Width = 200 },
-            new() { ColumnName = "Activity.ID", Width = 200 }
-        };
-        return columns;
+        return new DynamicGridColumns<WindowTrackerHistory>()
+            .AddFluent(x => x.Start, width: 70, format: "hh:mm", alignment: Alignment.MiddleCenter)
+            .AddFluent(x => x.Finish, width: 70, format: "hh:mm", alignment: Alignment.MiddleCenter)
+            .AddFluent(x => x.Window, width: 0)
+            .AddFluent(x => x.Job.ID, width: 200)
+            .AddFluent(x => x.ITP.ID, width: 200)
+            .AddFluent(x => x.Activity.ID, width: 200);
     }
 
     private bool ApplyToAll(CoreRow? arg)

+ 4 - 6
prs.desktop/Panels/Delivery/DeliveryRackList.cs

@@ -36,12 +36,10 @@ internal class DeliveryRackList : DynamicDataGrid<Shipment>, IMasterDetailContro
 
     protected override DynamicGridColumns LoadColumns()
     {
-        var columns = new DynamicGridColumns
-        {
-            new() { ColumnName = "Code", Width = 40, Caption = "Rack", Alignment = Alignment.MiddleCenter },
-            new() { ColumnName = "Description", Width = 0, Caption = "Description" },
-            new() { ColumnName = "ItemCount", Width = 25, Caption = "#", Alignment = Alignment.MiddleCenter }
-        };
+        var columns = new DynamicGridColumns<Shipment>();
+        columns.Add(x => x.Code, width: 40, caption: "Rack", alignment: Alignment.MiddleCenter);
+        columns.Add(x => x.Description, width: 0, caption: "Description");
+        columns.Add(x => x.ItemCount, width: 25, caption: "#", alignment: Alignment.MiddleCenter);
         return columns;
     }
 

+ 5 - 7
prs.desktop/Panels/Delivery/DeliveryRequiList.cs

@@ -37,13 +37,11 @@ namespace PRSDesktop
 
         protected override DynamicGridColumns LoadColumns()
         {
-            var columns = new DynamicGridColumns
-            {
-                new() { ColumnName = "Number", Width = 40, Caption = "Req.", Alignment = Alignment.MiddleCenter },
-                new() { ColumnName = "Title", Width = 0, Caption = "Requisition" },
-                new() { ColumnName = "Filled", Width = 50, Caption = "Done", Format = "dd MMM", Alignment = Alignment.MiddleCenter },
-                new() { ColumnName = "Boxes", Width = 25, Caption = "#", Alignment = Alignment.MiddleCenter }
-            };
+            var columns = new DynamicGridColumns<Requisition>();
+            columns.Add(x => x.Number, width: 40, caption: "Req.", alignment: Alignment.MiddleCenter);
+            columns.Add(x => x.Title, width: 0, caption: "Requisition");
+            columns.Add(x => x.Filled, width: 50, caption: "Done", format: "dd MMM", alignment: Alignment.MiddleCenter);
+            columns.Add(x => x.Boxes, width: 25, caption: "#", alignment: Alignment.MiddleCenter);
             return columns;
         }
 

+ 14 - 538
prs.desktop/Utils/DataUtils.cs

@@ -18,551 +18,27 @@ using Org.BouncyCastle.Math.EC.Multiplier;
 using Syncfusion.Windows.Controls;
 using MessageBox = System.Windows.MessageBox;
 
-namespace PRSDesktop
-{
-    
+namespace PRSDesktop;
 
-    
-    public class Utility
+public class Utility
+{
+    public static string[] ProcessNotes(string[] notes, string description)
     {
-        //private void UpgradeShipmentLinks(Entity[] notifications)
-        //{
-        //    int i = 1;
-        //    foreach (DeliveryNotification notification in notifications)
-        //    {
-        //        Progress.SetMessage(String.Format("Converting Delivery Notifications {0} / {1}", i, notifications.Length));
-        //        notification.ShipmentLink = new ShipmentLink();
-        //        if (notification.Shipment != null)
-        //        {
-        //            notification.ShipmentLink.ID = notification.Shipment.ID;
-        //            notification.Shipment = null;
-        //        }
-        //        i++;
-        //    }
-        //}
-
-        private static bool HasDocumentLinks<T>()
-        {
-            var props = typeof(T).GetProperties().Where(x =>
-                x.PropertyType.Equals(typeof(DocumentLink)) || x.PropertyType.Equals(typeof(ImageDocumentLink)) ||
-                x.PropertyType.Equals(typeof(PDFDocumentLink)));
-            return props.Any();
-        }
-
-        private static Guid[] GetDocuments<T>(T entity)
-        {
-            var result = new List<Guid>();
-            var props = typeof(T).GetProperties().Where(x =>
-                x.PropertyType.Equals(typeof(DocumentLink)) || x.PropertyType.Equals(typeof(ImageDocumentLink)) ||
-                x.PropertyType.Equals(typeof(PDFDocumentLink)));
-            foreach (var prop in props)
-            {
-                var link = (IEntityLink)prop.GetValue(entity);
-                if (link.IsValid())
-                    result.Add(link.ID);
-            }
-
-            return result.ToArray();
-        }
-
-        //private static bool CopyType<T>(int typeno, int typecount, IProvider source, IProvider target) where T : Entity, new()
-        //{
-
-        //    String name = typeof(T).EntityName().Split('.').Last();
-
-        //    //if (!HasDocumentLinks<T>())
-        //    //    return false;
-
-
-        //    Progress.SetMessage(String.Format("[{0}/{1}] {2}: Loading Source Items..", typeno, typecount, name));
-        //    var sourceitems = source.Load<T>();
-
-        //    Progress.SetMessage(String.Format("[{0}/{1}] {2}: Loading Target Items..", typeno, typecount, name));
-        //    var targetitems = target.Load<T>();
-
-        //    //if (sourceitems.Count() == targetitems.Count())
-        //    //    return false;
-
-        //    //Progress.SetMessage(String.Format("[{0}/{1}] {2}: Deleting Target Items..", typeno, typecount, name));
-        //    //foreach (var targetitem in targetitems)
-        //    //    target.Delete(targetitem);
-
-
-        //    for (int i=0; i<sourceitems.Length; i++)
-        //    {
-        //        Progress.SetMessage(String.Format("[{0}/{1}] {2}: Copying Items ({3:F2}% complete)..", typeno, typecount, name, (double)i * 100.0F / (double)sourceitems.Length));
-        //        var sourceitem = sourceitems[i];
-
-        //        if (ClientFactory.IsSupported<AuditTrail>())
-        //        {
-        //            var audits = source.Load<AuditTrail>(new Filter<AuditTrail>(x => x.EntityID).IsEqualTo(sourceitem.ID));
-        //            foreach (var audit in audits)
-        //                target.Save(audit);
-        //        }
-        //        if (sourceitem is IEntityDocument)
-        //        {
-        //            var entdoc = (IEntityDocument)sourceitem;
-        //            if (entdoc.DocumentLink.ID != Guid.Empty)
-        //            {
-        //                var doc = source.Load(new Filter<Document>(x => x.ID).IsEqualTo(entdoc.DocumentLink.ID)).FirstOrDefault();
-        //                if (doc != null)
-        //                    target.Save(doc);
-        //                else
-        //                    entdoc.DocumentLink.ID = Guid.Empty;
-        //            }
-        //        }
-
-        //        Guid[] docids = GetDocuments<T>(sourceitem);
-        //        foreach (var docid in docids)
-        //        {
-        //            var doc = source.Load(new Filter<Document>(x => x.ID).IsEqualTo(docid)).FirstOrDefault();
-        //            if (doc != null)
-        //                target.Save(doc);
-        //        }
-
-        //        target.Delete(sourceitem);
-
-        //        target.Save(sourceitem);
-        //    }
-
-        //    target.CommitTransaction();
-
-        //    return true;
-
-        //    #region oldcode
-        //    //open.Invoke(target, new object[] { "Duplicate", true });
-        //    ////if (items.Length != orig.Count)
-        //    //{
-        //    //    Progress.SetMessage(string.Format("{0}/{1} {2}: Clearing..", t + 1, types.Count, type.Name));
-        //    //    for (int i = 0; i < orig.Count; i++)
-        //    //    {
-        //    //        //Progress.SetMessage(string.Format("{0}/{1} {2}: Resetting ({3:F2}% complete)..", t + 1, types.Length, type.Name, (double)i * 100.0F / (double)orig.Count));
-        //    //        delete.Invoke(target, new object[] { orig[i] });
-        //    //    }
-
-        //    //    Progress.SetMessage(string.Format("{0}/{1} {2}: Rebuilding..", t + 1, types.Count, type.Name));
-        //    //    for (int i = 0; i < items.Count; i++)
-        //    //    {
-        //    //        //if (i > 10)
-        //    //        //    return;
-
-        //    //        var item = items[i];
-
-
-        //    //        //double progress = (double)i * 100.0F / (double)items.Length;
-        //    //        ////Progress.SetMessage(string.Format("{0}/{1} {2}: Copying ({3:F2}% complete)..", t + 1, types.Length, type.Name, progress));
-
-        //    //        //// Check and copy source document if required
-        //    //        //if (item is IEntityDocument)
-        //    //        //{
-        //    //        //    var entdoc = (IEntityDocument)item;
-        //    //        //    var doccli = new RemoteClient<Document>(URL, Port);
-        //    //        //    doccli.UserID = "FROGSOFTWARE";
-        //    //        //    doccli.Password = "FROGSOFTWARE";
-        //    //        //    //Progress.SetMessage(string.Format("{0}/{1} {2}: Copying (Documents)", t + 1, types.Length, type.Name));
-
-        //    //        //    var docfilter = new Filter<Document>(x => x.ID).IsEqualTo(entdoc.DocumentLink.ID);
-
-        //    //        //    var document = doccli.Load(docfilter).FirstOrDefault(); ;
-        //    //        //    if (document != null)
-        //    //        //        target.Save(document);
-        //    //        //}
-
-        //    //        //Progress.SetMessage(string.Format("{0}/{1} {2}: Copying ({3:F2}% complete).. (Saving)", t + 1, types.Length, type.Name, progress));
-        //    //        save.Invoke(target, new object[] { item });
-
-
-        //    //        //Dictionary<String, Object> values = item.GetValues(true);
-        //    //        //var member = CoreUtils.GetMemberExpression(type, "ID");
-        //    //        //var filter = Activator.CreateInstance(typeof(Filter<>).MakeGenericType(type));
-        //    //        //CoreUtils.SetPropertyValue(filter, "Expression", member);
-        //    //        //CoreUtils.SetPropertyValue(filter, "Operator", Operator.IsEqualTo);
-        //    //        //CoreUtils.SetPropertyValue(filter, "Value", item.ID);
-
-        //    //        //BaseObject[] compare = (BaseObject[])(load.Invoke(provider, new object[] { filter, null }));
-        //    //        //BaseObject newitem = compare.FirstOrDefault();
-        //    //        //if (newitem != null)
-        //    //        //{
-        //    //        //    var changes = newitem.Compare(values);
-        //    //        //    if (changes.Any())
-        //    //        //        throw new Exception(String.Format("Object Values have changed!\n\n{0}", String.Join("\n", changes)));
-        //    //        //}
-        //    //    }
-
-        //    //}
-        //    //target.CommitTransaction();
-        //    //close.Invoke(target, new object[] { "Duplicate", true });  
-        //    #endregion
-
-        //}
-
-        private static List<string> CompareType<T>(int typeno, int typecount, IProvider source, IProvider target) where T : Entity, new()
-        {
-            var result = new List<string>();
-
-            var name = typeof(T).EntityName().Split('.').Last();
-
-            Progress.SetMessage(string.Format("[{0}/{1}] {2}: Reloading Source Table..", typeno, typecount, name));
-            //var items = local.Load();
-            var sourcetable = source.Query<T>();
-            Progress.SetMessage(string.Format("[{0}/{1}] {2}: Reloading Target Table..", typeno, typecount, name));
-            var targettable = target.Query<T>();
-
-            for (var i = 0; i < sourcetable.Rows.Count; i++)
-            {
-                Progress.SetMessage(string.Format("[{0}/{1}] {2}: Comparing Values ({3:F2}% complete)..", typeno, typecount, name,
-                    (double)i * 100.0F / sourcetable.Rows.Count));
-                var sourcerow = sourcetable.Rows[i];
-                var id = sourcerow.Get<Guid>("ID");
-                var targetrow = targettable.Rows.FirstOrDefault(r => r.Get<Guid>("ID").Equals(id));
-                if (targetrow == null)
-                    result.Add(string.Format("{0}: Row [{1}] is missing in target database", name, id));
-                else
-                    foreach (var col in targettable.Columns)
-                    {
-                        var targetvalue = targetrow[col.ColumnName];
-                        var sourcevalue = sourcerow[col.ColumnName];
-                        if (targetvalue == null)
-                        {
-                            if (sourcevalue != null)
-                                result.Add(string.Format("{0}: Row [{1}].{2} is null in target, but [{3}] in source", name, id, col.ColumnName,
-                                    sourcevalue));
-                        }
-                        else if (!targetvalue.Equals(sourcevalue))
-                        {
-                            result.Add(string.Format("{0}: Row [{1}].{2} is [{3}] in target, but [{4}] in source", name, id, col.ColumnName,
-                                targetvalue,
-                                sourcevalue));
-                        }
-                    }
-            }
-
-            return result;
-        }
-
-        private static void LoadType(Type type, List<Type> into, Type[] exclude)
+        var Notes = notes != null ? notes.ToList() : new List<string>();
+        if (!string.IsNullOrWhiteSpace(description) && !description.Equals("Enter Description of Task Here"))
         {
-            if (exclude.Contains(type) || into.Contains(type))
-                return;
-
-            var props = type.GetProperties().Where(x => x.PropertyType.GetInterfaces().Contains(typeof(IEntityLink)));
-            if (!props.Any())
-            {
-                into.Insert(0, type);
-            }
-            else
-            {
-                foreach (var prop in props)
+            var bFound = false;
+            for (var i = 0; i < Notes.Count; i++)
+                if (!string.IsNullOrWhiteSpace(Notes[i]) && Notes[i].Contains(description))
                 {
-                    var subtype = prop.PropertyType.BaseType.GetGenericArguments().First();
-                    if (subtype != type)
-                        LoadType(subtype, into, exclude);
+                    Notes[i] = description;
+                    bFound = true;
                 }
 
-                into.Add(type);
-            }
+            if (!bFound)
+                Notes.Insert(0, description);
         }
 
-        public static void DuplicateDatabase()
-        {
-            using (var ofd = new OpenFileDialog())
-            {
-                ofd.Filter = "SQLite Database Files (*.dbs)|*.dbs";
-                ofd.DefaultExt = "dbs";
-
-                ofd.InitialDirectory = Path.GetDirectoryName(DbFactory.ProviderFactory.URL);
-                ofd.FileName = "";
-                ofd.Multiselect = false;
-                ofd.CheckFileExists = true;
-                var result = ofd.ShowDialog();
-
-                if (result != DialogResult.OK || string.IsNullOrWhiteSpace(ofd.FileName))
-                    return;
-
-                BaseObject.GlobalObserving = false;
-
-                var source = new SQLiteProviderFactory(ofd.FileName);
-
-                Progress.Show("Opening Source Database");
-                source.Types = DbFactory.ProviderFactory.Types;
-                source.Start();
-
-                try
-                {
-                    var types = CoreUtils.TypeList(
-                        AppDomain.CurrentDomain.GetAssemblies(),
-                        x =>
-                            x.IsClass
-                            && !x.IsGenericType
-                            && x.IsSubclassOf(typeof(Entity))
-                            && !x.Equals(typeof(AuditTrail))
-                            && x.Equals(typeof(Setout))
-                            && x.GetInterfaces().Contains(typeof(IRemotable))
-                    );
-
-                    var orderedtypes = new List<Type>();
-                    foreach (var type in types)
-                        LoadType(type, orderedtypes,
-                            new[] { typeof(Document), /* typeof(Comal.Classes.Calendar), */ typeof(Email), typeof(GPSTrackerLocation) });
-
-                    var results = new List<string>();
-
-                    orderedtypes = orderedtypes.Where(x => x.Equals(typeof(Setout))).ToList();
-
-                    for (var i = 0; i < orderedtypes.Count; i++)
-                    {
-                        var type = orderedtypes[i];
-                        var copy = typeof(Utility).GetMethod("CopyType", BindingFlags.Static | BindingFlags.NonPublic).MakeGenericMethod(type);
-                        var copied = (bool)copy.Invoke(null, new object[] { i, orderedtypes.Count, source, DbFactory.ProviderFactory });
-
-                        if (copied)
-                        {
-                            var compare = typeof(Utility).GetMethod("CompareType", BindingFlags.Static | BindingFlags.NonPublic)
-                                .MakeGenericMethod(type);
-                            compare.Invoke(null, new object[] { i, orderedtypes.Count, source, DbFactory.ProviderFactory });
-                        }
-                    }
-
-                    File.WriteAllText("compare.text", string.Join("\n", results));
-
-                    Progress.Close();
-                    MessageBox.Show("All Done");
-                }
-                catch (Exception e)
-                {
-                    Progress.Close();
-                    MessageBox.Show("Import Failed!\n\n" + e.Message + "\n\n" + e.StackTrace);
-                }
-
-                BaseObject.GlobalObserving = true;
-            }
-        }
-
-        private static void EmptyStores(params Type[] entities)
-        {
-            foreach (var entity in entities)
-            {
-                var client = ClientFactory.CreateClient(entity);
-                try
-                {
-                    var items = client.Load();
-                    if (items != null)
-                        foreach (var item in items)
-                            client.Delete(item, "Emptying Store");
-                }
-                catch (Exception e)
-                {
-                    throw new Exception(string.Format("{1}\nType: {0}", entity.Name, e.Message));
-                }
-            }
-        }
-
-        private static void EmptyStores()
-        {
-            var entities = CoreUtils.TypeList(
-                new[]
-                {
-                    typeof(Setout).Assembly
-                },
-                myType =>
-                    myType.IsClass
-                    && !myType.IsAbstract
-                    && !myType.IsGenericType
-                    && myType.IsSubclassOf(typeof(Entity))
-                    && myType.GetInterfaces().Contains(typeof(IPersistent))
-            ).ToArray();
-            EmptyStores(entities);
-        }
-
-        public static string[] ProcessNotes(string[] notes, string description)
-        {
-            var Notes = notes != null ? notes.ToList() : new List<string>();
-            if (!string.IsNullOrWhiteSpace(description) && !description.Equals("Enter Description of Task Here"))
-            {
-                var bFound = false;
-                for (var i = 0; i < Notes.Count; i++)
-                    if (!string.IsNullOrWhiteSpace(Notes[i]) && Notes[i].Contains(description))
-                    {
-                        Notes[i] = description;
-                        bFound = true;
-                    }
-
-                if (!bFound)
-                    Notes.Insert(0, description);
-            }
-
-            return Notes.Select(x => CoreUtils.StripHTML(x)).ToArray();
-        }
-
-        public static void SetupColumns()
-        {
-            var usercolumns = new DynamicGridColumns
-            {
-                new() { ColumnName = "UserID", Width = 0, Caption = "User ID" },
-                new() { ColumnName = "Password", Width = 0, Caption = "Password" }
-            };
-            new GlobalConfiguration<DynamicGridColumns>(typeof(User).Name).Save(usercolumns);
-
-            var empcolumns = new DynamicGridColumns
-            {
-                new() { ColumnName = "Code", Width = 200, Caption = "Code" },
-                new() { ColumnName = "Name", Width = 0, Caption = "Name" },
-                new() { ColumnName = "CanAllocateTasks", Width = 40, Caption = "Tasks?" },
-                new() { ColumnName = "PayrollID", Width = 200, Caption = "Payroll ID" }
-            };
-            new GlobalConfiguration<DynamicGridColumns>(typeof(Employee).Name).Save(empcolumns);
-
-            var jobcolumns = new DynamicGridColumns
-            {
-                new() { ColumnName = "Number", Width = 50, Caption = " Job #", /* Type = typeof(int),  */ Alignment = Alignment.MiddleCenter },
-                new() { ColumnName = "Name", Width = 0, Caption = " Name" /* , Type = typeof(String) */ }
-            };
-            new GlobalConfiguration<DynamicGridColumns>(typeof(Job).Name).Save(jobcolumns);
-
-            var setoutcolumns = new DynamicGridColumns
-            {
-                new() { ColumnName = "Number", Width = 80 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Title", Width = 200 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Description", Width = 0 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Quantity", Width = 50, /* Type=typeof(int),  */ Caption = "Qty", Alignment = Alignment.MiddleCenter },
-                new() { ColumnName = "Status", Width = 0 /* , Type = typeof(String) */ },
-                new() { ColumnName = "DueDate", Width = 60, /* Type = typeof(DateTime),  */ Format = "dd/MM/yy", Alignment = Alignment.MiddleCenter },
-                new()
-                {
-                    ColumnName = "Forecast.ManufacturingDate", Width = 60, /* Type = typeof(DateTime),  */ Caption = "Est Date", Format = "dd/MM/yy",
-                    Alignment = Alignment.MiddleCenter
-                }
-            };
-            new GlobalConfiguration<DynamicGridColumns>(typeof(Setout).Name).Save(setoutcolumns);
-
-
-            var deliverycolumns = new DynamicGridColumns
-            {
-                new() { ColumnName = "Barcode", Width = 100 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Setout.Job.Name", Width = 200 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Title", Width = 0 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Setout.Quantity", Width = 50, /* Type=typeof(int),  */ Caption = "Qty", Alignment = Alignment.MiddleCenter },
-                new() { ColumnName = "Setout.Description", Width = 0 /* , Type = typeof(String) */ },
-                new()
-                {
-                    ColumnName = "DueDate", Width = 60, /* Type = typeof(DateTime),  */ Caption = "Due Date", Format = "dd/MM/yy",
-                    Alignment = Alignment.MiddleCenter
-                },
-                new()
-                {
-                    ColumnName = "Setout.Forecast.ManufacturingDate", Width = 60, /* Type = typeof(DateTime),  */ Caption = "Est Date",
-                    Format = "dd/MM/yy", Alignment = Alignment.MiddleCenter
-                },
-                new()
-                {
-                    ColumnName = "ManufacturedDate", Width = 60, /* Type = typeof(DateTime),  */ Caption = "Ready", Format = "dd/MM/yy",
-                    Alignment = Alignment.MiddleCenter
-                },
-                new() { ColumnName = "Setout.Status", Width = 150 /* , Type = typeof(String) */ }
-            };
-            new GlobalConfiguration<DynamicGridColumns>(typeof(DeliveryItem).Name).Save(deliverycolumns);
-
-
-            var shipmentcolumns = new DynamicGridColumns
-            {
-                new() { ColumnName = "Code", Width = 80, /* Type = typeof(String), */ Alignment = Alignment.MiddleCenter },
-                new() { ColumnName = "Description", Width = 0 /* , Type = typeof(String) */ }
-            };
-            new GlobalConfiguration<DynamicGridColumns>(typeof(Shipment).Name).Save(shipmentcolumns);
-
-            var employeecolumns = new DynamicGridColumns
-            {
-                new() { ColumnName = "Code", Width = 120 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Name", Width = 0 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Address.Street", Width = 0 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Address.City", Width = 150 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Type.Name", Width = 120 /* , Type = typeof(String) */ },
-                new()
-                {
-                    ColumnName = "StartDate", Width = 60, /* Type = typeof(DateTime),  */ Caption = "Started", Format = "dd/MM/yy",
-                    Alignment = Alignment.MiddleCenter
-                },
-                new()
-                {
-                    ColumnName = "FinishDate", Width = 60, /* Type = typeof(DateTime),  */ Caption = "Finished", Format = "dd/MM/yy",
-                    Alignment = Alignment.MiddleCenter
-                }
-            };
-            new GlobalConfiguration<DynamicGridColumns>(typeof(Employee).Name).Save(employeecolumns);
-
-            var customercolumns = new DynamicGridColumns
-            {
-                new() { ColumnName = "Code", Width = 200 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Name", Width = 0 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Delivery.Street", Width = 0 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Delivery.City", Width = 150 /* , Type = typeof(String) */ }
-            };
-            new GlobalConfiguration<DynamicGridColumns>(typeof(Customer).Name).Save(customercolumns);
-
-            var gpstrackercolumns = new DynamicGridColumns
-            {
-                new() { ColumnName = "DeviceID", Width = 200 /* , Type = typeof(String) */ },
-                new() { ColumnName = "Description", Width = 0 /* , Type = typeof(String) */ },
-                new()
-                {
-                    ColumnName = "Location.Latitude", Width = 100, /* Type = typeof(double),  */ Caption = "Latitude", Format = "F6",
-                    Alignment = Alignment.MiddleCenter
-                },
-                new()
-                {
-                    ColumnName = "Location.Longitude", Width = 100, /* Type = typeof(double),  */ Caption = "Longitude", Format = "F6",
-                    Alignment = Alignment.MiddleCenter
-                },
-                new()
-                {
-                    ColumnName = "Location.Timestamp", Width = 100, /* Type = typeof(DateTime),  */ Caption = "Last Update",
-                    Format = "dd/MM/yy HH:mm",
-                    Alignment = Alignment.MiddleCenter
-                }
-            };
-            new GlobalConfiguration<DynamicGridColumns>(typeof(GPSTracker).Name).Save(gpstrackercolumns);
-        }
-        
-        private class RequisitionItemLine
-        {
-            public Guid ID { get; private set; }
-            public InvoiceLine Line { get; private set; }
-            public CostCentre CostCentre { get; private set; }
-            public double? Charge { get; set; }
-
-            public RequisitionItemLine(Guid id, CostCentre costcentre, String description, double? charge)
-            {
-                ID = id;
-                Line = new InvoiceLine() { Description = description };
-                CostCentre = costcentre;
-                Charge = charge;
-            }
-        }
-        
-
-
-
-
-
-        
-
-        //public void InvoiceTimeSheets()
-        //{
-        //    TimeSheet[] times = new Client<TimeSheet>().Load(
-        //        new Filter<TimeSheet>(x => x.Processed).IsEqualTo(DateTime.MinValue).And(x => x.Approved).IsNotEqualTo(DateTime.MinValue).And(x => x.InvoiceLink.ID).IsEqualTo(Guid.Empty).And(x => x.JobLink.ID).IsNotEqualTo(Guid.Empty)
-        //    );
-        //    List<Job> jobs = new List<Job>();
-        //    foreach (var time in times)
-        //    {
-        //        if (!jobs.Contains(time.JobLink.ID))
-        //            jobs.Add(time.JobLink.ID);
-        //    }
-        //    foreach (Guid jobid in jobs)
-        //    {
-        //        Invoice invoice = new Invoice();
-        //        invoice.JobLink.ID = jobid;
-
-        //    }
-        //}
+        return Notes.Select(x => CoreUtils.StripHTML(x)).ToArray();
     }
 }