write files to server

pull/1/head
DJh2o2 2022-12-14 10:56:43 +07:00
parent 1e62719332
commit 27af329b22
11 changed files with 214 additions and 135 deletions

@ -553,7 +553,7 @@ namespace Gremlin_BlazorServer.Data.DBClasses
List<Contact> ContactsReadFromFile = new(8000);
// ENCODING CHANGED TO UNICODE. TO BE TESTED!
using (TextFieldParser csvParser = new(filepath, FileIO.GetEncoding(filepath)))
using (TextFieldParser csvParser = new(filepath, FileService.GetEncoding(filepath)))
{
//Parser configuration:
csvParser.Delimiters = new string[] { separator };
@ -712,7 +712,7 @@ namespace Gremlin_BlazorServer.Data.DBClasses
//ENCODING CHANGED TO ISO-8859-1 AS EQUIVALENT (?) TO "LATIN1" (unavailable). TO BE TESTED!
//ich würde mir ja UTF8 als universelles Encoding wünschen
using (TextFieldParser csvParser = new(filepath, FileIO.GetEncoding(filepath)))
using (TextFieldParser csvParser = new(filepath, FileService.GetEncoding(filepath)))
{
//Parser configuration:
csvParser.Delimiters = new string[] { separator };
@ -892,7 +892,7 @@ namespace Gremlin_BlazorServer.Data.DBClasses
List<Contact> ContactsReadFromFile = new(8000);
List<Account> AccountsReadFromFile = new(1000);
using (TextFieldParser csvParser = new(filepath, FileIO.GetEncoding(filepath))) //ISO-8859-1 entspricht Latin1
using (TextFieldParser csvParser = new(filepath, FileService.GetEncoding(filepath))) //ISO-8859-1 entspricht Latin1
{
//Parser configuration:
csvParser.Delimiters = new string[] { separator };
@ -1755,7 +1755,7 @@ namespace Gremlin_BlazorServer.Data.DBClasses
{
List<Product> results = new(100000);
//ENCODING CHANGED TO ISO-8859-1 AS EQUIVALENT (?) TO "LATIN1" (unavailable). TO BE TESTED!
using (TextFieldParser csvParser = new(filepath, FileIO.GetEncoding(filepath)))
using (TextFieldParser csvParser = new(filepath, FileService.GetEncoding(filepath)))
{
//Parser configuration:
csvParser.Delimiters = new string[] { separator };

@ -126,7 +126,7 @@ namespace Gremlin_BlazorServer.Data.DBClasses
}
catch (Exception)
{
Encoding = FileIO.GetEncoding(GenericImporter.filepath);
Encoding = FileService.GetEncoding(GenericImporter.filepath);
}
Separators = new string[] { separator };
@ -147,7 +147,7 @@ namespace Gremlin_BlazorServer.Data.DBClasses
}
catch (Exception)
{
Encoding = FileIO.GetEncoding(GenericImporter.filepath);
Encoding = FileService.GetEncoding(GenericImporter.filepath);
}
Separators = new string[] { separator };
@ -1003,7 +1003,7 @@ namespace Gremlin_BlazorServer.Data.DBClasses
public static Dictionary<string, string> ReadMappingDictionaryFromFile()
{
Dictionary<string, string> result = new();
string fileInput = FileIO.ReadResource("MappingDictionary.txt");
string fileInput = FileService.ReadResource("MappingDictionary.txt");
string[] lines = fileInput.Split(Environment.NewLine);
foreach (string line in lines)
{

@ -9,18 +9,18 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazorise.Bootstrap" Version="1.1.4.1" />
<PackageReference Include="Blazorise.Components" Version="1.1.4.1" />
<PackageReference Include="Blazorise.DataGrid" Version="1.1.4.1" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.1.4.1" />
<PackageReference Include="Blazorise.Bootstrap" Version="1.1.5" />
<PackageReference Include="Blazorise.Components" Version="1.1.5" />
<PackageReference Include="Blazorise.DataGrid" Version="1.1.5" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.1.5" />
<PackageReference Include="DocumentFormat.OpenXml" Version="2.18.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.1" />
<PackageReference Include="morelinq" Version="3.3.2" />
<PackageReference Include="MySqlConnector" Version="2.2.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0-alpha.1" />
@ -35,4 +35,8 @@
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="Quotes\" />
</ItemGroup>
</Project>

@ -124,7 +124,7 @@
Contact selectedRecipient = new();
Account correspondingAccount = new();
CultureInfo cultureInfo = new("de-DE");
protected override async Task OnInitializedAsync()
{
contacts = await contactService.GetAllContactsAsync();
@ -146,7 +146,12 @@
{
await file.WriteToStreamAsync(stream);
stream.Seek(0, SeekOrigin.Begin);
using (StreamReader reader = new(stream)) { quoteService.ReadLineItems(quote, await reader.ReadToEndAsync()); }
using (StreamReader reader = new(stream))
{
string fileContent = await reader.ReadToEndAsync();
quote = quoteService.ReadLineItems(quote, fileContent);
FileService.WriteClipboardToTSV(fileContent, quote);
}
}
}
}
@ -178,24 +183,7 @@
{
StringBuilder texStringBuilder = await quoteService.CreateTex(quote);
quote.Tex = texStringBuilder.ToString();
Byte[] texBytes = Encoding.UTF8.GetBytes(quote.Tex);
DownloadTexFile(quote.Tex, $"{quote.QuotationNumber}.tex");
}
async void DownloadTexFile(string texString, string datei)
{
try
{
//using (Stream stream = new MemoryStream(texBytes))
//{
// using DotNetStreamReference streamRef = new(stream: stream);
await JSRuntime.InvokeVoidAsync("alert", texString);
//}
}
catch
{
Debug.WriteLine("Download of TexFile failed!");
}
FileService.WriteTexFile(quote);
}
private Task OnTexChanged(string value)

@ -0,0 +1,17 @@
# Part Number Opt PL Description Qty Price EUR Breaks EUR Uplift % Total Discount % Net EUR Total EUR Sales Discount YA9% Contractual Discount Y99% Promotion Discount Y07% Demo Discount Y04% PH Code PH Description YMax
1 G7104C 29 1260 Infinity II Flexible Pumpe 1 33344 0 0 40 20006.4 20006.4 40 0 0 0 ISL100P1 Pumps
2 G7104C 001 29 HPLC System Tool-Kit 1260 Infinity II 1 377 0 0 40 226.2 226.2 40 0 0 0
3 G7104C 004 29 Agilent Lab Advisor Advanced Software 1 1574 0 0 40 944.4 944.4 40 0 0 0
4 G7104C 034 29 InfinityLab Stay Safe Verschl., St.-Kit 1 664 0 0 40 398.4 398.4 40 0 0 0
5 G7104C 097 29 Poroshell 120 EC-C18 3,0x150mm, 2,7um 1 1 0 0 40 0.6 0.6 40 0 0 0
6 G7167A 29 1260 Infinity II Mehrfachprobengeber 1 27195 0 0 40 16317 16317 40 0 0 0 ISL100A1 Autosamplers
7 G7167A 060 29 Nutzung vorhandene Lizenz 1 -1733 0 0 40 -1039.8 -1039.8 40 0 0 0
8 G7167A 101 29 Agilent InfinityLab Proben-Thermostat 1 5871 0 0 40 3522.6 3522.6 40 0 0 0
9 G7116A 29 1260 Infinity II Therm. f. mehr. Saeulen 1 6275 0 0 40 3765 3765 40 0 0 0 ISL100LC1 LC Hardware
10 G7162A 29 1260 Infinity II Brechungsindexdetektor 1 13516 0 0 40 8109.6 8109.6 40 0 0 0 ISL100D1 Detectors
11 M8414AA LI OpenLab CDS Workstation PC-Paket 1 16854 0 0 40 10112.4 10112.4 40 0 0 0 ISF300F110 OpenLAB CDS w/Hardware
12 M8414AA 001 LI LC Geraeteverbindung 1 0 0 0 40 0 0 40 0 0 0
13 SYS-LC-1260II 74 LC 1260 Infinity II System 1 0 0 0 20 0 0 20 0 0 0 TSSYS0SYLC Service Systems - Liquid Chromatography
14 SYS-LC-1260II 2A9 74 Standard-Einweisung 1 999 0 0 20 799.2 799.2 20 0 0 0 TSSTRN Training Services
15 SYS-LC-1260II 8R2 74 CrossLab Silver - 2J, kompl. 1 10403 0 0 35 6761.95 6761.95 30 0 5 0 TSSYS2 Serviced As Systems - 2 YR > 29
1 # Part Number Opt PL Description Qty Price EUR Breaks EUR Uplift % Total Discount % Net EUR Total EUR Sales Discount YA9% Contractual Discount Y99% Promotion Discount Y07% Demo Discount Y04% PH Code PH Description YMax
2 1 G7104C 29 1260 Infinity II Flexible Pumpe 1 33344 0 0 40 20006.4 20006.4 40 0 0 0 ISL100P1 Pumps
3 2 G7104C 001 29 HPLC System Tool-Kit 1260 Infinity II 1 377 0 0 40 226.2 226.2 40 0 0 0
4 3 G7104C 004 29 Agilent Lab Advisor Advanced Software 1 1574 0 0 40 944.4 944.4 40 0 0 0
5 4 G7104C 034 29 InfinityLab Stay Safe Verschl., St.-Kit 1 664 0 0 40 398.4 398.4 40 0 0 0
6 5 G7104C 097 29 Poroshell 120 EC-C18 3,0x150mm, 2,7um 1 1 0 0 40 0.6 0.6 40 0 0 0
7 6 G7167A 29 1260 Infinity II Mehrfachprobengeber 1 27195 0 0 40 16317 16317 40 0 0 0 ISL100A1 Autosamplers
8 7 G7167A 060 29 Nutzung vorhandene Lizenz 1 -1733 0 0 40 -1039.8 -1039.8 40 0 0 0
9 8 G7167A 101 29 Agilent InfinityLab Proben-Thermostat 1 5871 0 0 40 3522.6 3522.6 40 0 0 0
10 9 G7116A 29 1260 Infinity II Therm. f. mehr. Saeulen 1 6275 0 0 40 3765 3765 40 0 0 0 ISL100LC1 LC Hardware
11 10 G7162A 29 1260 Infinity II Brechungsindexdetektor 1 13516 0 0 40 8109.6 8109.6 40 0 0 0 ISL100D1 Detectors
12 11 M8414AA LI OpenLab CDS Workstation PC-Paket 1 16854 0 0 40 10112.4 10112.4 40 0 0 0 ISF300F110 OpenLAB CDS w/Hardware
13 12 M8414AA 001 LI LC Geraeteverbindung 1 0 0 0 40 0 0 40 0 0 0
14 13 SYS-LC-1260II 74 LC 1260 Infinity II System 1 0 0 0 20 0 0 20 0 0 0 TSSYS0SYLC Service Systems - Liquid Chromatography
15 14 SYS-LC-1260II 2A9 74 Standard-Einweisung 1 999 0 0 20 799.2 799.2 20 0 0 0 TSSTRN Training Services
16 15 SYS-LC-1260II 8R2 74 CrossLab Silver - 2J, kompl. 1 10403 0 0 35 6761.95 6761.95 30 0 5 0 TSSYS2 Serviced As Systems - 2 YR > 29

@ -0,0 +1,17 @@
# Part Number Opt PL Description Qty Price EUR Breaks EUR Uplift % Total Discount % Net EUR Total EUR Sales Discount YA9% Contractual Discount Y99% Promotion Discount Y07% Demo Discount Y04% PH Code PH Description YMax
1 G7104C 29 1260 Infinity II Flexible Pumpe 1 33344 0 0 40 20006.4 20006.4 40 0 0 0 ISL100P1 Pumps
2 G7104C 001 29 HPLC System Tool-Kit 1260 Infinity II 1 377 0 0 40 226.2 226.2 40 0 0 0
3 G7104C 004 29 Agilent Lab Advisor Advanced Software 1 1574 0 0 40 944.4 944.4 40 0 0 0
4 G7104C 034 29 InfinityLab Stay Safe Verschl., St.-Kit 1 664 0 0 40 398.4 398.4 40 0 0 0
5 G7104C 097 29 Poroshell 120 EC-C18 3,0x150mm, 2,7um 1 1 0 0 40 0.6 0.6 40 0 0 0
6 G7167A 29 1260 Infinity II Mehrfachprobengeber 1 27195 0 0 40 16317 16317 40 0 0 0 ISL100A1 Autosamplers
7 G7167A 060 29 Nutzung vorhandene Lizenz 1 -1733 0 0 40 -1039.8 -1039.8 40 0 0 0
8 G7167A 101 29 Agilent InfinityLab Proben-Thermostat 1 5871 0 0 40 3522.6 3522.6 40 0 0 0
9 G7116A 29 1260 Infinity II Therm. f. mehr. Saeulen 1 6275 0 0 40 3765 3765 40 0 0 0 ISL100LC1 LC Hardware
10 G7162A 29 1260 Infinity II Brechungsindexdetektor 1 13516 0 0 40 8109.6 8109.6 40 0 0 0 ISL100D1 Detectors
11 M8414AA LI OpenLab CDS Workstation PC-Paket 1 16854 0 0 40 10112.4 10112.4 40 0 0 0 ISF300F110 OpenLAB CDS w/Hardware
12 M8414AA 001 LI LC Geraeteverbindung 1 0 0 0 40 0 0 40 0 0 0
13 SYS-LC-1260II 74 LC 1260 Infinity II System 1 0 0 0 20 0 0 20 0 0 0 TSSYS0SYLC Service Systems - Liquid Chromatography
14 SYS-LC-1260II 2A9 74 Standard-Einweisung 1 999 0 0 20 799.2 799.2 20 0 0 0 TSSTRN Training Services
15 SYS-LC-1260II 8R2 74 CrossLab Silver - 2J, kompl. 1 10403 0 0 35 6761.95 6761.95 30 0 5 0 TSSYS2 Serviced As Systems - 2 YR > 29
1 # Part Number Opt PL Description Qty Price EUR Breaks EUR Uplift % Total Discount % Net EUR Total EUR Sales Discount YA9% Contractual Discount Y99% Promotion Discount Y07% Demo Discount Y04% PH Code PH Description YMax
2 1 G7104C 29 1260 Infinity II Flexible Pumpe 1 33344 0 0 40 20006.4 20006.4 40 0 0 0 ISL100P1 Pumps
3 2 G7104C 001 29 HPLC System Tool-Kit 1260 Infinity II 1 377 0 0 40 226.2 226.2 40 0 0 0
4 3 G7104C 004 29 Agilent Lab Advisor Advanced Software 1 1574 0 0 40 944.4 944.4 40 0 0 0
5 4 G7104C 034 29 InfinityLab Stay Safe Verschl., St.-Kit 1 664 0 0 40 398.4 398.4 40 0 0 0
6 5 G7104C 097 29 Poroshell 120 EC-C18 3,0x150mm, 2,7um 1 1 0 0 40 0.6 0.6 40 0 0 0
7 6 G7167A 29 1260 Infinity II Mehrfachprobengeber 1 27195 0 0 40 16317 16317 40 0 0 0 ISL100A1 Autosamplers
8 7 G7167A 060 29 Nutzung vorhandene Lizenz 1 -1733 0 0 40 -1039.8 -1039.8 40 0 0 0
9 8 G7167A 101 29 Agilent InfinityLab Proben-Thermostat 1 5871 0 0 40 3522.6 3522.6 40 0 0 0
10 9 G7116A 29 1260 Infinity II Therm. f. mehr. Saeulen 1 6275 0 0 40 3765 3765 40 0 0 0 ISL100LC1 LC Hardware
11 10 G7162A 29 1260 Infinity II Brechungsindexdetektor 1 13516 0 0 40 8109.6 8109.6 40 0 0 0 ISL100D1 Detectors
12 11 M8414AA LI OpenLab CDS Workstation PC-Paket 1 16854 0 0 40 10112.4 10112.4 40 0 0 0 ISF300F110 OpenLAB CDS w/Hardware
13 12 M8414AA 001 LI LC Geraeteverbindung 1 0 0 0 40 0 0 40 0 0 0
14 13 SYS-LC-1260II 74 LC 1260 Infinity II System 1 0 0 0 20 0 0 20 0 0 0 TSSYS0SYLC Service Systems - Liquid Chromatography
15 14 SYS-LC-1260II 2A9 74 Standard-Einweisung 1 999 0 0 20 799.2 799.2 20 0 0 0 TSSTRN Training Services
16 15 SYS-LC-1260II 8R2 74 CrossLab Silver - 2J, kompl. 1 10403 0 0 35 6761.95 6761.95 30 0 5 0 TSSYS2 Serviced As Systems - 2 YR > 29

@ -0,0 +1,17 @@
# Part Number Opt PL Description Qty Price EUR Breaks EUR Uplift % Total Discount % Net EUR Total EUR Sales Discount YA9% Contractual Discount Y99% Promotion Discount Y07% Demo Discount Y04% PH Code PH Description YMax
1 G7104C 29 1260 Infinity II Flexible Pumpe 1 33344 0 0 40 20006.4 20006.4 40 0 0 0 ISL100P1 Pumps
2 G7104C 001 29 HPLC System Tool-Kit 1260 Infinity II 1 377 0 0 40 226.2 226.2 40 0 0 0
3 G7104C 004 29 Agilent Lab Advisor Advanced Software 1 1574 0 0 40 944.4 944.4 40 0 0 0
4 G7104C 034 29 InfinityLab Stay Safe Verschl., St.-Kit 1 664 0 0 40 398.4 398.4 40 0 0 0
5 G7104C 097 29 Poroshell 120 EC-C18 3,0x150mm, 2,7um 1 1 0 0 40 0.6 0.6 40 0 0 0
6 G7167A 29 1260 Infinity II Mehrfachprobengeber 1 27195 0 0 40 16317 16317 40 0 0 0 ISL100A1 Autosamplers
7 G7167A 060 29 Nutzung vorhandene Lizenz 1 -1733 0 0 40 -1039.8 -1039.8 40 0 0 0
8 G7167A 101 29 Agilent InfinityLab Proben-Thermostat 1 5871 0 0 40 3522.6 3522.6 40 0 0 0
9 G7116A 29 1260 Infinity II Therm. f. mehr. Saeulen 1 6275 0 0 40 3765 3765 40 0 0 0 ISL100LC1 LC Hardware
10 G7162A 29 1260 Infinity II Brechungsindexdetektor 1 13516 0 0 40 8109.6 8109.6 40 0 0 0 ISL100D1 Detectors
11 M8414AA LI OpenLab CDS Workstation PC-Paket 1 16854 0 0 40 10112.4 10112.4 40 0 0 0 ISF300F110 OpenLAB CDS w/Hardware
12 M8414AA 001 LI LC Geraeteverbindung 1 0 0 0 40 0 0 40 0 0 0
13 SYS-LC-1260II 74 LC 1260 Infinity II System 1 0 0 0 20 0 0 20 0 0 0 TSSYS0SYLC Service Systems - Liquid Chromatography
14 SYS-LC-1260II 2A9 74 Standard-Einweisung 1 999 0 0 20 799.2 799.2 20 0 0 0 TSSTRN Training Services
15 SYS-LC-1260II 8R2 74 CrossLab Silver - 2J, kompl. 1 10403 0 0 35 6761.95 6761.95 30 0 5 0 TSSYS2 Serviced As Systems - 2 YR > 29
1 # Part Number Opt PL Description Qty Price EUR Breaks EUR Uplift % Total Discount % Net EUR Total EUR Sales Discount YA9% Contractual Discount Y99% Promotion Discount Y07% Demo Discount Y04% PH Code PH Description YMax
2 1 G7104C 29 1260 Infinity II Flexible Pumpe 1 33344 0 0 40 20006.4 20006.4 40 0 0 0 ISL100P1 Pumps
3 2 G7104C 001 29 HPLC System Tool-Kit 1260 Infinity II 1 377 0 0 40 226.2 226.2 40 0 0 0
4 3 G7104C 004 29 Agilent Lab Advisor Advanced Software 1 1574 0 0 40 944.4 944.4 40 0 0 0
5 4 G7104C 034 29 InfinityLab Stay Safe Verschl., St.-Kit 1 664 0 0 40 398.4 398.4 40 0 0 0
6 5 G7104C 097 29 Poroshell 120 EC-C18 3,0x150mm, 2,7um 1 1 0 0 40 0.6 0.6 40 0 0 0
7 6 G7167A 29 1260 Infinity II Mehrfachprobengeber 1 27195 0 0 40 16317 16317 40 0 0 0 ISL100A1 Autosamplers
8 7 G7167A 060 29 Nutzung vorhandene Lizenz 1 -1733 0 0 40 -1039.8 -1039.8 40 0 0 0
9 8 G7167A 101 29 Agilent InfinityLab Proben-Thermostat 1 5871 0 0 40 3522.6 3522.6 40 0 0 0
10 9 G7116A 29 1260 Infinity II Therm. f. mehr. Saeulen 1 6275 0 0 40 3765 3765 40 0 0 0 ISL100LC1 LC Hardware
11 10 G7162A 29 1260 Infinity II Brechungsindexdetektor 1 13516 0 0 40 8109.6 8109.6 40 0 0 0 ISL100D1 Detectors
12 11 M8414AA LI OpenLab CDS Workstation PC-Paket 1 16854 0 0 40 10112.4 10112.4 40 0 0 0 ISF300F110 OpenLAB CDS w/Hardware
13 12 M8414AA 001 LI LC Geraeteverbindung 1 0 0 0 40 0 0 40 0 0 0
14 13 SYS-LC-1260II 74 LC 1260 Infinity II System 1 0 0 0 20 0 0 20 0 0 0 TSSYS0SYLC Service Systems - Liquid Chromatography
15 14 SYS-LC-1260II 2A9 74 Standard-Einweisung 1 999 0 0 20 799.2 799.2 20 0 0 0 TSSTRN Training Services
16 15 SYS-LC-1260II 8R2 74 CrossLab Silver - 2J, kompl. 1 10403 0 0 35 6761.95 6761.95 30 0 5 0 TSSYS2 Serviced As Systems - 2 YR > 29

@ -0,0 +1,17 @@
# Part Number Opt PL Description Qty Price EUR Breaks EUR Uplift % Total Discount % Net EUR Total EUR Sales Discount YA9% Contractual Discount Y99% Promotion Discount Y07% Demo Discount Y04% PH Code PH Description YMax
1 G7104C 29 1260 Infinity II Flexible Pumpe 1 33344 0 0 40 20006.4 20006.4 40 0 0 0 ISL100P1 Pumps
2 G7104C 001 29 HPLC System Tool-Kit 1260 Infinity II 1 377 0 0 40 226.2 226.2 40 0 0 0
3 G7104C 004 29 Agilent Lab Advisor Advanced Software 1 1574 0 0 40 944.4 944.4 40 0 0 0
4 G7104C 034 29 InfinityLab Stay Safe Verschl., St.-Kit 1 664 0 0 40 398.4 398.4 40 0 0 0
5 G7104C 097 29 Poroshell 120 EC-C18 3,0x150mm, 2,7um 1 1 0 0 40 0.6 0.6 40 0 0 0
6 G7167A 29 1260 Infinity II Mehrfachprobengeber 1 27195 0 0 40 16317 16317 40 0 0 0 ISL100A1 Autosamplers
7 G7167A 060 29 Nutzung vorhandene Lizenz 1 -1733 0 0 40 -1039.8 -1039.8 40 0 0 0
8 G7167A 101 29 Agilent InfinityLab Proben-Thermostat 1 5871 0 0 40 3522.6 3522.6 40 0 0 0
9 G7116A 29 1260 Infinity II Therm. f. mehr. Saeulen 1 6275 0 0 40 3765 3765 40 0 0 0 ISL100LC1 LC Hardware
10 G7162A 29 1260 Infinity II Brechungsindexdetektor 1 13516 0 0 40 8109.6 8109.6 40 0 0 0 ISL100D1 Detectors
11 M8414AA LI OpenLab CDS Workstation PC-Paket 1 16854 0 0 40 10112.4 10112.4 40 0 0 0 ISF300F110 OpenLAB CDS w/Hardware
12 M8414AA 001 LI LC Geraeteverbindung 1 0 0 0 40 0 0 40 0 0 0
13 SYS-LC-1260II 74 LC 1260 Infinity II System 1 0 0 0 20 0 0 20 0 0 0 TSSYS0SYLC Service Systems - Liquid Chromatography
14 SYS-LC-1260II 2A9 74 Standard-Einweisung 1 999 0 0 20 799.2 799.2 20 0 0 0 TSSTRN Training Services
15 SYS-LC-1260II 8R2 74 CrossLab Silver - 2J, kompl. 1 10403 0 0 35 6761.95 6761.95 30 0 5 0 TSSYS2 Serviced As Systems - 2 YR > 29
1 # Part Number Opt PL Description Qty Price EUR Breaks EUR Uplift % Total Discount % Net EUR Total EUR Sales Discount YA9% Contractual Discount Y99% Promotion Discount Y07% Demo Discount Y04% PH Code PH Description YMax
2 1 G7104C 29 1260 Infinity II Flexible Pumpe 1 33344 0 0 40 20006.4 20006.4 40 0 0 0 ISL100P1 Pumps
3 2 G7104C 001 29 HPLC System Tool-Kit 1260 Infinity II 1 377 0 0 40 226.2 226.2 40 0 0 0
4 3 G7104C 004 29 Agilent Lab Advisor Advanced Software 1 1574 0 0 40 944.4 944.4 40 0 0 0
5 4 G7104C 034 29 InfinityLab Stay Safe Verschl., St.-Kit 1 664 0 0 40 398.4 398.4 40 0 0 0
6 5 G7104C 097 29 Poroshell 120 EC-C18 3,0x150mm, 2,7um 1 1 0 0 40 0.6 0.6 40 0 0 0
7 6 G7167A 29 1260 Infinity II Mehrfachprobengeber 1 27195 0 0 40 16317 16317 40 0 0 0 ISL100A1 Autosamplers
8 7 G7167A 060 29 Nutzung vorhandene Lizenz 1 -1733 0 0 40 -1039.8 -1039.8 40 0 0 0
9 8 G7167A 101 29 Agilent InfinityLab Proben-Thermostat 1 5871 0 0 40 3522.6 3522.6 40 0 0 0
10 9 G7116A 29 1260 Infinity II Therm. f. mehr. Saeulen 1 6275 0 0 40 3765 3765 40 0 0 0 ISL100LC1 LC Hardware
11 10 G7162A 29 1260 Infinity II Brechungsindexdetektor 1 13516 0 0 40 8109.6 8109.6 40 0 0 0 ISL100D1 Detectors
12 11 M8414AA LI OpenLab CDS Workstation PC-Paket 1 16854 0 0 40 10112.4 10112.4 40 0 0 0 ISF300F110 OpenLAB CDS w/Hardware
13 12 M8414AA 001 LI LC Geraeteverbindung 1 0 0 0 40 0 0 40 0 0 0
14 13 SYS-LC-1260II 74 LC 1260 Infinity II System 1 0 0 0 20 0 0 20 0 0 0 TSSYS0SYLC Service Systems - Liquid Chromatography
15 14 SYS-LC-1260II 2A9 74 Standard-Einweisung 1 999 0 0 20 799.2 799.2 20 0 0 0 TSSTRN Training Services
16 15 SYS-LC-1260II 8R2 74 CrossLab Silver - 2J, kompl. 1 10403 0 0 35 6761.95 6761.95 30 0 5 0 TSSYS2 Serviced As Systems - 2 YR > 29

@ -0,0 +1,119 @@
using Gremlin_BlazorServer.Data.EntityClasses;
using System.Diagnostics;
using System.Reflection;
using System.Text;
//using Outlook = Microsoft.Office.Interop.Outlook;
namespace Gremlin_BlazorServer.Services
{
internal static class FileService
{
private static readonly Encoding defaultEncodingIfNoBom = Encoding.UTF8;
private static readonly string currentDirectory = Directory.GetCurrentDirectory();
public static string ReadResource(string name)
{
Assembly assembly = Assembly.GetExecutingAssembly();
// Format: "{Namespace}.{Folder}.{filename}.{Extension}"
string resourcePath = name.StartsWith(nameof(Gremlin_BlazorServer))
? name
: assembly.GetManifestResourceNames().Single(str => str.EndsWith(name));
using (Stream? stream = assembly.GetManifestResourceStream(resourcePath))
{
if (stream == null) { return ""; }
using (StreamReader reader = new(stream))
{
return reader.ReadToEnd();
}
}
}
// public static string GetFilepathFromUser(string filter = "Delimited Data File|*.csv; *.txt; *.tsv")
// {
// string _filepath = "";
// OpenFileDialog dlg = new()
// {
// Multiselect = false,
// Filter = filter
// };
// if (dlg.ShowDialog() == true)
// {
// //Auswahl dlg.filenames an passende Objekte übergeben
// _filepath = dlg.FileName;
// }
// return _filepath;
// }
internal static void OpenFile(string path, string file, string type)
{
try
{
_ = Process.Start(path == "" ? $"{file}.{type}" : $"{path}\\{file}.{type}");
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
}
public static Encoding GetEncoding(string fileName)
{
Stream fileStream = File.OpenRead(fileName);
using (StreamReader reader = new(fileStream, defaultEncodingIfNoBom, true))
{
_ = reader.Peek();
Encoding encoding = reader.CurrentEncoding;
return encoding;
}
}
public static void WriteClipboardToTSV(string clipboard, Quote quote)
{
string datei = $"{currentDirectory}\\Quotes\\{quote.Recipient.Account.AccountId}\\{quote.Recipient.ContactId}\\{quote.QuotationNumber}.tsv";
FileInfo fileInfo = new(datei);
if (!fileInfo.Directory.Exists) { Directory.CreateDirectory(fileInfo.DirectoryName); }
using StreamWriter writer = new(datei, false, Encoding.UTF8);
{
writer.WriteLine(clipboard);
}
}
public static void WriteTexFile(Quote quote)
{
string datei = $"{currentDirectory}\\Quotes\\{quote.Recipient.Account.AccountId}\\{quote.Recipient.ContactId}\\{quote.QuotationNumber}.tex";
FileInfo fileInfo = new(datei);
if (!fileInfo.Directory.Exists) { Directory.CreateDirectory(fileInfo.DirectoryName); }
using StreamWriter writer = new(datei, false, Encoding.UTF8);
{
writer.WriteLine(quote.Tex);
}
}
//public static void SendQuoteViaMail(QuoteVM quoteVM)
//{
// Outlook.Application application = new();
// Outlook.MailItem mail = application.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
// mail.Subject = quoteVM.QuoteNumber;
// Outlook.AddressEntry currentUser = application.Session.CurrentUser.AddressEntry;
// if (currentUser.Type == "EX")
// {
// Outlook.ExchangeUser manager = currentUser.GetExchangeUser().GetExchangeUserManager();
// // Add recipient using display name, alias, or smtp address
// mail.Recipients.Add(manager.PrimarySmtpAddress);
// mail.Recipients.ResolveAll();
// mail.Attachments.Add($"{quoteVM.QuoteNumber}.pdf", Outlook.OlAttachmentType.olByValue, Type.Missing, Type.Missing);
// mail.Send();
// }
//}
}
}

@ -1,100 +0,0 @@
using System.Diagnostics;
using System.Reflection;
using System.Text;
//using Outlook = Microsoft.Office.Interop.Outlook;
namespace Gremlin_BlazorServer.Services
{
internal static class FileIO
{
public static string ReadResource(string name)
{
Assembly assembly = Assembly.GetExecutingAssembly();
// Format: "{Namespace}.{Folder}.{filename}.{Extension}"
string resourcePath = name.StartsWith(nameof(Gremlin_BlazorServer))
? name
: assembly.GetManifestResourceNames().Single(str => str.EndsWith(name));
using (Stream? stream = assembly.GetManifestResourceStream(resourcePath))
{
if (stream == null) { return ""; }
using (StreamReader reader = new(stream))
{
return reader.ReadToEnd();
}
}
}
private static readonly Encoding defaultEncodingIfNoBom = Encoding.UTF8;
// public static string GetFilepathFromUser(string filter = "Delimited Data File|*.csv; *.txt; *.tsv")
// {
// string _filepath = "";
// OpenFileDialog dlg = new()
// {
// Multiselect = false,
// Filter = filter
// };
// if (dlg.ShowDialog() == true)
// {
// //Auswahl dlg.filenames an passende Objekte übergeben
// _filepath = dlg.FileName;
// }
// return _filepath;
// }
internal static void OpenFile(string path, string file, string type)
{
try
{
_ = Process.Start(path == "" ? $"{file}.{type}" : $"{path}\\{file}.{type}");
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
}
public static Encoding GetEncoding(string fileName)
{
Stream fileStream = File.OpenRead(fileName);
using (StreamReader reader = new(fileStream, defaultEncodingIfNoBom, true))
{
_ = reader.Peek();
Encoding encoding = reader.CurrentEncoding;
return encoding;
}
}
// public static void WriteClipboardToTSV(string clipboard, QuoteViewModel quoteVM)
// {
// string datei = quoteVM.QuotePath + quoteVM.QuoteNumber + ".tsv";
// using StreamWriter writer = new(datei, false, Encoding.UTF8);
// {
// writer.WriteLine(clipboard);
// }
// }
//public static void SendQuoteViaMail(QuoteVM quoteVM)
//{
// Outlook.Application application = new();
// Outlook.MailItem mail = application.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
// mail.Subject = quoteVM.QuoteNumber;
// Outlook.AddressEntry currentUser = application.Session.CurrentUser.AddressEntry;
// if (currentUser.Type == "EX")
// {
// Outlook.ExchangeUser manager = currentUser.GetExchangeUser().GetExchangeUserManager();
// // Add recipient using display name, alias, or smtp address
// mail.Recipients.Add(manager.PrimarySmtpAddress);
// mail.Recipients.ResolveAll();
// mail.Attachments.Add($"{quoteVM.QuoteNumber}.pdf", Outlook.OlAttachmentType.olByValue, Type.Missing, Type.Missing);
// mail.Send();
// }
//}
}
}

@ -154,7 +154,7 @@ namespace Gremlin_BlazorServer.Services.GUClasses
public static List<DataIdentifier> ReadDataIdentifierFromFile()
{
List<DataIdentifier> result = new(50);
string fileInput = FileIO.ReadResource("DataIdentifier.txt");
string fileInput = FileService.ReadResource("DataIdentifier.txt");
string[] lines = fileInput.Split(Environment.NewLine);
foreach (string line in lines)
{