Sfoglia il codice sorgente

Got rid of StagingMaterialList

Kenric Nugteren 3 settimane fa
parent
commit
5feeaa5c35

+ 1 - 0
prs.classes/Entities/Staging/Manufacturing/Material List/StagingMaterialList.cs

@@ -5,6 +5,7 @@ using System.Text;
 
 namespace Comal.Classes
 {
+    [Obsolete]
     public class StagingMaterialList : Entity, IPersistent, IRemotable, ILicense<ManufacturingLicense>
     {
         public string Name { get; set; } = "";

+ 1 - 0
prs.classes/Entities/Staging/Manufacturing/Material List/StagingMaterialListDocument.cs

@@ -5,6 +5,7 @@ using System.Text;
 
 namespace Comal.Classes
 {
+    [Obsolete]
     public class StagingMaterialListDocument : EntityDocument<StagingMaterialListLink>, ILicense<ManufacturingLicense>
     {
     }

+ 1 - 0
prs.classes/Entities/Staging/Manufacturing/Material List/StagingMaterialListLink.cs

@@ -5,6 +5,7 @@ using System.Text;
 
 namespace Comal.Classes
 {
+    [Obsolete]
     public class StagingMaterialListLink : EntityLink<StagingMaterialList>
     {
         public override Guid ID { get; set; }

+ 0 - 79
prs.desktop/Panels/Staging/Manufacturing/StagingMaterialListGrid.cs

@@ -1,79 +0,0 @@
-using Comal.Classes;
-using InABox.Clients;
-using InABox.Core;
-using InABox.DynamicGrid;
-using Microsoft.Win32;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-
-namespace PRSDesktop
-{
-    public class StagingMaterialListGrid : DynamicDataGrid<StagingMaterialList>
-    {
-        protected override void DoReconfigure(DynamicGridOptions options)
-        {
-            base.DoReconfigure(options);
-            options.ImportData = false;
-            options.ExportData = false;
-        }
-
-        protected override void DoAdd(bool openEditorOnDirectEdit = false)
-        {
-            var dlg = new OpenFileDialog();
-            dlg.Multiselect = true;
-            dlg.Title = "Add Staging Files"; ;
-            if (dlg.ShowDialog() == true)
-            {
-                List<Document> documents = new List<Document>();
-                foreach (var file in dlg.FileNames)
-                    documents.Add(ReadFile(file));
-
-                new Client<Document>().Save(documents, "Created from Staging Screen");
-
-                foreach (var document in documents)
-                {
-                    var materiallist = new StagingMaterialList();
-                    materiallist.Name = Path.GetFileNameWithoutExtension(document.FileName);
-
-                    new Client<StagingMaterialList>().Save(materiallist, "Created from Staging Screen");
-
-                    var materiallistdoc = new StagingMaterialListDocument();
-                    materiallistdoc.EntityLink.ID = materiallist.ID;
-                    materiallistdoc.DocumentLink.ID = document.ID;
-
-                    new Client<StagingMaterialListDocument>().Save(materiallistdoc, "Created from Staging Screen");
-
-                    Refresh(false, true);
-                }
-            }
-            base.DoAdd(openEditorOnDirectEdit);
-        }
-
-        private Document ReadFile(string file)
-        {
-            Document doc = new Document();
-            doc.FileName = Path.GetFileName(file);
-            doc.Data = GetData(file);
-            return doc;
-        }
-
-        private byte[] GetData(string file)
-        {
-            Stream stream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read);
-            byte[] pdfData = new byte[stream.Length];
-            stream.Read(pdfData, 0, Convert.ToInt32(pdfData.Length));
-            stream.Dispose();
-            return pdfData;
-        }
-
-        protected override void Reload(
-        	Filters<StagingMaterialList> criteria, Columns<StagingMaterialList> columns, ref SortOrder<StagingMaterialList>? sort,
-        	CancellationToken token, Action<CoreTable?, Exception?> action)
-        {
-            criteria.Add(Filter<StagingMaterialList>.Where(x => x.Archived).IsEqualTo(DateTime.MinValue));
-            base.Reload(criteria, columns, ref sort, token, action);
-        }
-    }
-}