update 20241125
This commit is contained in:
@@ -44,6 +44,9 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CSVNET">
|
||||
<HintPath>..\CSVNET\bin\Debug\CSVNET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.AspNetCore.Http, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNetCore.Http.2.2.2\lib\netstandard2.0\Microsoft.AspNetCore.Http.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -11,13 +11,15 @@ using System.Net.Http;
|
||||
using System.Runtime.Serialization.Formatters;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using SecuringWebApiUsingApiKey.Middleware;
|
||||
|
||||
namespace API_NetFramework.Controllers
|
||||
{
|
||||
public class AntwortAdresseController : ApiController
|
||||
{
|
||||
string tokenfunction = "Adresse";
|
||||
string connectionstring = ConfigurationManager.ConnectionStrings["EDOKAConnectionstring"].ConnectionString;
|
||||
string connectionstring = StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["EDOKAConnectionstring"].ConnectionString, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm");
|
||||
|
||||
/// <summary>
|
||||
/// GetGetAll liefert alle GAS-Adressen
|
||||
/// </summary>
|
||||
|
||||
@@ -19,6 +19,8 @@ using System.Text;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using System.Security.Cryptography;
|
||||
using System.Net.Http.Headers;
|
||||
using SecuringWebApiUsingApiKey.Middleware;
|
||||
using DOCGEN.Klassen;
|
||||
|
||||
|
||||
namespace API_NetFramework.Controllers
|
||||
@@ -46,20 +48,20 @@ namespace API_NetFramework.Controllers
|
||||
{
|
||||
// GET: OnBase
|
||||
string tokenfunction = "Archiv";
|
||||
string connectionstring = ConfigurationManager.ConnectionStrings["EDOKAConnectionstring"].ConnectionString;
|
||||
string connectionstring = StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["EDOKAConnectionstring"].ConnectionString, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm");
|
||||
|
||||
private void Update_IL_Log(ref ILResponse ilr, string dokumentid)
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start Updaet IL_Log: DokumentID:" + dokumentid, LogLevelType.Debug);
|
||||
|
||||
DB dB = new DB(ConfigurationManager.ConnectionStrings["JournalConnectionstring"].ConnectionString);
|
||||
DB dB = new DB(StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["JournalConnectionstring"].ConnectionString, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm"));
|
||||
string sql = "Insert OnDoc_IL_Log (dokumentid, ilresponse,error, erstellt_am) values ('" + dokumentid + "',";
|
||||
sql = sql + "'" + ilr.response.ToString() + "',";
|
||||
if (ilr.senderror != 0) { sql = sql + "1,"; } else { sql = sql + "0,"; }
|
||||
sql = sql +"getdate() )";
|
||||
dB.Exec_SQL(sql);
|
||||
dB = null;
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Updaet IL_Log: DokumentID:" + dokumentid, LogLevelType.Debug);
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Update IL_Log: DokumentID:" + dokumentid, LogLevelType.Debug);
|
||||
}
|
||||
|
||||
private void update_dokumentstatus(string dokumentid)
|
||||
@@ -89,8 +91,15 @@ namespace API_NetFramework.Controllers
|
||||
}
|
||||
try
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start ArchiveDocFromDatabase: DokumentID:"+DokumentID, LogLevelType.Debug);
|
||||
|
||||
string doktypnr = "";
|
||||
string extension = "";
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start ArchiveDocFromDatabase: DokumentID:" + DokumentID, LogLevelType.Debug);
|
||||
DB db = new DB(connectionstring);
|
||||
|
||||
db.Get_Tabledata("Select dokumenttypnr, dokumentname from dokument where dokumentid='" + DokumentID+"'", false, true);
|
||||
extension = System.IO.Path.GetExtension(db.dsdaten.Tables[0].Rows[0]["dokumentname"].ToString());
|
||||
doktypnr = db.dsdaten.Tables[0].Rows[0][0].ToString();
|
||||
db.clear_parameter();
|
||||
db.add_parameter("@dokumentid", DokumentID);
|
||||
db.Get_Tabledata("[sp_Get_OnDoc_Parameters]", true, false);
|
||||
@@ -98,8 +107,18 @@ namespace API_NetFramework.Controllers
|
||||
|
||||
DocGet dg = new DocGet(connectionstring);
|
||||
clsdok dok = new clsdok("", "", "");
|
||||
|
||||
dok = dg.GetDocAsPDF(DokumentID);
|
||||
|
||||
|
||||
string[] officeformat = System.Configuration.ConfigurationManager.AppSettings["ArchivierungOfficeFormat"].ToString().Split(',');
|
||||
if (officeformat.Contains(doktypnr) || extension.ToUpper()=="PDF")
|
||||
{
|
||||
dg.GetDoc(DokumentID);
|
||||
extension = extension.ToUpper().Replace(".", "");
|
||||
}
|
||||
else {
|
||||
dok = dg.GetDocAsPDF(DokumentID);
|
||||
extension = "PDF";
|
||||
}
|
||||
|
||||
if (db.dsdaten.Tables[0].Rows[0]["BpNummer"].ToString() == "")
|
||||
{
|
||||
@@ -112,19 +131,15 @@ namespace API_NetFramework.Controllers
|
||||
onbasedoc.personNummer = "";
|
||||
}
|
||||
onbasedoc.dokumentDatum = db.dsdaten.Tables[0].Rows[0]["DokumentDatum"].ToString();
|
||||
onbasedoc.dokumentTyp = db.dsdaten.Tables[0].Rows[0]["dokumenttyp"].ToString();
|
||||
onbasedoc.dateiTyp = db.dsdaten.Tables[0].Rows[0]["dateityp"].ToString();
|
||||
onbasedoc.dokumentTyp = db.dsdaten.Tables[0].Rows[0]["dokumenttyp"].ToString(); ;
|
||||
onbasedoc.dateiTyp = extension;
|
||||
var Attribute = new List<Model.OnBaseDocUpload.attribute>();
|
||||
onbasedoc.attributes = new List<Model.OnBaseDocUpload.attribute>();
|
||||
foreach (System.Data.DataRow rw in db.dsdaten.Tables[1].Rows)
|
||||
{
|
||||
var p = new OnBaseDocUpload.attribute()
|
||||
{
|
||||
fieldname = rw["fieldname"].ToString(),
|
||||
fieldvalue = rw["fieldvalue"].ToString()
|
||||
};
|
||||
Attribute.Add(p);
|
||||
OnBaseDocUpload.attribute na = new OnBaseDocUpload.attribute(rw["fieldname"].ToString(), rw["fieldvalue"].ToString());
|
||||
onbasedoc.attributes.Add(na);
|
||||
}
|
||||
onbasedoc.attributes = Attribute;
|
||||
onbasedoc.dokumentDatei = dok.dokument;
|
||||
db = null;
|
||||
ILResponse ilr = new ILResponse();
|
||||
@@ -175,36 +190,6 @@ namespace API_NetFramework.Controllers
|
||||
}
|
||||
|
||||
|
||||
//[HttpGet]
|
||||
//[Route("API/ArchiveDocBase64")]
|
||||
///// <summary>
|
||||
///// Archiviert das als Base64String übergebene Dokument in OnBase
|
||||
///// </summary>
|
||||
///// <param name="DokumentID"></param>
|
||||
///// <param name="Dokumenttyp"></param>
|
||||
///// <returns>
|
||||
///// Returncode: 200 (OK)
|
||||
///// Dokumenthandle aus OnBase
|
||||
///// </returns>
|
||||
///// <remarks></remarks>
|
||||
////
|
||||
//public IHttpActionResult ArchivDocBase64(string DokumentID, string Dokumenttyp)
|
||||
//{
|
||||
// if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false)
|
||||
// {
|
||||
// return Content(HttpStatusCode.Unauthorized, "Invalid Token or API-Key");
|
||||
// }
|
||||
// try
|
||||
// {
|
||||
|
||||
// return Ok();
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// APILogging.Log((HttpRequestMessage)Request, e.Message, LogLevelType.Error);
|
||||
// return Content(HttpStatusCode.InternalServerError, e.Message);
|
||||
// }
|
||||
//}
|
||||
/// <summary>
|
||||
/// CheckDocID prüft auf eine vorhandene DokumentID in OnDoc (DokumentID OFFEDK... / Barcode-Klenber-Nr)
|
||||
/// </summary>
|
||||
@@ -234,8 +219,7 @@ namespace API_NetFramework.Controllers
|
||||
db.Get_Tabledata("Select barcodenr from barcodeetikette where dokumentid='" + DokumentID + "'", false, true);
|
||||
if (db.dsdaten.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
return (ArchivDocFromIRIS(DokumentID));
|
||||
//return Ok(DokumentID);
|
||||
return Ok(DokumentID);
|
||||
}
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Check DokumentID: DokumentID:" + DokumentID, LogLevelType.Debug);
|
||||
|
||||
@@ -282,8 +266,7 @@ namespace API_NetFramework.Controllers
|
||||
APILogging.Log((HttpRequestMessage)Request, db.dsdaten.Tables[0].Rows[0].ToString() + dokumentid, LogLevelType.Debug);
|
||||
return Content(HttpStatusCode.NotFound, returnmessage);
|
||||
case "0":
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende ArchivDocFromIRIS DokumentID:" + dokumentid, LogLevelType.Debug);
|
||||
return Ok(dokumentid);
|
||||
return (ArchivDocFromDatabase(dokumentid));
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@ using Newtonsoft.Json;
|
||||
using API_NetFramework.Models;
|
||||
using System.Security.Cryptography;
|
||||
using edoka_dms;
|
||||
using SecuringWebApiUsingApiKey.Middleware;
|
||||
|
||||
|
||||
namespace API_NetFramework.Controllers
|
||||
@@ -24,7 +25,7 @@ namespace API_NetFramework.Controllers
|
||||
public class DocumentController : ApiController
|
||||
{
|
||||
public string tokenfunction = "Dokument";
|
||||
string connectionstring = ConfigurationManager.ConnectionStrings["EDOKAConnectionstring"].ConnectionString;
|
||||
string connectionstring = StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["EDOKAConnectionstring"].ConnectionString, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm");
|
||||
[HttpGet]
|
||||
[Route("API/GetDocument")]
|
||||
public IHttpActionResult GetDocument(string dokid)
|
||||
|
||||
@@ -16,6 +16,7 @@ using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using API_NetFramework.Models;
|
||||
using System.Web.Http.Controllers;
|
||||
using SecuringWebApiUsingApiKey.Middleware;
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +37,8 @@ namespace API_NetFramework.Controllers
|
||||
public class UnterschriftController : ApiController
|
||||
{
|
||||
string tokenfunction = "Unterschrift";
|
||||
string connectionstring = ConfigurationManager.ConnectionStrings["EDOKAConnectionstring"].ConnectionString;
|
||||
string connectionstring = StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["EDOKAConnectionstring"].ConnectionString, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm");
|
||||
|
||||
[HttpGet]
|
||||
[Route("API/GetUnterschriftAsBase64")]
|
||||
public IHttpActionResult GetUnterschriftAsBase64(string TGNummer)
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Configuration;
|
||||
using Database;
|
||||
using System.Net.Http;
|
||||
using System.ComponentModel;
|
||||
using SecuringWebApiUsingApiKey.Middleware;
|
||||
|
||||
namespace API_NetFramework.Models
|
||||
{
|
||||
@@ -18,7 +19,7 @@ namespace API_NetFramework.Models
|
||||
{
|
||||
if (Logging.Logging.IntLogLevel == "")
|
||||
{
|
||||
string connectionstring = ConfigurationManager.ConnectionStrings["EDOKAConnectionstring"].ConnectionString;
|
||||
string connectionstring = StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["EDOKAConnectionstring"].ConnectionString, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm");
|
||||
DB db = new DB(connectionstring);
|
||||
db.Get_Tabledata("Select * from nlog_parameter where id=3", false, true);
|
||||
Logging.Logging.IntLogLevel = db.dsdaten.Tables[0].Rows[0]["LogLevel"].ToString();
|
||||
|
||||
@@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<_PublishTargetUrl>E:\Software-Projekte\OnDoc\PubServices\OnDoc</_PublishTargetUrl>
|
||||
<History>True|2024-11-13T16:47:13.0183160Z||;True|2024-11-13T17:46:36.5183689+01:00||;True|2024-11-11T13:42:23.6578245+01:00||;True|2024-11-09T12:11:00.0777236+01:00||;True|2024-11-09T11:54:51.8503924+01:00||;</History>
|
||||
<History>True|2024-11-24T17:56:32.4321643Z||;True|2024-11-24T18:48:11.3494435+01:00||;True|2024-11-24T17:50:10.7679996+01:00||;True|2024-11-22T08:35:58.1296657+01:00||;True|2024-11-13T17:47:13.0183160+01:00||;True|2024-11-13T17:46:36.5183689+01:00||;True|2024-11-11T13:42:23.6578245+01:00||;True|2024-11-09T12:11:00.0777236+01:00||;True|2024-11-09T11:54:51.8503924+01:00||;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
@@ -82,16 +82,22 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<publishTime>09/04/2024 19:25:14</publishTime>
|
||||
</File>
|
||||
<File Include="bin/BarcodeLib.dll">
|
||||
<publishTime>11/18/2024 17:07:41</publishTime>
|
||||
<publishTime>11/24/2024 14:23:50</publishTime>
|
||||
</File>
|
||||
<File Include="bin/BarcodeLib.pdb">
|
||||
<publishTime>11/18/2024 17:07:41</publishTime>
|
||||
<publishTime>11/24/2024 14:23:50</publishTime>
|
||||
</File>
|
||||
<File Include="bin/CSVNET.dll">
|
||||
<publishTime>11/23/2024 19:27:07</publishTime>
|
||||
</File>
|
||||
<File Include="bin/CSVNET.pdb">
|
||||
<publishTime>11/23/2024 19:27:07</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Database.dll">
|
||||
<publishTime>11/20/2024 15:24:20</publishTime>
|
||||
<publishTime>11/24/2024 17:50:08</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Database.pdb">
|
||||
<publishTime>11/20/2024 15:24:20</publishTime>
|
||||
<publishTime>11/24/2024 17:50:08</publishTime>
|
||||
</File>
|
||||
<File Include="bin/de/System.Net.Http.Formatting.resources.dll">
|
||||
<publishTime>10/20/2023 22:35:02</publishTime>
|
||||
@@ -124,13 +130,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<publishTime>10/20/2023 22:35:04</publishTime>
|
||||
</File>
|
||||
<File Include="bin/DOCGEN.dll">
|
||||
<publishTime>11/20/2024 15:24:21</publishTime>
|
||||
<publishTime>11/24/2024 17:50:08</publishTime>
|
||||
</File>
|
||||
<File Include="bin/DOCGEN.dll.config">
|
||||
<publishTime>11/18/2024 16:59:09</publishTime>
|
||||
</File>
|
||||
<File Include="bin/DOCGEN.pdb">
|
||||
<publishTime>11/20/2024 15:24:21</publishTime>
|
||||
<publishTime>11/24/2024 17:50:08</publishTime>
|
||||
</File>
|
||||
<File Include="bin/FastReport.Bars.dll">
|
||||
<publishTime>11/27/2023 09:49:58</publishTime>
|
||||
@@ -208,10 +214,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<publishTime>11/04/2022 19:09:46</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Model.dll">
|
||||
<publishTime>11/20/2024 15:24:20</publishTime>
|
||||
<publishTime>11/22/2024 12:26:16</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Model.pdb">
|
||||
<publishTime>11/20/2024 15:24:20</publishTime>
|
||||
<publishTime>11/22/2024 12:26:16</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Newtonsoft.Json.Bson.dll">
|
||||
<publishTime>11/28/2018 00:10:18</publishTime>
|
||||
@@ -235,16 +241,16 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<publishTime>11/18/2024 17:07:31</publishTime>
|
||||
</File>
|
||||
<File Include="bin/OnDocOffice.dll">
|
||||
<publishTime>11/20/2024 15:24:21</publishTime>
|
||||
<publishTime>11/24/2024 17:50:08</publishTime>
|
||||
</File>
|
||||
<File Include="bin/OnDocOffice.pdb">
|
||||
<publishTime>11/20/2024 15:24:21</publishTime>
|
||||
<publishTime>11/24/2024 17:50:08</publishTime>
|
||||
</File>
|
||||
<File Include="bin/OnDoc_NetFramework.dll">
|
||||
<publishTime>11/20/2024 15:24:21</publishTime>
|
||||
<publishTime>11/24/2024 18:56:30</publishTime>
|
||||
</File>
|
||||
<File Include="bin/OnDoc_NetFramework.pdb">
|
||||
<publishTime>11/20/2024 15:24:21</publishTime>
|
||||
<publishTime>11/24/2024 18:56:30</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Owin.dll">
|
||||
<publishTime>11/13/2012 13:19:34</publishTime>
|
||||
@@ -429,6 +435,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<File Include="bin/System.Web.WebPages.Razor.dll">
|
||||
<publishTime>10/20/2023 22:33:58</publishTime>
|
||||
</File>
|
||||
<File Include="bin/VBFileManagement.dll">
|
||||
<publishTime>11/24/2024 12:59:01</publishTime>
|
||||
</File>
|
||||
<File Include="bin/VBFileManagement.pdb">
|
||||
<publishTime>11/24/2024 12:59:01</publishTime>
|
||||
</File>
|
||||
<File Include="bin/WebActivatorEx.dll">
|
||||
<publishTime>05/10/2016 15:11:52</publishTime>
|
||||
</File>
|
||||
@@ -622,7 +634,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<publishTime>03/06/2024 08:11:55</publishTime>
|
||||
</File>
|
||||
<File Include="Web.config">
|
||||
<publishTime>11/20/2024 15:24:22</publishTime>
|
||||
<publishTime>11/24/2024 17:50:09</publishTime>
|
||||
</File>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -21,10 +21,13 @@
|
||||
<add key="ILFast" value="https://localhost:44303/API/Fast" />
|
||||
<add key="ILSlow" value="https://localhost:44303/API/Slow" />
|
||||
<add key="ILDocupload" value="" />
|
||||
<add key="ArchivierungOfficeFormat" value="1983,2396,2397,2421" />
|
||||
<add key="ExcelValueFile" value="x:\exceldata.csv" />
|
||||
<add key="ExcelDokType" value="2421" />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="EDOKAConnectionstring" connectionString="Data Source=shu01\shu00;Initial Catalog=edoka_dms;Persist Security Info=True;User ID=sa;Password=*shu29;" />
|
||||
<add name="JournalConnectionstring" connectionString="Data Source=shu01\shu00;Initial Catalog=edoka_journale;Persist Security Info=True;User ID=sa;Password=*shu29;" />
|
||||
<add name="EDOKAConnectionstring" connectionString="Po7oIigu4hOz6zXOpaSnrhveCQyfGgFeskvEQsvm3CEgxjJMEYYDEbnWlt9Qr9vGTkzqm5hvURTLA1hKVU++/ozcvT5qIVTpDLBTKd4AM/4YgN3+L9cx3mxMoWmv1JMjqxZVbR6GYiuSo1xuD05sl3IGoUenfugP6hBP/IC7MjUjisDUE6msFpWiraJr53gcfDvIrc2CUBTVUS+f94kewhlKxjtEohtCM71PN2zpoMiPyBIuXDyrYlYyokUOg6uV" />
|
||||
<add name="JournalConnectionstring" connectionString="fPYJwxH9angA+JMQ9OUQ4hfBQZR9aohQseovi6H5GI0fPBr22eh34jHXesVUNDhwsPJJ0OmlpwxTCTVyjoY1Aw40d5tZuSeZO/1jKhPU/Yg+Ek2kXe/VFlTN0CxG/er1XxAtLOHL62GJMnpNryUkqIbKJqa46rB0JbLACg8WMdk7/0GmEn39Gi54EQMywlbZ2dCffgfko6mudawZ4vkzWcpH0QxSqBqu8sCtpZYSEl9VYnnX/SwJHVlgOuWgtcxt" />
|
||||
</connectionStrings>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.8.1" />
|
||||
|
||||
BIN
API_NetFramework/bin/CSVNET.dll
Normal file
BIN
API_NetFramework/bin/CSVNET.dll
Normal file
Binary file not shown.
BIN
API_NetFramework/bin/CSVNET.pdb
Normal file
BIN
API_NetFramework/bin/CSVNET.pdb
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -21,10 +21,13 @@
|
||||
<add key="ILFast" value="https://localhost:44303/API/Fast" />
|
||||
<add key="ILSlow" value="https://localhost:44303/API/Slow" />
|
||||
<add key="ILDocupload" value="" />
|
||||
<add key="ArchivierungOfficeFormat" value="1983,2396,2397,2421" />
|
||||
<add key="ExcelValueFile" value="x:\exceldata.csv" />
|
||||
<add key="ExcelDokType" value="2421" />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="EDOKAConnectionstring" connectionString="Data Source=shu01\shu00;Initial Catalog=edoka_dms;Persist Security Info=True;User ID=sa;Password=*shu29;" />
|
||||
<add name="JournalConnectionstring" connectionString="Data Source=shu01\shu00;Initial Catalog=edoka_journale;Persist Security Info=True;User ID=sa;Password=*shu29;" />
|
||||
<add name="EDOKAConnectionstring" connectionString="Po7oIigu4hOz6zXOpaSnrhveCQyfGgFeskvEQsvm3CEgxjJMEYYDEbnWlt9Qr9vGTkzqm5hvURTLA1hKVU++/ozcvT5qIVTpDLBTKd4AM/4YgN3+L9cx3mxMoWmv1JMjqxZVbR6GYiuSo1xuD05sl3IGoUenfugP6hBP/IC7MjUjisDUE6msFpWiraJr53gcfDvIrc2CUBTVUS+f94kewhlKxjtEohtCM71PN2zpoMiPyBIuXDyrYlYyokUOg6uV" />
|
||||
<add name="JournalConnectionstring" connectionString="fPYJwxH9angA+JMQ9OUQ4hfBQZR9aohQseovi6H5GI0fPBr22eh34jHXesVUNDhwsPJJ0OmlpwxTCTVyjoY1Aw40d5tZuSeZO/1jKhPU/Yg+Ek2kXe/VFlTN0CxG/er1XxAtLOHL62GJMnpNryUkqIbKJqa46rB0JbLACg8WMdk7/0GmEn39Gi54EQMywlbZ2dCffgfko6mudawZ4vkzWcpH0QxSqBqu8sCtpZYSEl9VYnnX/SwJHVlgOuWgtcxt" />
|
||||
</connectionStrings>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.8.1" />
|
||||
|
||||
Binary file not shown.
BIN
API_NetFramework/bin/VBFileManagement.dll
Normal file
BIN
API_NetFramework/bin/VBFileManagement.dll
Normal file
Binary file not shown.
BIN
API_NetFramework/bin/VBFileManagement.pdb
Normal file
BIN
API_NetFramework/bin/VBFileManagement.pdb
Normal file
Binary file not shown.
26
API_NetFramework/bin/VBFileManagement.xml
Normal file
26
API_NetFramework/bin/VBFileManagement.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>
|
||||
VBFileManagement
|
||||
</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:VBFileManagement.My.Resources.Resources">
|
||||
<summary>
|
||||
Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:VBFileManagement.My.Resources.Resources.ResourceManager">
|
||||
<summary>
|
||||
Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:VBFileManagement.My.Resources.Resources.Culture">
|
||||
<summary>
|
||||
Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
@@ -681,3 +681,180 @@ done
|
||||
2024-11-21 17:40:32.1301|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002014002326559
|
||||
2024-11-21 17:40:32.1400|DEBUG|OnDoc|
|
||||
2024-11-21 17:40:32.1400|DEBUG|OnDoc|System.Data.DataRowOFFEDK0002014002326559
|
||||
2024-11-22 06:58:35.4594|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966962
|
||||
2024-11-22 06:58:39.6477|DEBUG|OnDoc|
|
||||
2024-11-22 06:58:45.1208|DEBUG|OnDoc|Ende ArchivDocFromIRIS DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 06:58:54.6820|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966962
|
||||
2024-11-22 06:59:01.8230|DEBUG|OnDoc|
|
||||
2024-11-22 06:59:11.6319|DEBUG|OnDoc|System.Data.DataRowOFFEDK0002008001966962
|
||||
2024-11-22 07:00:52.6687|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966962
|
||||
2024-11-22 07:00:56.0356|DEBUG|OnDoc|
|
||||
2024-11-22 07:01:09.0416|DEBUG|OnDoc|System.Data.DataRowOFFEDK0002008001966962
|
||||
2024-11-22 07:02:13.8180|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966962
|
||||
2024-11-22 07:02:18.7897|DEBUG|OnDoc|
|
||||
2024-11-22 07:03:51.8725|DEBUG|OnDoc|Ende ArchivDocFromIRIS DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:03:56.1047|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966962
|
||||
2024-11-22 07:05:47.9171|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966962
|
||||
2024-11-22 07:05:50.7178|DEBUG|OnDoc|
|
||||
2024-11-22 07:07:15.2622|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966962
|
||||
2024-11-22 07:07:17.0908|DEBUG|OnDoc|
|
||||
2024-11-22 07:07:21.7374|DEBUG|OnDoc|System.Data.DataRowOFFEDK0002008001966962
|
||||
2024-11-22 07:07:56.0277|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966962
|
||||
2024-11-22 07:08:01.2968|DEBUG|OnDoc|
|
||||
2024-11-22 07:08:07.2327|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:08:09.1349|DEBUG|OnDoc|
|
||||
2024-11-22 07:08:10.5801|DEBUG|OnDoc|
|
||||
2024-11-22 07:08:26.3104|DEBUG|OnDoc|Start Transfer to OnBase
|
||||
2024-11-22 07:08:51.4040|DEBUG|OnDoc|Ende ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:08:52.8606|DEBUG|OnDoc|Start Updaet IL_Log: DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:08:52.8717|DEBUG|OnDoc|Ende Updaet IL_Log: DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:09:55.8427|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966962
|
||||
2024-11-22 07:09:55.8868|DEBUG|OnDoc|
|
||||
2024-11-22 07:09:55.8868|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:09:55.8868|DEBUG|OnDoc|
|
||||
2024-11-22 07:09:55.9078|DEBUG|OnDoc|
|
||||
2024-11-22 07:09:58.6514|DEBUG|OnDoc|Start Transfer to OnBase
|
||||
2024-11-22 07:10:02.7912|DEBUG|OnDoc|Ende ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:10:02.8259|DEBUG|OnDoc|Start Updaet IL_Log: DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:10:02.8259|DEBUG|OnDoc|Ende Updaet IL_Log: DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:15:21.0764|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966962
|
||||
2024-11-22 07:15:23.4392|DEBUG|OnDoc|
|
||||
2024-11-22 07:15:30.1395|DEBUG|OnDoc|System.Data.DataRowOFFEDK0002008001966962
|
||||
2024-11-22 07:16:17.6898|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966962
|
||||
2024-11-22 07:16:20.3958|DEBUG|OnDoc|
|
||||
2024-11-22 07:16:25.0979|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:16:26.0036|DEBUG|OnDoc|
|
||||
2024-11-22 07:16:26.8570|DEBUG|OnDoc|
|
||||
2024-11-22 07:16:32.0054|DEBUG|OnDoc|Start Transfer to OnBase
|
||||
2024-11-22 07:16:44.2512|DEBUG|OnDoc|Ende Transfer to OnBase
|
||||
2024-11-22 07:16:54.0859|DEBUG|OnDoc|Ende ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:16:57.3724|DEBUG|OnDoc|Start Updaet IL_Log: DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:16:57.4120|DEBUG|OnDoc|Ende Updaet IL_Log: DokumentID:OFFEDK0002008001966962
|
||||
2024-11-22 07:16:59.9696|DEBUG|OnDoc|
|
||||
2024-11-22 07:16:59.9848|DEBUG|OnDoc|
|
||||
2024-11-22 07:16:59.9848|DEBUG|OnDoc|
|
||||
2024-11-22 07:17:00.0126|ERROR|OnDoc|Die Tabelle 0 kann nicht gefunden werden.
|
||||
2024-11-22 07:17:10.8725|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966962
|
||||
2024-11-22 07:17:10.9086|DEBUG|OnDoc|
|
||||
2024-11-22 07:17:10.9086|DEBUG|OnDoc|System.Data.DataRowOFFEDK0002008001966962
|
||||
2024-11-22 07:19:01.7271|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0002024002454347
|
||||
2024-11-22 07:19:04.0950|DEBUG|OnDoc|
|
||||
2024-11-22 07:19:04.1142|DEBUG|OnDoc|
|
||||
2024-11-22 07:19:06.5897|DEBUG|OnDoc|Start Transfer to OnBase
|
||||
2024-11-22 07:19:06.7067|DEBUG|OnDoc|Ende Transfer to OnBase
|
||||
2024-11-22 07:19:11.3374|DEBUG|OnDoc|Ende ArchiveDocFromDatabase: DokumentID:OFFEDK0002024002454347
|
||||
2024-11-22 07:19:11.7538|DEBUG|OnDoc|Start Updaet IL_Log: DokumentID:OFFEDK0002024002454347
|
||||
2024-11-22 07:19:11.7639|DEBUG|OnDoc|Ende Updaet IL_Log: DokumentID:OFFEDK0002024002454347
|
||||
2024-11-22 07:19:13.0532|DEBUG|OnDoc|
|
||||
2024-11-22 07:19:13.0682|DEBUG|OnDoc|
|
||||
2024-11-22 07:19:13.0682|DEBUG|OnDoc|
|
||||
2024-11-22 07:19:13.0860|ERROR|OnDoc|Die Tabelle 0 kann nicht gefunden werden.
|
||||
2024-11-22 08:20:46.8134|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001967079
|
||||
2024-11-22 08:20:49.7235|DEBUG|OnDoc|
|
||||
2024-11-22 08:20:53.9432|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001967079
|
||||
2024-11-22 08:20:55.0854|DEBUG|OnDoc|
|
||||
2024-11-22 08:20:56.3964|DEBUG|OnDoc|
|
||||
2024-11-22 08:21:05.0971|DEBUG|OnDoc|Start Transfer to OnBase
|
||||
2024-11-22 08:21:13.6620|DEBUG|OnDoc|Ende ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001967079
|
||||
2024-11-22 08:21:14.4999|DEBUG|OnDoc|Start Updaet IL_Log: DokumentID:OFFEDK0002008001967079
|
||||
2024-11-22 08:21:32.8741|ERROR|OnDoc|Die Eingabe ist keine gültige Base-64-Zeichenfolge, da sie ein Nicht-Base-64-Zeichen, mehr als zwei Leerstellen oder in den Leerstellen ein Zeichen enthält, das ungültig ist.
|
||||
2024-11-22 08:21:39.5898|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001967079
|
||||
2024-11-22 08:21:39.6313|DEBUG|OnDoc|
|
||||
2024-11-22 08:21:53.2173|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001967079
|
||||
2024-11-22 08:21:54.2127|DEBUG|OnDoc|
|
||||
2024-11-22 08:21:55.1872|DEBUG|OnDoc|
|
||||
2024-11-22 08:22:02.4763|DEBUG|OnDoc|Start Transfer to OnBase
|
||||
2024-11-22 08:22:12.4976|DEBUG|OnDoc|Ende ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001967079
|
||||
2024-11-22 08:22:31.0149|DEBUG|OnDoc|Start Updaet IL_Log: DokumentID:OFFEDK0002008001967079
|
||||
2024-11-22 08:22:36.9765|ERROR|OnDoc|Die Eingabe ist keine gültige Base-64-Zeichenfolge, da sie ein Nicht-Base-64-Zeichen, mehr als zwei Leerstellen oder in den Leerstellen ein Zeichen enthält, das ungültig ist.
|
||||
2024-11-22 08:23:23.2984|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001967079
|
||||
2024-11-22 08:23:23.3614|DEBUG|OnDoc|
|
||||
2024-11-22 08:23:24.8481|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001967079
|
||||
2024-11-22 08:23:24.8601|DEBUG|OnDoc|
|
||||
2024-11-22 08:23:24.8601|DEBUG|OnDoc|
|
||||
2024-11-22 08:23:29.6213|DEBUG|OnDoc|Start Transfer to OnBase
|
||||
2024-11-22 08:23:38.0788|DEBUG|OnDoc|Ende ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001967079
|
||||
2024-11-22 08:23:40.4182|DEBUG|OnDoc|Start Updaet IL_Log: DokumentID:OFFEDK0002008001967079
|
||||
2024-11-22 08:23:45.6149|DEBUG|OnDoc|Ende Updaet IL_Log: DokumentID:OFFEDK0002008001967079
|
||||
2024-11-22 08:24:16.0301|DEBUG|OnDoc|Start Check DokumentID: DokumentID:OFFEDK0002008001967079
|
||||
2024-11-22 08:24:16.0663|DEBUG|OnDoc|
|
||||
2024-11-22 12:01:49.0571|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966328
|
||||
2024-11-22 12:01:51.0895|DEBUG|OnDoc|
|
||||
2024-11-22 12:01:57.3371|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001966328
|
||||
2024-11-22 12:01:58.4466|DEBUG|OnDoc|
|
||||
2024-11-22 12:01:59.4552|DEBUG|OnDoc|
|
||||
2024-11-22 12:02:12.5468|ERROR|OnDoc|Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
|
||||
2024-11-22 12:02:25.7264|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966328
|
||||
2024-11-22 12:02:28.0112|DEBUG|OnDoc|
|
||||
2024-11-22 12:02:55.2154|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001966328
|
||||
2024-11-22 12:02:56.5439|DEBUG|OnDoc|
|
||||
2024-11-22 12:02:57.6182|DEBUG|OnDoc|
|
||||
2024-11-22 12:03:36.3534|DEBUG|OnDoc|Ende ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001966328
|
||||
2024-11-22 12:03:36.6986|DEBUG|OnDoc|Start Updaet IL_Log: DokumentID:OFFEDK0002008001966328
|
||||
2024-11-22 12:03:36.7207|DEBUG|OnDoc|Ende Updaet IL_Log: DokumentID:OFFEDK0002008001966328
|
||||
2024-11-22 12:03:38.0768|DEBUG|OnDoc|
|
||||
2024-11-22 12:03:38.0908|DEBUG|OnDoc|
|
||||
2024-11-22 12:03:38.0908|DEBUG|OnDoc|
|
||||
2024-11-22 12:03:38.1128|ERROR|OnDoc|Die Tabelle 0 kann nicht gefunden werden.
|
||||
2024-11-22 12:08:52.6295|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966328
|
||||
2024-11-22 12:08:52.6685|DEBUG|OnDoc|
|
||||
2024-11-22 12:08:52.6685|DEBUG|OnDoc|System.Data.DataRowOFFEDK0002008001966328
|
||||
2024-11-22 12:32:30.9748|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0082024002454355
|
||||
2024-11-22 12:32:33.8233|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0082024002454355
|
||||
2024-11-22 12:32:35.9586|DEBUG|OnDoc|
|
||||
2024-11-22 12:32:40.6454|DEBUG|OnDoc|
|
||||
2024-11-22 12:32:55.0478|DEBUG|OnDoc|OFFEDK0082024002454355 / EDOKA Dokument-ID/OFFEDK0082024002454355
|
||||
2024-11-22 12:32:58.2022|DEBUG|OnDoc|OFFEDK0082024002454355 / EDOKA Dokumenttyp Nr/120
|
||||
2024-11-22 12:33:00.2042|DEBUG|OnDoc|OFFEDK0082024002454355 / Partner Kurzname/Ort/ , Weinfelden
|
||||
2024-11-22 12:33:02.5005|DEBUG|OnDoc|OFFEDK0082024002454355 / Original Filename/BRIEOFFEDK0082024002454355.docx
|
||||
2024-11-22 12:33:04.8339|DEBUG|OnDoc|OFFEDK0082024002454355 / Status Korrespondenz/In Aufbewahrung
|
||||
2024-11-22 12:33:06.8676|DEBUG|OnDoc|OFFEDK0082024002454355 / Verantwortlich Email/hutter@shub.ch
|
||||
2024-11-22 12:33:08.9371|DEBUG|OnDoc|OFFEDK0082024002454355 / Verantwortlich Name/Hutter Stefan
|
||||
2024-11-22 12:33:10.9762|DEBUG|OnDoc|OFFEDK0082024002454355 / Verantwortlich Benutzername/Stefan Hutter lokal
|
||||
2024-11-22 12:33:13.0206|DEBUG|OnDoc|OFFEDK0082024002454355 / Unterschrift rechts/Helena Zürcher, TG9665
|
||||
2024-11-22 12:33:15.1419|DEBUG|OnDoc|OFFEDK0082024002454355 / Unterschrift links/Helena Ackermann, 1234
|
||||
2024-11-22 12:33:17.1390|DEBUG|OnDoc|OFFEDK0082024002454355 / Created by/STEFAN HUTTER LOKAL
|
||||
2024-11-22 12:33:19.1422|DEBUG|OnDoc|OFFEDK0082024002454355 / Papierkorb/NEIN
|
||||
2024-11-22 12:33:21.5905|DEBUG|OnDoc|OFFEDK0082024002454355 / Container Nr/10 20 014.595-03
|
||||
2024-11-22 12:33:26.8156|DEBUG|OnDoc|OFFEDK0082024002454355 / Herkunftsapplikation/EDOKA
|
||||
2024-11-22 12:33:36.2837|DEBUG|OnDoc|Start Transfer to OnBase
|
||||
2024-11-22 12:33:48.2786|DEBUG|OnDoc|Ende ArchiveDocFromDatabase: DokumentID:OFFEDK0082024002454355
|
||||
2024-11-22 12:33:50.8796|DEBUG|OnDoc|Start Updaet IL_Log: DokumentID:OFFEDK0082024002454355
|
||||
2024-11-22 12:33:50.9016|DEBUG|OnDoc|Ende Updaet IL_Log: DokumentID:OFFEDK0082024002454355
|
||||
2024-11-24 08:04:56.7510|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0082024002454403
|
||||
2024-11-24 08:04:58.9168|ERROR|OnDoc|Ungültiger Spaltenname "OFFEDK0082024002454403".
|
||||
2024-11-24 08:05:04.7640|ERROR|OnDoc|Die Tabelle 0 kann nicht gefunden werden.
|
||||
2024-11-24 08:05:32.9238|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0082024002454403
|
||||
2024-11-24 08:05:33.8045|DEBUG|OnDoc|
|
||||
2024-11-24 08:05:55.3079|DEBUG|OnDoc|
|
||||
2024-11-24 08:06:05.5418|DEBUG|OnDoc|
|
||||
2024-11-24 08:06:44.0139|DEBUG|OnDoc|Start Transfer to OnBase
|
||||
2024-11-24 08:06:44.1815|DEBUG|OnDoc|Ende Transfer to OnBase
|
||||
2024-11-24 08:06:49.0996|DEBUG|OnDoc|Ende ArchiveDocFromDatabase: DokumentID:OFFEDK0082024002454403
|
||||
2024-11-24 08:06:49.4560|DEBUG|OnDoc|Start Updaet IL_Log: DokumentID:OFFEDK0082024002454403
|
||||
2024-11-24 08:06:49.4742|DEBUG|OnDoc|Ende Updaet IL_Log: DokumentID:OFFEDK0082024002454403
|
||||
2024-11-24 08:06:52.5347|DEBUG|OnDoc|
|
||||
2024-11-24 08:06:52.5957|DEBUG|OnDoc|
|
||||
2024-11-24 08:06:52.5957|DEBUG|OnDoc|
|
||||
2024-11-24 08:12:31.0939|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0082024002454427
|
||||
2024-11-24 08:12:31.1531|DEBUG|OnDoc|
|
||||
2024-11-24 08:12:31.1633|DEBUG|OnDoc|
|
||||
2024-11-24 08:12:31.1753|DEBUG|OnDoc|
|
||||
2024-11-24 08:12:32.3744|DEBUG|OnDoc|Start Transfer to OnBase
|
||||
2024-11-24 08:12:32.5135|DEBUG|OnDoc|Ende Transfer to OnBase
|
||||
2024-11-24 08:12:32.5466|DEBUG|OnDoc|Ende ArchiveDocFromDatabase: DokumentID:OFFEDK0082024002454427
|
||||
2024-11-24 08:12:32.5466|DEBUG|OnDoc|Start Updaet IL_Log: DokumentID:OFFEDK0082024002454427
|
||||
2024-11-24 08:12:32.5466|DEBUG|OnDoc|Ende Updaet IL_Log: DokumentID:OFFEDK0082024002454427
|
||||
2024-11-24 08:12:32.5466|DEBUG|OnDoc|
|
||||
2024-11-24 08:12:32.5654|DEBUG|OnDoc|
|
||||
2024-11-24 08:12:32.5654|DEBUG|OnDoc|
|
||||
2024-11-24 18:47:08.2765|DEBUG|OnDoc|Start ArchivDocFromIRIS DokumentID: OFFEDK0002008001966718
|
||||
2024-11-24 18:47:08.3358|DEBUG|OnDoc|
|
||||
2024-11-24 18:47:13.4109|DEBUG|OnDoc|Start ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001966718
|
||||
2024-11-24 18:47:14.1148|DEBUG|OnDoc|
|
||||
2024-11-24 18:47:18.3635|DEBUG|OnDoc|
|
||||
2024-11-24 18:47:22.1157|DEBUG|OnDoc|
|
||||
2024-11-24 18:47:36.1775|DEBUG|OnDoc|Start Transfer to OnBase
|
||||
2024-11-24 18:47:40.3876|DEBUG|OnDoc|Ende ArchiveDocFromDatabase: DokumentID:OFFEDK0002008001966718
|
||||
2024-11-24 18:47:40.3906|DEBUG|OnDoc|Start Updaet IL_Log: DokumentID:OFFEDK0002008001966718
|
||||
2024-11-24 18:47:40.3906|DEBUG|OnDoc|Ende Update IL_Log: DokumentID:OFFEDK0002008001966718
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
e3bd8e83aa5c2a0e3a79dc6a52be63d1040407a3b479c3366beaa1e996e86770
|
||||
0d1a9ebbad5bb9929b52cfc409e2f295381fddc112dacd091614320eb3f2990e
|
||||
|
||||
@@ -299,3 +299,8 @@ E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\Syncfusion.Compression.Bas
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\Syncfusion.OfficeChart.Base.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\OnDocOffice.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\OnDocOffice.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\CSVNET.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\CSVNET.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\VBFileManagement.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\VBFileManagement.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\VBFileManagement.xml
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
58f0b5c20291391874abaca82e9cc5bf56c3a33fb153f42caa9174d4d752785e
|
||||
cfbd970a1620d565a6eaba19ea5652f2f3862322af8e217ccf8c8aa9f99a07e0
|
||||
|
||||
@@ -170,3 +170,8 @@ E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\Syncfusion.Compression.Bas
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\Syncfusion.OfficeChart.Base.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\OnDocOffice.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\OnDocOffice.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\CSVNET.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\VBFileManagement.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\CSVNET.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\VBFileManagement.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\API_NetFramework\bin\VBFileManagement.xml
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -12,7 +12,7 @@
|
||||
<add key="UnterschriftPath" value="x:\docdemo\unterschriften\" />
|
||||
<add key="JSONDebugPath" value="X:\\jsontemp\" />
|
||||
<add key="Bearer" value="abc" />
|
||||
<add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,
5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,
ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" />
|
||||
<add key="APIKeys" value="x:\apikeys.key" />
|
||||
<add key="APIUser" value="OnDoc,OnBase,Fivo" />
|
||||
<add key="AuthCheck" value="Yes" />
|
||||
<add key="SendToOnBase" value="No" />
|
||||
@@ -21,10 +21,13 @@
|
||||
<add key="ILFast" value="https://localhost:44303/API/Fast" />
|
||||
<add key="ILSlow" value="https://localhost:44303/API/Slow" />
|
||||
<add key="ILDocupload" value="" />
|
||||
<add key="ArchivierungOfficeFormat" value="1983,2396,2397,2421" />
|
||||
<add key="ExcelValueFile" value="x:\exceldata.csv" />
|
||||
<add key="ExcelDokType" value="2421" />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="EDOKAConnectionstring" connectionString="Data Source=shu01\shu00;Initial Catalog=edoka_dms;Persist Security Info=True;User ID=sa;Password=*shu29;" />
|
||||
<add name="JournalConnectionstring" connectionString="Data Source=shu01\shu00;Initial Catalog=edoka_journale;Persist Security Info=True;User ID=sa;Password=*shu29;" />
|
||||
<add name="EDOKAConnectionstring" connectionString="Po7oIigu4hOz6zXOpaSnrhveCQyfGgFeskvEQsvm3CEgxjJMEYYDEbnWlt9Qr9vGTkzqm5hvURTLA1hKVU++/ozcvT5qIVTpDLBTKd4AM/4YgN3+L9cx3mxMoWmv1JMjqxZVbR6GYiuSo1xuD05sl3IGoUenfugP6hBP/IC7MjUjisDUE6msFpWiraJr53gcfDvIrc2CUBTVUS+f94kewhlKxjtEohtCM71PN2zpoMiPyBIuXDyrYlYyokUOg6uV" />
|
||||
<add name="JournalConnectionstring" connectionString="fPYJwxH9angA+JMQ9OUQ4hfBQZR9aohQseovi6H5GI0fPBr22eh34jHXesVUNDhwsPJJ0OmlpwxTCTVyjoY1Aw40d5tZuSeZO/1jKhPU/Yg+Ek2kXe/VFlTN0CxG/er1XxAtLOHL62GJMnpNryUkqIbKJqa46rB0JbLACg8WMdk7/0GmEn39Gi54EQMywlbZ2dCffgfko6mudawZ4vkzWcpH0QxSqBqu8sCtpZYSEl9VYnnX/SwJHVlgOuWgtcxt" />
|
||||
</connectionStrings>
|
||||
<system.web>
|
||||
<compilation targetFramework="4.8.1" />
|
||||
@@ -125,9 +128,4 @@
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
<!--APIKeys
|
||||
Adresse: U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+
|
||||
Archiv,Dokument,Unterschrift: 5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6
|
||||
Unterschrift: ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS
|
||||
-->
|
||||
<!--ProjectGuid: D1F49CD8-7015-425E-A16F-738BC4222BDB-->
|
||||
BIN
API_NetFramework/obj/Release/Package/PackageTmp/bin/CSVNET.dll
Normal file
BIN
API_NetFramework/obj/Release/Package/PackageTmp/bin/CSVNET.dll
Normal file
Binary file not shown.
BIN
API_NetFramework/obj/Release/Package/PackageTmp/bin/CSVNET.pdb
Normal file
BIN
API_NetFramework/obj/Release/Package/PackageTmp/bin/CSVNET.pdb
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -12,9 +12,7 @@
|
||||
<add key="UnterschriftPath" value="x:\docdemo\unterschriften\" />
|
||||
<add key="JSONDebugPath" value="X:\\jsontemp\" />
|
||||
<add key="Bearer" value="abc" />
|
||||
<add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,
|
||||
5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,
|
||||
ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" />
|
||||
<add key="APIKeys" value="x:\apikeys.key"/>
|
||||
<add key="APIUser" value="OnDoc,OnBase,Fivo"/>
|
||||
<add key="AuthCheck" value="Yes" />
|
||||
<add key="SendToOnBase" value="No" />
|
||||
@@ -23,10 +21,13 @@ ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4
|
||||
<add key="ILFast" value="https://localhost:44303/API/Fast" />
|
||||
<add key="ILSlow" value="https://localhost:44303/API/Slow" />
|
||||
<add key="ILDocupload" value="" />
|
||||
<add key="ArchivierungOfficeFormat" value="1983,2396,2397,2421" />
|
||||
<add key="ExcelValueFile" value="x:\exceldata.csv" />
|
||||
<add key="ExcelDokType" value="2421" />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="EDOKAConnectionstring" connectionString="Data Source=shu01\shu00;Initial Catalog=edoka_dms;Persist Security Info=True;User ID=sa;Password=*shu29;" />
|
||||
<add name="JournalConnectionstring" connectionString="Data Source=shu01\shu00;Initial Catalog=edoka_journale;Persist Security Info=True;User ID=sa;Password=*shu29;" />
|
||||
<add name="EDOKAConnectionstring" connectionString="Po7oIigu4hOz6zXOpaSnrhveCQyfGgFeskvEQsvm3CEgxjJMEYYDEbnWlt9Qr9vGTkzqm5hvURTLA1hKVU++/ozcvT5qIVTpDLBTKd4AM/4YgN3+L9cx3mxMoWmv1JMjqxZVbR6GYiuSo1xuD05sl3IGoUenfugP6hBP/IC7MjUjisDUE6msFpWiraJr53gcfDvIrc2CUBTVUS+f94kewhlKxjtEohtCM71PN2zpoMiPyBIuXDyrYlYyokUOg6uV" />
|
||||
<add name="JournalConnectionstring" connectionString="fPYJwxH9angA+JMQ9OUQ4hfBQZR9aohQseovi6H5GI0fPBr22eh34jHXesVUNDhwsPJJ0OmlpwxTCTVyjoY1Aw40d5tZuSeZO/1jKhPU/Yg+Ek2kXe/VFlTN0CxG/er1XxAtLOHL62GJMnpNryUkqIbKJqa46rB0JbLACg8WMdk7/0GmEn39Gi54EQMywlbZ2dCffgfko6mudawZ4vkzWcpH0QxSqBqu8sCtpZYSEl9VYnnX/SwJHVlgOuWgtcxt" />
|
||||
</connectionStrings>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.8.1" />
|
||||
@@ -128,8 +129,4 @@ ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
|
||||
<!--APIKeys
|
||||
Adresse: U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+
|
||||
Archiv,Dokument,Unterschrift: 5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6
|
||||
Unterschrift: ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS
|
||||
-->
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<add key="UnterschriftPath" value="x:\docdemo\unterschriften\" />
|
||||
<add key="JSONDebugPath" value="X:\\jsontemp\" />
|
||||
<add key="Bearer" value="abc" />
|
||||
<add key="APIKeys" value="U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+,
5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6,
ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS" />
|
||||
<add key="APIKeys" value="x:\apikeys.key" />
|
||||
<add key="APIUser" value="OnDoc,OnBase,Fivo" />
|
||||
<add key="AuthCheck" value="Yes" />
|
||||
<add key="SendToOnBase" value="No" />
|
||||
@@ -21,10 +21,13 @@
|
||||
<add key="ILFast" value="https://localhost:44303/API/Fast" />
|
||||
<add key="ILSlow" value="https://localhost:44303/API/Slow" />
|
||||
<add key="ILDocupload" value="" />
|
||||
<add key="ArchivierungOfficeFormat" value="1983,2396,2397,2421" />
|
||||
<add key="ExcelValueFile" value="x:\exceldata.csv" />
|
||||
<add key="ExcelDokType" value="2421" />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="EDOKAConnectionstring" connectionString="Data Source=shu01\shu00;Initial Catalog=edoka_dms;Persist Security Info=True;User ID=sa;Password=*shu29;" />
|
||||
<add name="JournalConnectionstring" connectionString="Data Source=shu01\shu00;Initial Catalog=edoka_journale;Persist Security Info=True;User ID=sa;Password=*shu29;" />
|
||||
<add name="EDOKAConnectionstring" connectionString="Po7oIigu4hOz6zXOpaSnrhveCQyfGgFeskvEQsvm3CEgxjJMEYYDEbnWlt9Qr9vGTkzqm5hvURTLA1hKVU++/ozcvT5qIVTpDLBTKd4AM/4YgN3+L9cx3mxMoWmv1JMjqxZVbR6GYiuSo1xuD05sl3IGoUenfugP6hBP/IC7MjUjisDUE6msFpWiraJr53gcfDvIrc2CUBTVUS+f94kewhlKxjtEohtCM71PN2zpoMiPyBIuXDyrYlYyokUOg6uV" />
|
||||
<add name="JournalConnectionstring" connectionString="fPYJwxH9angA+JMQ9OUQ4hfBQZR9aohQseovi6H5GI0fPBr22eh34jHXesVUNDhwsPJJ0OmlpwxTCTVyjoY1Aw40d5tZuSeZO/1jKhPU/Yg+Ek2kXe/VFlTN0CxG/er1XxAtLOHL62GJMnpNryUkqIbKJqa46rB0JbLACg8WMdk7/0GmEn39Gi54EQMywlbZ2dCffgfko6mudawZ4vkzWcpH0QxSqBqu8sCtpZYSEl9VYnnX/SwJHVlgOuWgtcxt" />
|
||||
</connectionStrings>
|
||||
<system.web>
|
||||
<compilation targetFramework="4.8.1" />
|
||||
@@ -125,9 +128,4 @@
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
<!--APIKeys
|
||||
Adresse: U3AF12C/o+r8c1fhnk+NkEOduuH9uNH3aZ1AVb0dHN1fxMGLr1s0eKcvoeJ7bPY02ytHD4SjcFb78NiQQyvWtDD+S7noWCyNmaCQkXHMx4LAomlnvnwKPqVs1TQ0qFB+
|
||||
Archiv,Dokument,Unterschrift: 5sPQAPCxiSj+JWf+sWKTYgdTRSXeZJX/Ft2wE5B/SaSPoxPNMvkTgNjbmiK18SNmJ66OPzOM1fEw70R+VZeRWU+5fowTIXAGYLDneikxmK4HnIJku8732xxJ/9EomCZ6
|
||||
Unterschrift: ecJVgQbmauycFRw5Lz6hB0dJb6GYCePckr2kw3g+xLkbS+h6oxR0iPMFkP3uXpFq7luWAdXrEWs1kmR4Pan5rN+bgwm2YjdPl56Et/Z5hIr+QJhPMB8lmNO1oJytu3GS
|
||||
-->
|
||||
<!--ProjectGuid: D1F49CD8-7015-425E-A16F-738BC4222BDB-->
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
BarcodeLib/bin/Debug/VBFileManagement.dll
Normal file
BIN
BarcodeLib/bin/Debug/VBFileManagement.dll
Normal file
Binary file not shown.
BIN
BarcodeLib/bin/Debug/VBFileManagement.pdb
Normal file
BIN
BarcodeLib/bin/Debug/VBFileManagement.pdb
Normal file
Binary file not shown.
26
BarcodeLib/bin/Debug/VBFileManagement.xml
Normal file
26
BarcodeLib/bin/Debug/VBFileManagement.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>
|
||||
VBFileManagement
|
||||
</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:VBFileManagement.My.Resources.Resources">
|
||||
<summary>
|
||||
Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:VBFileManagement.My.Resources.Resources.ResourceManager">
|
||||
<summary>
|
||||
Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:VBFileManagement.My.Resources.Resources.Culture">
|
||||
<summary>
|
||||
Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
Binary file not shown.
@@ -37,3 +37,6 @@ E:\Software-Projekte\OnDoc\OnDoc\BarcodeLib\bin\Debug\NLog.Database.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\BarcodeLib\obj\Debug\BarcodeLib.csproj.Up2Date
|
||||
E:\Software-Projekte\OnDoc\OnDoc\BarcodeLib\obj\Debug\BarcodeLib.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\BarcodeLib\obj\Debug\BarcodeLib.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\BarcodeLib\bin\Debug\VBFileManagement.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\BarcodeLib\bin\Debug\VBFileManagement.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\BarcodeLib\bin\Debug\VBFileManagement.xml
|
||||
|
||||
528
CSVNET/CSV.cs
Normal file
528
CSVNET/CSV.cs
Normal file
@@ -0,0 +1,528 @@
|
||||
/*
|
||||
* 2006 - 2018 Ted Spence, http://tedspence.com
|
||||
* License: http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Home page: https://github.com/tspence/csharp-csv-reader
|
||||
*/
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
#if HAS_ASYNC
|
||||
using System.Threading.Tasks;
|
||||
#endif
|
||||
|
||||
// These suggestions from Resharper apply because we don't want it to recommend fixing things needed for Net20:
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
// ReSharper disable ConvertIfStatementToNullCoalescingAssignment
|
||||
// ReSharper disable ReplaceSubstringWithRangeIndexer
|
||||
// ReSharper disable InvertIf
|
||||
// ReSharper disable ConvertIfStatementToSwitchExpression
|
||||
// ReSharper disable ConvertIfStatementToSwitchStatement
|
||||
|
||||
namespace CSVNET
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Root class that contains static functions for straightforward CSV parsing
|
||||
/// </summary>
|
||||
public static class CSV
|
||||
{
|
||||
/// <summary>
|
||||
/// Use this to determine what version of DotNet was used to build this library
|
||||
/// </summary>
|
||||
#if NET2_0
|
||||
public const string VERSION = "NET20";
|
||||
#elif NET4_0
|
||||
public const string VERSION = "NET40";
|
||||
#elif NET4_5
|
||||
public const string VERSION = "NET45";
|
||||
#elif NET5_0
|
||||
public const string VERSION = "NET50";
|
||||
#elif NET6_0
|
||||
public const string VERSION = "NET60";
|
||||
#elif NETSTANDARD1_0
|
||||
public const string VERSION = "NETSTANDARD10";
|
||||
#elif NETSTANDARD2_0
|
||||
public const string VERSION = "NETSTANDARD20";
|
||||
#else
|
||||
public const string VERSION = "UNKNOWN";
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Parse a CSV stream into <![CDATA[ IEnumerable<string[]> ]]>, while permitting embedded newlines
|
||||
/// </summary>
|
||||
/// <param name="inStream">The stream to read</param>
|
||||
/// <param name="settings">The CSV settings to use for this parsing operation (Default: CSV)</param>
|
||||
/// <returns>An enumerable object that can be examined to retrieve rows from the stream.</returns>
|
||||
public static IEnumerable<string[]> ParseStream(StreamReader inStream, CSVSettings settings = null)
|
||||
{
|
||||
int bufferSize = settings?.BufferSize ?? CSVSettings.DEFAULT_BUFFER_SIZE;
|
||||
var buffer = new char[bufferSize];
|
||||
var machine = new CSVStateMachine(settings);
|
||||
while (machine.State == CSVState.CanKeepGoing)
|
||||
{
|
||||
var line = string.Empty;
|
||||
if (machine.NeedsMoreText() && !inStream.EndOfStream)
|
||||
{
|
||||
var readChars = inStream.ReadBlock(buffer, 0, bufferSize);
|
||||
line = new string(buffer, 0, readChars);
|
||||
}
|
||||
var row = machine.ParseChunk(line, inStream.EndOfStream);
|
||||
if (row != null)
|
||||
{
|
||||
yield return row;
|
||||
}
|
||||
else if (inStream.EndOfStream)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if HAS_ASYNC_IENUM
|
||||
/// <summary>
|
||||
/// Parse a CSV stream into <![CDATA[ IEnumerable<string[]> ]]> asynchronously, while permitting embedded newlines
|
||||
/// </summary>
|
||||
/// <param name="inStream">The stream to read</param>
|
||||
/// <param name="settings">The CSV settings to use for this parsing operation (Default: CSV)</param>
|
||||
/// <returns>An enumerable object that can be examined to retrieve rows from the stream.</returns>
|
||||
public static async IAsyncEnumerable<string[]> ParseStreamAsync(StreamReader inStream, CSVSettings settings = null)
|
||||
{
|
||||
int bufferSize = settings?.BufferSize ?? CSVSettings.DEFAULT_BUFFER_SIZE;
|
||||
var buffer = new char[bufferSize];
|
||||
var machine = new CSVStateMachine(settings);
|
||||
while (machine.State == CSVState.CanKeepGoing)
|
||||
{
|
||||
var line = string.Empty;
|
||||
if (machine.NeedsMoreText() && !inStream.EndOfStream)
|
||||
{
|
||||
var readChars = await inStream.ReadBlockAsync(buffer, 0, bufferSize);
|
||||
line = new string(buffer, 0, readChars);
|
||||
}
|
||||
var row = machine.ParseChunk(line, inStream.EndOfStream);
|
||||
if (row != null)
|
||||
{
|
||||
yield return row;
|
||||
}
|
||||
else if (inStream.EndOfStream)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Parse a line from a CSV file and return an array of fields, or null if it fails
|
||||
/// </summary>
|
||||
/// <param name="line">One line of text from a CSV file</param>
|
||||
/// <param name="settings">The CSV settings to use for this parsing operation (Default: CSV)</param>
|
||||
/// <param name="throwOnFailure">If this value is true, throws an exception if parsing fails</param>
|
||||
/// <returns>An array containing all fields in the next row of data, or null if it could not be parsed.</returns>
|
||||
public static string[] ParseLine(string line, CSVSettings settings = null, bool? throwOnFailure = null)
|
||||
{
|
||||
string[] row = null;
|
||||
var machine = new CSVStateMachine(settings);
|
||||
while (machine.State == CSVState.CanKeepGoing)
|
||||
{
|
||||
row = machine.ParseChunk(line, true);
|
||||
line = string.Empty;
|
||||
}
|
||||
|
||||
// Anything other than success throws an error here
|
||||
if (machine.State != CSVState.Done)
|
||||
{
|
||||
throw new Exception($"Malformed CSV structure: {machine.State}");
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Try to parse a line of CSV data. Can only return false if an unterminated text qualifier is encountered.
|
||||
///
|
||||
/// This function cannot recognize 'sep=' lines because it does not know whether it is parsing the first line
|
||||
/// in the overall CSV stream.
|
||||
/// </summary>
|
||||
/// <returns>False if there was an unterminated text qualifier in the <paramref name="line"/></returns>
|
||||
/// <param name="line">The line of text to parse</param>
|
||||
/// <param name="settings">The CSV settings to use for this parsing operation (Default: CSV)</param>
|
||||
/// <param name="row">The array of fields found in the line</param>
|
||||
public static bool TryParseLine(string line, out string[] row, CSVSettings settings = null)
|
||||
{
|
||||
row = null;
|
||||
var machine = new CSVStateMachine(settings);
|
||||
while (machine.State == CSVState.CanKeepGoing)
|
||||
{
|
||||
row = machine.ParseChunk(line, true);
|
||||
line = string.Empty;
|
||||
}
|
||||
return machine.State == CSVState.Done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserialize a CSV string into a list of typed objects
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of objects to deserialize</typeparam>
|
||||
/// <param name="settings">The CSV settings to use when parsing the source (Default: CSV)</param>
|
||||
/// <param name="source">The source CSV to deserialize</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<T> Deserialize<T>(string source, CSVSettings settings = null) where T : class, new()
|
||||
{
|
||||
return CSVReader.FromString(source, settings).Deserialize<T>();
|
||||
}
|
||||
|
||||
#if HAS_ASYNC_IENUM
|
||||
/// <summary>
|
||||
/// Deserialize a CSV string into a list of typed objects
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of objects to deserialize</typeparam>
|
||||
/// <param name="settings">The CSV settings to use when parsing the source (Default: CSV)</param>
|
||||
/// <param name="source">The source CSV to deserialize</param>
|
||||
/// <returns></returns>
|
||||
public static IAsyncEnumerable<T> DeserializeAsync<T>(string source, CSVSettings settings = null) where T : class, new()
|
||||
{
|
||||
return CSVReader.FromString(source, settings).DeserializeAsync<T>();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Serialize a sequence of objects into a CSV string
|
||||
/// </summary>
|
||||
/// <returns>A single line of CSV encoded data containing these values</returns>
|
||||
/// <param name="row">A list or array of objects to serialize</param>
|
||||
/// <param name="settings">The field delimiter character (Default: comma)</param>
|
||||
#if NET2_0
|
||||
public static string ToCSVString(IEnumerable<object> row, CSVSettings settings = null)
|
||||
#else
|
||||
public static string ToCSVString(this IEnumerable<object> row, CSVSettings settings = null)
|
||||
#endif
|
||||
{
|
||||
if (settings == null)
|
||||
{
|
||||
settings = CSVSettings.CSV;
|
||||
}
|
||||
var riskyChars = settings.GetRiskyChars();
|
||||
var forceQualifierTypes = settings.GetForceQualifierTypes();
|
||||
return ItemsToCsv(row, settings, riskyChars, forceQualifierTypes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serialize an array of objects to CSV format
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of objects to serialize from this CSV</typeparam>
|
||||
/// <param name="list">The array of objects to serialize</param>
|
||||
/// <param name="settings">The CSV settings to use when exporting this array (Default: CSV)</param>
|
||||
/// <returns>The completed CSV string representing one line per element in list</returns>
|
||||
public static string Serialize<T>(IEnumerable<T> list, CSVSettings settings = null) where T : class, new()
|
||||
{
|
||||
if (settings == null)
|
||||
{
|
||||
settings = CSVSettings.CSV;
|
||||
}
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
using (var cw = new CSVWriter(ms, settings))
|
||||
{
|
||||
cw.Serialize(list);
|
||||
}
|
||||
|
||||
var rawString = settings.Encoding.GetString(ms.ToArray());
|
||||
return RemoveByteOrderMarker(rawString);
|
||||
}
|
||||
}
|
||||
|
||||
private static string _byteOrderMarkUtf8 =
|
||||
Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble());
|
||||
internal static string RemoveByteOrderMarker(string rawString)
|
||||
{
|
||||
if (rawString.StartsWith(_byteOrderMarkUtf8, StringComparison.Ordinal))
|
||||
{
|
||||
return rawString.Substring(_byteOrderMarkUtf8.Length);
|
||||
}
|
||||
return rawString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serialize an array of objects to CSV format
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of objects to serialize from this CSV</typeparam>
|
||||
/// <param name="list">The array of objects to serialize</param>
|
||||
/// <param name="stream">The stream to which we will send this CSV text</param>
|
||||
/// <param name="settings">The CSV settings to use when exporting this array (Default: CSV)</param>
|
||||
/// <returns>The completed CSV string representing one line per element in list</returns>
|
||||
public static void Serialize<T>(IEnumerable<T> list, Stream stream, CSVSettings settings = null) where T : class, new()
|
||||
{
|
||||
using (var cw = new CSVWriter(stream, settings))
|
||||
{
|
||||
cw.Serialize(list);
|
||||
}
|
||||
}
|
||||
|
||||
#if HAS_ASYNC
|
||||
/// <summary>
|
||||
/// Serialize an array of objects to CSV format
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of objects to serialize from this CSV</typeparam>
|
||||
/// <param name="list">The array of objects to serialize</param>
|
||||
/// <param name="stream">The stream to which we will send this CSV text</param>
|
||||
/// <param name="settings">The CSV settings to use when exporting this array (Default: CSV)</param>
|
||||
/// <returns>The completed CSV string representing one line per element in list</returns>
|
||||
public static Task SerializeAsync<T>(IEnumerable<T> list, Stream stream, CSVSettings settings = null) where T : class, new()
|
||||
{
|
||||
using (var cw = new CSVWriter(stream, settings))
|
||||
{
|
||||
return cw.SerializeAsync(list);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAS_ASYNC_IENUM
|
||||
/// <summary>
|
||||
/// Serialize an array of objects to CSV format
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of objects to serialize from this CSV</typeparam>
|
||||
/// <param name="list">The array of objects to serialize</param>
|
||||
/// <param name="stream">The stream to which we will send this CSV text</param>
|
||||
/// <param name="settings">The CSV settings to use when exporting this array (Default: CSV)</param>
|
||||
/// <returns>The completed CSV string representing one line per element in list</returns>
|
||||
public static Task SerializeAsync<T>(IAsyncEnumerable<T> list, Stream stream, CSVSettings settings = null) where T : class, new()
|
||||
{
|
||||
using (var cw = new CSVWriter(stream, settings))
|
||||
{
|
||||
return cw.SerializeAsync(list);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Add a CSV Header line to a StringBuilder for a specific type
|
||||
/// </summary>
|
||||
/// <param name="sb">The StringBuilder to append data</param>
|
||||
/// <param name="settings">The CSV settings to use when exporting this array (Default: CSV)</param>
|
||||
#if NET2_0
|
||||
public static void AppendCSVHeader<T>(StringBuilder sb, CSVSettings settings = null) where T: class, new()
|
||||
#else
|
||||
public static void AppendCSVHeader<T>(this StringBuilder sb, CSVSettings settings = null) where T : class, new()
|
||||
#endif
|
||||
{
|
||||
var header = Serialize(new T[] { }, settings);
|
||||
sb.Append(header);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Appends a single object to a StringBuilder in CSV format as a single line
|
||||
/// </summary>
|
||||
/// <param name="sb">The StringBuilder to append data</param>
|
||||
/// <param name="obj">The single object to append in CSV-line format</param>
|
||||
/// <param name="settings">The CSV settings to use when exporting this array (Default: CSV)</param>
|
||||
/// <typeparam name="T">The 1st type parameter.</typeparam>
|
||||
#if NET2_0
|
||||
public static void AppendCSVLine<T>(StringBuilder sb, T obj, CSVSettings settings = null) where T : class, new()
|
||||
#else
|
||||
public static void AppendCSVLine<T>(this StringBuilder sb, T obj, CSVSettings settings = null) where T : class, new()
|
||||
#endif
|
||||
{
|
||||
if (settings == null)
|
||||
{
|
||||
settings = CSVSettings.CSV;
|
||||
}
|
||||
|
||||
// Duplicate settings, but flag ourselves to ignore the header
|
||||
settings = settings.CloneWithNewDelimiter(settings.FieldDelimiter);
|
||||
settings.HeaderRowIncluded = false;
|
||||
var line = Serialize(new T[] { obj }, settings);
|
||||
sb.Append(line);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal method to convert a list of things into a CSV line using the specified settings object
|
||||
///
|
||||
/// This function assumes:
|
||||
/// * That the list of items is not null, but it may contain nulls
|
||||
/// * That settings is not null
|
||||
/// * That RiskyChars and ForceQualifierTypes have been set up correctly to match the CSV settings
|
||||
/// </summary>
|
||||
/// <param name="items"></param>
|
||||
/// <param name="settings"></param>
|
||||
/// <param name="riskyChars"></param>
|
||||
/// <param name="forceQualifierTypes"></param>
|
||||
/// <returns></returns>
|
||||
internal static string ItemsToCsv(IEnumerable items, CSVSettings settings, char[] riskyChars, Dictionary<Type, int> forceQualifierTypes)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (var item in items)
|
||||
{
|
||||
// If this is null, check our settings for what they want us to do
|
||||
if (item == null)
|
||||
{
|
||||
if (settings.AllowNull)
|
||||
{
|
||||
sb.Append(settings.NullToken);
|
||||
}
|
||||
sb.Append(settings.FieldDelimiter);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Special cases for other types of serialization
|
||||
string s;
|
||||
if (item is string)
|
||||
{
|
||||
s = item as string;
|
||||
}
|
||||
else if (item is DateTime)
|
||||
{
|
||||
s = ((DateTime)item).ToString(settings.DateTimeFormat);
|
||||
}
|
||||
else
|
||||
{
|
||||
var itemType = item.GetType();
|
||||
var interfaces = itemType.GetInterfaces();
|
||||
bool isEnumerable = false;
|
||||
if (itemType != typeof(string))
|
||||
{
|
||||
foreach (var itemInterface in interfaces)
|
||||
{
|
||||
if (itemInterface == typeof(IEnumerable))
|
||||
{
|
||||
isEnumerable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Treat enumerables as a simple class of objects that can be unrolled
|
||||
if (isEnumerable)
|
||||
{
|
||||
IEnumerable enumerable = item as IEnumerable;
|
||||
s = string.Empty;
|
||||
switch (settings.NestedArrayBehavior)
|
||||
{
|
||||
case ArrayOptions.ToString:
|
||||
s = item.ToString();
|
||||
break;
|
||||
case ArrayOptions.CountItems:
|
||||
if (enumerable != null)
|
||||
{
|
||||
int enumerableCount = 0;
|
||||
var iter = enumerable.GetEnumerator();
|
||||
using (iter as IDisposable)
|
||||
{
|
||||
while (iter.MoveNext())
|
||||
{
|
||||
enumerableCount++;
|
||||
}
|
||||
}
|
||||
s = enumerableCount.ToString();
|
||||
}
|
||||
break;
|
||||
case ArrayOptions.TreatAsNull:
|
||||
if (settings.AllowNull)
|
||||
{
|
||||
s = settings.NullToken;
|
||||
}
|
||||
else
|
||||
{
|
||||
s = string.Empty;
|
||||
}
|
||||
break;
|
||||
case ArrayOptions.RecursiveSerialization:
|
||||
if (enumerable != null)
|
||||
{
|
||||
s = ItemsToCsv(enumerable, settings, riskyChars, forceQualifierTypes);
|
||||
}
|
||||
else
|
||||
{
|
||||
s = string.Empty;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (itemType.IsClass && settings.NestedObjectBehavior == ObjectOptions.RecursiveSerialization)
|
||||
{
|
||||
var nestedItems = new List<object>();
|
||||
foreach (var field in itemType.GetFields())
|
||||
{
|
||||
nestedItems.Add(field.GetValue(item));
|
||||
}
|
||||
foreach (var prop in itemType.GetProperties())
|
||||
{
|
||||
nestedItems.Add(prop.GetValue(item, null));
|
||||
}
|
||||
s = ItemsToCsv(nestedItems, settings, riskyChars, forceQualifierTypes);
|
||||
}
|
||||
else
|
||||
{
|
||||
s = item.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
// Check if this item requires qualifiers
|
||||
var requiresQualifiers = settings.ForceQualifiers || s.IndexOfAny(riskyChars) >= 0 || (forceQualifierTypes != null && forceQualifierTypes.ContainsKey(item.GetType()));
|
||||
|
||||
// Okay, let's handle this value normally
|
||||
if (requiresQualifiers) sb.Append(settings.TextQualifier);
|
||||
if (!string.IsNullOrEmpty(s))
|
||||
{
|
||||
// Only go character-by-character if necessary
|
||||
if (s.IndexOf(settings.TextQualifier) >= 0)
|
||||
{
|
||||
foreach (var c in s)
|
||||
{
|
||||
// Double up text qualifiers
|
||||
if (c == settings.TextQualifier)
|
||||
{
|
||||
sb.Append(c);
|
||||
}
|
||||
|
||||
sb.Append(c);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append(s);
|
||||
}
|
||||
}
|
||||
|
||||
// Move to the next cell
|
||||
if (requiresQualifiers) sb.Append(settings.TextQualifier);
|
||||
sb.Append(settings.FieldDelimiter);
|
||||
}
|
||||
|
||||
// Subtract the trailing delimiter so we don't inadvertently add an empty column at the end
|
||||
if (sb.Length > 0)
|
||||
{
|
||||
sb.Length -= 1;
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse a separator line and determine
|
||||
/// </summary>
|
||||
/// <param name="line"></param>
|
||||
/// <returns>The separator</returns>
|
||||
public static char? ParseSepLine(string line)
|
||||
{
|
||||
if (line.StartsWith("sep", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var equals = line.Substring(3).Trim();
|
||||
if (equals.StartsWith("="))
|
||||
{
|
||||
var separator = equals.Substring(1).Trim();
|
||||
if (separator.Length > 1)
|
||||
{
|
||||
throw new Exception("Separator in 'sep=' line must be a single character");
|
||||
}
|
||||
|
||||
if (separator.Length == 1)
|
||||
{
|
||||
return separator[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This wasn't a sep line
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
135
CSVNET/CSVDataTable.cs
Normal file
135
CSVNET/CSVDataTable.cs
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* 2006 - 2018 Ted Spence, http://tedspence.com
|
||||
* License: http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Home page: https://github.com/tspence/csharp-csv-reader
|
||||
*/
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
|
||||
namespace CSVNET
|
||||
{
|
||||
/// <summary>
|
||||
/// Code to assist in working with DataTable objects and CSV sources
|
||||
/// </summary>
|
||||
public static class CSVDataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Read in a single CSV file into a datatable in memory
|
||||
/// </summary>
|
||||
/// <param name="filename"></param>
|
||||
/// <param name="settings">The CSV settings to use when exporting this array (Default: CSV)</param>
|
||||
/// <returns>An data table of strings that were retrieved from the CSV file.</returns>
|
||||
public static DataTable FromFile(string filename, CSVSettings settings = null)
|
||||
{
|
||||
using (var sr = new StreamReader(filename))
|
||||
{
|
||||
return FromStream(sr, settings);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read in a single CSV file into a datatable in memory
|
||||
/// </summary>
|
||||
/// <param name="stream">The stream source from which to load the datatable.</param>
|
||||
/// <param name="settings">The CSV settings to use when exporting this array (Default: CSV)</param>
|
||||
/// <returns>An data table of strings that were retrieved from the CSV file.</returns>
|
||||
public static DataTable FromStream(StreamReader stream, CSVSettings settings = null)
|
||||
{
|
||||
using (var cr = new CSVReader(stream, settings))
|
||||
{
|
||||
return cr.ReadAsDataTable();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert a CSV file (in string form) into a data table
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="settings">The CSV settings to use when exporting this array (Default: CSV)</param>
|
||||
/// <returns></returns>
|
||||
public static DataTable FromString(string source, CSVSettings settings = null)
|
||||
{
|
||||
if (settings == null)
|
||||
{
|
||||
settings = CSVSettings.CSV;
|
||||
}
|
||||
var byteArray = settings.Encoding.GetBytes(source);
|
||||
using (var stream = new MemoryStream(byteArray))
|
||||
{
|
||||
using (var cr = new CSVReader(stream, settings))
|
||||
{
|
||||
return cr.ReadAsDataTable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write a data table to disk at the designated file name in CSV format
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <param name="filename"></param>
|
||||
/// <param name="settings">The CSV settings to use when exporting this DataTable (Default: CSV)</param>
|
||||
#if NET2_0
|
||||
public static void WriteToFile(DataTable dt, string filename, CSVSettings settings = null)
|
||||
#else
|
||||
public static void WriteToFile(this DataTable dt, string filename, CSVSettings settings = null)
|
||||
#endif
|
||||
{
|
||||
if (settings == null)
|
||||
{
|
||||
settings = CSVSettings.CSV;
|
||||
}
|
||||
|
||||
using (var fs = new FileStream(filename, FileMode.CreateNew))
|
||||
{
|
||||
using (var sw = new StreamWriter(fs, settings.Encoding))
|
||||
{
|
||||
WriteToStream(dt, sw, settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write the data table to a stream in CSV format
|
||||
/// </summary>
|
||||
/// <param name="dt">The data table to write</param>
|
||||
/// <param name="sw">The stream where the CSV text will be written</param>
|
||||
/// <param name="settings">The CSV settings to use when exporting this DataTable (Default: CSV)</param>
|
||||
#if NET2_0
|
||||
public static void WriteToStream(DataTable dt, StreamWriter sw, CSVSettings settings = null)
|
||||
#else
|
||||
public static void WriteToStream(this DataTable dt, StreamWriter sw, CSVSettings settings = null)
|
||||
#endif
|
||||
{
|
||||
using (var cw = new CSVWriter(sw, settings))
|
||||
{
|
||||
cw.Write(dt);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write a DataTable to a string in CSV format
|
||||
/// </summary>
|
||||
/// <param name="dt">The datatable to write</param>
|
||||
/// <param name="settings">The CSV settings to use when exporting this DataTable (Default: CSV)</param>
|
||||
/// <returns>The CSV string representing the object array.</returns>
|
||||
#if NET2_0
|
||||
public static string WriteToString(DataTable dt, CSVSettings settings = null)
|
||||
#else
|
||||
public static string WriteToString(this DataTable dt, CSVSettings settings = null)
|
||||
#endif
|
||||
{
|
||||
if (settings == null)
|
||||
{
|
||||
settings = CSVSettings.CSV;
|
||||
}
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
var cw = new CSVWriter(ms, settings);
|
||||
cw.Write(dt);
|
||||
var rawString = settings.Encoding.GetString(ms.ToArray());
|
||||
return CSV.RemoveByteOrderMarker(rawString);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
53
CSVNET/CSVNET.csproj
Normal file
53
CSVNET/CSVNET.csproj
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{417A61BC-206D-4895-BAAE-E6155AFBDF2A}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CSVNET</RootNamespace>
|
||||
<AssemblyName>CSVNET</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CSV.cs" />
|
||||
<Compile Include="CSVDataTable.cs" />
|
||||
<Compile Include="CSVReader.cs" />
|
||||
<Compile Include="CSVSettings.cs" />
|
||||
<Compile Include="CSVStateMachine.cs" />
|
||||
<Compile Include="CSVWriter.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
635
CSVNET/CSVReader.cs
Normal file
635
CSVNET/CSVReader.cs
Normal file
@@ -0,0 +1,635 @@
|
||||
/*
|
||||
* 2006 - 2018 Ted Spence, http://tedspence.com
|
||||
* License: http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Home page: https://github.com/tspence/csharp-csv-reader
|
||||
*/
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Data;
|
||||
using System.Reflection;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
#if HAS_ASYNC
|
||||
using System.Threading;
|
||||
#endif
|
||||
|
||||
// These suggestions from Resharper apply because we don't want it to recommend fixing things needed for Net20:
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
// ReSharper disable ConvertIfStatementToNullCoalescingAssignment
|
||||
// ReSharper disable ReplaceSubstringWithRangeIndexer
|
||||
// ReSharper disable InvertIf
|
||||
// ReSharper disable ConvertIfStatementToNullCoalescingExpression
|
||||
|
||||
namespace CSVNET
|
||||
{
|
||||
/// <summary>
|
||||
/// Keeps track of which columns are excluded from CSV serialization / deserialization
|
||||
/// </summary>
|
||||
public class ExcludedColumnHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Note that Dot Net Framework 2.0 does not support HashSet, but it does support Dictionary.
|
||||
/// </summary>
|
||||
private readonly Dictionary<string, int> _excluded;
|
||||
private readonly CSVSettings _settings;
|
||||
|
||||
/// <summary>
|
||||
/// Construct a helper object to track which columns are excluded from serialization
|
||||
/// </summary>
|
||||
/// <param name="settings"></param>
|
||||
public ExcludedColumnHelper(CSVSettings settings)
|
||||
{
|
||||
if (settings?.ExcludedColumns == null || settings.ExcludedColumns.Length == 0)
|
||||
{
|
||||
_excluded = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
_settings = settings;
|
||||
_excluded = new Dictionary<string, int>();
|
||||
foreach (var name in _settings.ExcludedColumns)
|
||||
{
|
||||
var excludedColumnName = name;
|
||||
if (!_settings.HeadersCaseSensitive)
|
||||
{
|
||||
excludedColumnName = excludedColumnName.ToUpperInvariant();
|
||||
}
|
||||
|
||||
_excluded.Add(excludedColumnName, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// True if this column should be excluded
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsExcluded(string name)
|
||||
{
|
||||
if (_excluded == null) return false;
|
||||
var excludedColumnName = name;
|
||||
if (!_settings.HeadersCaseSensitive)
|
||||
{
|
||||
excludedColumnName = excludedColumnName.ToUpperInvariant();
|
||||
}
|
||||
|
||||
return _excluded.ContainsKey(excludedColumnName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A helper object to deserialize a class based on CSV strings
|
||||
/// </summary>
|
||||
public class DeserializationHelper<T> where T : class, new()
|
||||
{
|
||||
private readonly int _numColumns;
|
||||
private readonly Type[] _columnTypes;
|
||||
private readonly TypeConverter[] _converters;
|
||||
private readonly PropertyInfo[] _properties;
|
||||
private readonly FieldInfo[] _fields;
|
||||
private readonly MethodInfo[] _methods;
|
||||
|
||||
/// <summary>
|
||||
/// Construct a new deserialization helper for a specific class containing all the information necessary
|
||||
/// for optimized deserialization
|
||||
/// </summary>
|
||||
/// <param name="settings"></param>
|
||||
/// <param name="headers"></param>
|
||||
public DeserializationHelper(CSVSettings settings, string[] headers)
|
||||
{
|
||||
var settings1 = settings;
|
||||
if (settings1 == null)
|
||||
{
|
||||
settings1 = CSVSettings.TSV;
|
||||
}
|
||||
if (headers == null) throw new Exception("CSV must have headers to be deserialized");
|
||||
var return_type = typeof(T);
|
||||
_numColumns = headers.Length;
|
||||
|
||||
// Set binding flags correctly
|
||||
var bindings = BindingFlags.Public | BindingFlags.Instance;
|
||||
if (!settings1.HeadersCaseSensitive)
|
||||
{
|
||||
bindings |= BindingFlags.IgnoreCase;
|
||||
}
|
||||
|
||||
// Set up the list of excluded columns
|
||||
var excluded = new ExcludedColumnHelper(settings1);
|
||||
|
||||
// Determine how to handle each column in the file - check properties, fields, and methods
|
||||
_columnTypes = new Type[_numColumns];
|
||||
_converters = new TypeConverter[_numColumns];
|
||||
_properties = new PropertyInfo[_numColumns];
|
||||
_fields = new FieldInfo[_numColumns];
|
||||
_methods = new MethodInfo[_numColumns];
|
||||
for (var i = 0; i < _numColumns; i++)
|
||||
{
|
||||
// Is this column excluded?
|
||||
if (excluded.IsExcluded(headers[i])) continue;
|
||||
|
||||
// Check if this is a property
|
||||
_properties[i] = return_type.GetProperty(headers[i], bindings);
|
||||
if (_properties[i] != null && !_properties[i].CanWrite)
|
||||
{
|
||||
if (settings1.IgnoreReadOnlyProperties && settings1.IgnoreHeaderErrors)
|
||||
{
|
||||
_properties[i] = null;
|
||||
continue;
|
||||
}
|
||||
throw new Exception($"The column header '{headers[i]}' matches a read-only property. To ignore this exception, enable IgnoreReadOnlyProperties and IgnoreHeaderErrors.");
|
||||
}
|
||||
|
||||
// If we failed to get a property handler, let's try a field handler
|
||||
if (_properties[i] == null)
|
||||
{
|
||||
_fields[i] = return_type.GetField(headers[i], bindings);
|
||||
|
||||
// If we failed to get a field handler, let's try a method
|
||||
if (_fields[i] == null)
|
||||
{
|
||||
// Methods must be treated differently - we have to ensure that the method has a single parameter
|
||||
var mi = return_type.GetMethod(headers[i], bindings);
|
||||
if (mi != null)
|
||||
{
|
||||
if (mi.GetParameters().Length == 1)
|
||||
{
|
||||
_methods[i] = mi;
|
||||
_columnTypes[i] = mi.GetParameters()[0].ParameterType;
|
||||
}
|
||||
else if (!settings1.IgnoreHeaderErrors)
|
||||
{
|
||||
throw new Exception(
|
||||
$"The column header '{headers[i]}' matched a method with more than one parameter.");
|
||||
}
|
||||
}
|
||||
else if (!settings1.IgnoreHeaderErrors)
|
||||
{
|
||||
throw new Exception(
|
||||
$"The column header '{headers[i]}' was not found in the class '{return_type.FullName}'.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_columnTypes[i] = _fields[i].FieldType;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_columnTypes[i] = _properties[i].PropertyType;
|
||||
}
|
||||
|
||||
if (_columnTypes[i] != null)
|
||||
{
|
||||
_converters[i] = TypeDescriptor.GetConverter(_columnTypes[i]);
|
||||
if (_converters[i] == null && !settings1.IgnoreHeaderErrors)
|
||||
{
|
||||
throw new Exception(
|
||||
$"The column {headers[i]} (type {_columnTypes[i]}) does not have a type converter.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserialize a single row using precomputed converters
|
||||
/// </summary>
|
||||
/// <param name="line"></param>
|
||||
/// <param name="row_num"></param>
|
||||
/// <param name="settings"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public T Deserialize(string[] line, int row_num, CSVSettings settings)
|
||||
{
|
||||
// If this line is completely empty, do our settings permit us to ignore the empty line?
|
||||
if (line.Length == 0 || (line.Length == 1 && line[0] == string.Empty) && settings.IgnoreEmptyLineForDeserialization)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Does this line match the length of the first line? Does the caller want us to complain?
|
||||
if (line.Length != _numColumns && !settings.IgnoreHeaderErrors)
|
||||
{
|
||||
throw new Exception($"Line #{row_num} contains {line.Length} columns; expected {_numColumns}");
|
||||
}
|
||||
|
||||
// Construct a new object and execute each column on it
|
||||
var obj = new T();
|
||||
for (var i = 0; i < Math.Min(line.Length, _numColumns); i++)
|
||||
{
|
||||
if (_converters[i] == null) continue;
|
||||
|
||||
// Attempt to convert this to the specified type
|
||||
object value = null;
|
||||
if (settings.AllowNull && (line[i] == null || line[i] == settings.NullToken))
|
||||
{
|
||||
value = null;
|
||||
}
|
||||
else if (_converters[i].IsValid(line[i]))
|
||||
{
|
||||
value = _converters[i].ConvertFromString(line[i]);
|
||||
}
|
||||
else if (!settings.IgnoreHeaderErrors)
|
||||
{
|
||||
throw new Exception(
|
||||
$"The value '{line[i]}' cannot be converted to the type {_columnTypes[i]}.");
|
||||
}
|
||||
|
||||
// Can we set this value to the object as a property?
|
||||
if (_properties[i] != null)
|
||||
{
|
||||
_properties[i].SetValue(obj, value, null);
|
||||
}
|
||||
else if (_fields[i] != null)
|
||||
{
|
||||
_fields[i].SetValue(obj, value);
|
||||
}
|
||||
else if (_methods[i] != null)
|
||||
{
|
||||
_methods[i].Invoke(obj, new object[] { value });
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A reader that reads from a stream and emits CSV records
|
||||
/// </summary>
|
||||
#if HAS_ASYNC_IENUM
|
||||
public class CSVReader : IAsyncEnumerable<string[]>, IEnumerable<string[]>, IDisposable
|
||||
#else
|
||||
public class CSVReader : IEnumerable<string[]>, IDisposable
|
||||
#endif
|
||||
|
||||
{
|
||||
private readonly CSVSettings _settings;
|
||||
private readonly StreamReader _stream;
|
||||
|
||||
/// <summary>
|
||||
/// The settings currently in use by this reader
|
||||
/// </summary>
|
||||
public CSVSettings Settings
|
||||
{
|
||||
get { return _settings; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If the first row in the file is a header row, this will be populated
|
||||
/// </summary>
|
||||
public string[] Headers { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Convenience function to read from a string
|
||||
/// </summary>
|
||||
/// <param name="source">The string to read</param>
|
||||
/// <param name="settings">The CSV settings to use for this reader (Default: CSV)</param>
|
||||
/// <returns></returns>
|
||||
public static CSVReader FromString(string source, CSVSettings settings = null)
|
||||
{
|
||||
if (settings == null)
|
||||
{
|
||||
settings = CSVSettings.CSV;
|
||||
}
|
||||
var byteArray = settings.Encoding.GetBytes(source);
|
||||
var stream = new MemoryStream(byteArray);
|
||||
return new CSVReader(stream, settings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convenience function to read from a file on disk
|
||||
/// </summary>
|
||||
/// <param name="filename">The file to read</param>
|
||||
/// <param name="settings">The CSV settings to use for this reader (Default: CSV)</param>
|
||||
/// <param name="encoding">The string encoding to use for the reader (Default: UTF8)</param>
|
||||
/// <returns></returns>
|
||||
public static CSVReader FromFile(string filename, CSVSettings settings = null, Encoding encoding = null)
|
||||
{
|
||||
if (encoding == null)
|
||||
{
|
||||
encoding = Encoding.UTF8;
|
||||
}
|
||||
var sr = new StreamReader(filename, encoding);
|
||||
return new CSVReader(sr, settings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Construct a new CSV reader off a streamed source
|
||||
/// </summary>
|
||||
/// <param name="source">The stream source. Note that when disposed, the CSV Reader will dispose the stream reader.</param>
|
||||
/// <param name="settings">The CSV settings to use for this reader (Default: CSV)</param>
|
||||
public CSVReader(StreamReader source, CSVSettings settings = null)
|
||||
{
|
||||
_stream = source;
|
||||
_settings = settings;
|
||||
if (_settings == null)
|
||||
{
|
||||
_settings = CSVSettings.CSV;
|
||||
}
|
||||
|
||||
// Do we need to parse headers?
|
||||
if (_settings.HeaderRowIncluded)
|
||||
{
|
||||
var line = source.ReadLine();
|
||||
if (_settings.AllowSepLine)
|
||||
{
|
||||
var newDelimiter = CSV.ParseSepLine(line);
|
||||
if (newDelimiter != null)
|
||||
{
|
||||
// We don't want to change the original settings, since they may be a singleton
|
||||
_settings = _settings.CloneWithNewDelimiter(newDelimiter.Value);
|
||||
line = source.ReadLine();
|
||||
}
|
||||
}
|
||||
|
||||
Headers = CSV.ParseLine(line, _settings);
|
||||
}
|
||||
else
|
||||
{
|
||||
Headers = _settings.AssumedHeaders;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Construct a new CSV reader off a streamed source
|
||||
/// </summary>
|
||||
/// <param name="source">The stream source. Note that when disposed, the CSV Reader will dispose the stream reader.</param>
|
||||
/// <param name="settings">The CSV settings to use for this reader (Default: CSV)</param>
|
||||
public CSVReader(Stream source, CSVSettings settings = null)
|
||||
{
|
||||
_settings = settings;
|
||||
if (_settings == null)
|
||||
{
|
||||
_settings = CSVSettings.CSV;
|
||||
}
|
||||
_stream = new StreamReader(source, _settings.Encoding);
|
||||
|
||||
// Do we need to parse headers?
|
||||
if (_settings.HeaderRowIncluded)
|
||||
{
|
||||
var line = _stream.ReadLine();
|
||||
if (_settings.AllowSepLine)
|
||||
{
|
||||
var newDelimiter = CSV.ParseSepLine(line);
|
||||
if (newDelimiter != null)
|
||||
{
|
||||
// We don't want to change the original settings, since they may be a singleton
|
||||
_settings = _settings.CloneWithNewDelimiter(newDelimiter.Value);
|
||||
line = _stream.ReadLine();
|
||||
}
|
||||
}
|
||||
|
||||
Headers = CSV.ParseLine(line, _settings);
|
||||
}
|
||||
else
|
||||
{
|
||||
Headers = _settings.AssumedHeaders;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Iterate through all lines in this CSV file
|
||||
/// </summary>
|
||||
/// <returns>An array of all data columns in the line</returns>
|
||||
public IEnumerable<string[]> Lines()
|
||||
{
|
||||
return CSV.ParseStream(_stream, _settings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Iterate through all lines in this CSV file
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IEnumerator<string[]> GetEnumerator()
|
||||
{
|
||||
return CSV.ParseStream(_stream, _settings).GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
#if HAS_ASYNC_IENUM
|
||||
/// <summary>
|
||||
/// Iterate through all lines in this CSV file using async
|
||||
/// </summary>
|
||||
/// <returns>An array of all data columns in the line</returns>
|
||||
public IAsyncEnumerable<string[]> LinesAsync()
|
||||
{
|
||||
return CSV.ParseStreamAsync(_stream, _settings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Iterate through all lines in this CSV file using async
|
||||
/// </summary>
|
||||
/// <returns>An array of all data columns in the line</returns>
|
||||
public IAsyncEnumerator<string[]> GetAsyncEnumerator(CancellationToken cancellationToken = new CancellationToken())
|
||||
{
|
||||
return CSV.ParseStreamAsync(_stream, _settings).GetAsyncEnumerator(cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserialize the CSV reader into a generic list
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of data to deserialize</typeparam>
|
||||
/// <returns>A streaming collection of records from the CSV source</returns>
|
||||
/// <exception cref="Exception">If the CSV source cannot be parsed into the type, throws exceptions</exception>
|
||||
public async IAsyncEnumerable<T> DeserializeAsync<T>() where T : class, new()
|
||||
{
|
||||
var helper = new DeserializationHelper<T>(_settings, Headers);
|
||||
|
||||
// Alright, let's retrieve CSV lines and parse each one!
|
||||
var row_num = 0;
|
||||
await foreach (var line in this)
|
||||
{
|
||||
row_num++;
|
||||
var obj = helper.Deserialize(line, row_num, _settings);
|
||||
if (obj != null)
|
||||
{
|
||||
yield return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Read this file into a data table in memory
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DataTable ReadAsDataTable()
|
||||
{
|
||||
var dt = new DataTable();
|
||||
string[] firstLine = null;
|
||||
|
||||
// File contains column names - so name each column properly
|
||||
if (Headers == null)
|
||||
{
|
||||
var rawLine = _stream.ReadLine();
|
||||
firstLine = CSV.ParseLine(rawLine, _settings);
|
||||
var list = new List<string>();
|
||||
for (var i = 0; i < firstLine.Length; i++)
|
||||
{
|
||||
list.Add($"Column{i}");
|
||||
}
|
||||
|
||||
this.Headers = list.ToArray();
|
||||
}
|
||||
|
||||
// Add headers
|
||||
var numColumns = Headers.Length;
|
||||
foreach (var t in Headers)
|
||||
{
|
||||
dt.Columns.Add(new DataColumn(t, typeof(string)));
|
||||
}
|
||||
|
||||
// If we had to read the first line to get dimensions, add it
|
||||
var row_num = 1;
|
||||
if (firstLine != null)
|
||||
{
|
||||
dt.Rows.Add(firstLine);
|
||||
row_num++;
|
||||
}
|
||||
|
||||
// Start reading through the file
|
||||
foreach (var line in CSV.ParseStream(_stream, _settings))
|
||||
{
|
||||
|
||||
// Does this line match the length of the first line?
|
||||
if (line.Length != numColumns)
|
||||
{
|
||||
if (!_settings.IgnoreDimensionErrors)
|
||||
{
|
||||
throw new Exception($"Line #{row_num} contains {line.Length} columns; expected {numColumns}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// Add as best we can - construct a new line and make it fit
|
||||
var list = new List<string>();
|
||||
list.AddRange(line);
|
||||
while (list.Count < numColumns)
|
||||
{
|
||||
list.Add("");
|
||||
}
|
||||
dt.Rows.Add(list.GetRange(0, numColumns).ToArray());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dt.Rows.Add(line);
|
||||
}
|
||||
|
||||
// Keep track of where we are in the file
|
||||
row_num++;
|
||||
}
|
||||
|
||||
// Here's your data table
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserialize the CSV reader into a generic list
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type to deserialize</typeparam>
|
||||
/// <returns>A streaming collection of objects as they are read from the source</returns>
|
||||
/// <exception cref="Exception">If the CSV formatting does not match the object, throw errors</exception>
|
||||
public IEnumerable<T> Deserialize<T>() where T : class, new()
|
||||
{
|
||||
var helper = new DeserializationHelper<T>(_settings, Headers);
|
||||
|
||||
// Alright, let's retrieve CSV lines and parse each one!
|
||||
var row_num = 0;
|
||||
foreach (var line in this)
|
||||
{
|
||||
row_num++;
|
||||
var obj = helper.Deserialize(line, row_num, _settings);
|
||||
if (obj != null)
|
||||
{
|
||||
yield return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Close our resources - specifically, the stream reader
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_stream.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Take a CSV file and chop it into multiple chunks of a specified maximum size.
|
||||
/// </summary>
|
||||
/// <param name="filename">The input filename to chop</param>
|
||||
/// <param name="out_folder">The folder where the chopped CSV will be saved</param>
|
||||
/// <param name="maxLinesPerFile">The maximum number of lines to put into each file</param>
|
||||
/// <param name="settings">The CSV settings to use when chopping this file into chunks (Default: CSV)</param>
|
||||
/// <returns>Number of files chopped</returns>
|
||||
public static int ChopFile(string filename, string out_folder, int maxLinesPerFile, CSVSettings settings = null)
|
||||
{
|
||||
// Default settings
|
||||
if (settings == null) settings = CSVSettings.CSV;
|
||||
|
||||
// Let's begin parsing
|
||||
var file_id = 1;
|
||||
var line_count = 0;
|
||||
var file_prefix = Path.GetFileNameWithoutExtension(filename);
|
||||
var ext = Path.GetExtension(filename);
|
||||
CSVWriter cw = null;
|
||||
StreamWriter sw = null;
|
||||
|
||||
// Read in lines from the file
|
||||
using (var sr = new StreamReader(filename))
|
||||
{
|
||||
using (var cr = new CSVReader(sr, settings))
|
||||
{
|
||||
|
||||
// Okay, let's do the real work
|
||||
foreach (var line in cr.Lines())
|
||||
{
|
||||
|
||||
// Do we need to create a file for writing?
|
||||
if (cw == null)
|
||||
{
|
||||
var fn = Path.Combine(out_folder, file_prefix + file_id.ToString() + ext);
|
||||
var fs = new FileStream(fn, FileMode.CreateNew);
|
||||
sw = new StreamWriter(fs, settings.Encoding);
|
||||
cw = new CSVWriter(sw, settings);
|
||||
if (settings.HeaderRowIncluded)
|
||||
{
|
||||
cw.WriteLine(cr.Headers);
|
||||
}
|
||||
}
|
||||
|
||||
// Write one line
|
||||
cw.WriteLine(line);
|
||||
|
||||
// Count lines - close the file if done
|
||||
line_count++;
|
||||
if (line_count >= maxLinesPerFile)
|
||||
{
|
||||
cw.Dispose();
|
||||
cw = null;
|
||||
file_id++;
|
||||
line_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the final CSVWriter is closed properly
|
||||
if (cw != null)
|
||||
{
|
||||
cw.Dispose();
|
||||
cw = null;
|
||||
}
|
||||
return file_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
262
CSVNET/CSVSettings.cs
Normal file
262
CSVNET/CSVSettings.cs
Normal file
@@ -0,0 +1,262 @@
|
||||
/*
|
||||
* 2006 - 2018 Ted Spence, http://tedspence.com
|
||||
* License: http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Home page: https://github.com/tspence/csharp-csv-reader
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace CSVNET
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the behavior of CSV serialization when a nested array is encountered
|
||||
/// </summary>
|
||||
public enum ArrayOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Use built-in string conversion, which renders arrays as `MyNamespace.MyObject[]`
|
||||
/// </summary>
|
||||
ToString,
|
||||
|
||||
/// <summary>
|
||||
/// Convert any array columns that are array types into nulls (either blanks or null tokens)
|
||||
/// </summary>
|
||||
TreatAsNull,
|
||||
|
||||
/// <summary>
|
||||
/// Render the number of items in the array
|
||||
/// </summary>
|
||||
CountItems,
|
||||
|
||||
/// <summary>
|
||||
/// Serialize child arrays recursively using the same settings
|
||||
/// </summary>
|
||||
RecursiveSerialization,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the behavior of CSV Serialization when a nested object (class) is encountered
|
||||
/// </summary>
|
||||
public enum ObjectOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Use built-in string conversion, which renders as `MyNamespace.MyObject`
|
||||
/// </summary>
|
||||
ToString,
|
||||
|
||||
/// <summary>
|
||||
/// Serialize child objects recursively using the same settings
|
||||
/// </summary>
|
||||
RecursiveSerialization,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Settings to configure how a CSV file is parsed
|
||||
/// </summary>
|
||||
public class CSVSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// The character used to delimit individual fields in the CSV.
|
||||
/// </summary>
|
||||
public char FieldDelimiter { get; set; } = ',';
|
||||
|
||||
/// <summary>
|
||||
/// The character used to enclose fields that contain the delimiter character.
|
||||
/// </summary>
|
||||
public char TextQualifier { get; set; } = '"';
|
||||
|
||||
/// <summary>
|
||||
/// The separator used to indicate the end of a line in the CSV file.
|
||||
/// </summary>
|
||||
public string LineSeparator { get; set; } = Environment.NewLine;
|
||||
|
||||
/// <summary>
|
||||
/// Set this value to true to enclose all fields in the text qualifier character.
|
||||
/// </summary>
|
||||
public bool ForceQualifiers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set this value to true to allow nulls to be rendered in CSV files when serializing
|
||||
/// and deserializing.
|
||||
///
|
||||
/// CSV files by default do not have a mechanism for differentiating between null fields
|
||||
/// and empty fields. If this field is set to false, both `null` and empty string will
|
||||
/// render as an empty string.
|
||||
///
|
||||
/// If this field is set to true, all non-null fields will be enclosed by the text qualifier,
|
||||
/// and fields that are null will be represented as `NullToken`.
|
||||
/// </summary>
|
||||
public bool AllowNull { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If AllowNull is set to true, this token will be used to represent NULL values.
|
||||
/// </summary>
|
||||
public string NullToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The first line of the CSV file will include the names of each field.
|
||||
/// </summary>
|
||||
public bool HeaderRowIncluded { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// When reading a CSV file, if the first line contains the instruction `sep=`, use this
|
||||
/// to determine the separator for the file.
|
||||
///
|
||||
/// The "sep" line is a feature exclusive to Microsoft Excel, which permits CSV files to
|
||||
/// more easily handle European files where the comma character is often a separator between
|
||||
/// numeric values rather than a field delimiter.
|
||||
///
|
||||
/// If this flag is set to true, when you parse a CSV, the first line of the parsing can override
|
||||
/// the field separator logic for each individual instance of parsing, but it will not change
|
||||
/// the `FieldDelimiter` in your settings object.
|
||||
///
|
||||
/// More information:
|
||||
/// * [Original Issue Report](https://github.com/tspence/csharp-csv-reader/issues/28)
|
||||
/// * [Superuser Article](https://superuser.com/questions/773644/what-is-the-sep-metadata-you-can-add-to-csvs)
|
||||
/// * [Tjitjing Blog](https://blog.tjitjing.com/index.php/2016/07/set-separator-delimiter-in-csv-file-to-open-correctly-in-excel.html)
|
||||
/// </summary>
|
||||
public bool AllowSepLine { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// If `HeaderRowIncluded` is false, use these values for the headers
|
||||
/// </summary>
|
||||
public string[] AssumedHeaders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set this value to true to allow parsing for files where each row has a different number of fields
|
||||
/// </summary>
|
||||
public bool IgnoreDimensionErrors { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Set this value to true to ignore header errors when deserializing
|
||||
/// </summary>
|
||||
public bool IgnoreHeaderErrors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set this flag to true to ignore read-only properties during serialization
|
||||
/// </summary>
|
||||
public bool IgnoreReadOnlyProperties { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Expect headers to be case sensitive during deserialization
|
||||
/// </summary>
|
||||
public bool HeadersCaseSensitive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Exclude these columns during serialization and deserialization
|
||||
/// </summary>
|
||||
public string[] ExcludedColumns { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of data types that require text qualifiers during serialization.
|
||||
/// </summary>
|
||||
public Type[] ForceQualifierTypes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Some CSV files contain an empty line at the end. If you set this flag to true, deserialization will
|
||||
/// not throw an error for empty lines and will instead ignore it.
|
||||
/// </summary>
|
||||
public bool IgnoreEmptyLineForDeserialization { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// When reading data from a stream, this is the block size to read at once.
|
||||
/// </summary>
|
||||
public int BufferSize { get; set; } = DEFAULT_BUFFER_SIZE;
|
||||
internal static readonly int DEFAULT_BUFFER_SIZE = 65536;
|
||||
|
||||
/// <summary>
|
||||
/// The encoding for converting streams of bytes to strings
|
||||
/// </summary>
|
||||
public Encoding Encoding { get; set; } = Encoding.UTF8;
|
||||
|
||||
/// <summary>
|
||||
/// The format to use for serializing date time objects, by default, ISO 8601
|
||||
/// </summary>
|
||||
public string DateTimeFormat { get; set; } = "o";
|
||||
|
||||
/// <summary>
|
||||
/// The behavior to use when serializing a column that is an array or enumerable type
|
||||
/// </summary>
|
||||
public ArrayOptions NestedArrayBehavior { get; set; } = ArrayOptions.ToString;
|
||||
|
||||
/// <summary>
|
||||
/// The behavior to use when serializing a column that is a class
|
||||
/// </summary>
|
||||
public ObjectOptions NestedObjectBehavior { get; set; } = ObjectOptions.ToString;
|
||||
|
||||
/// <summary>
|
||||
/// Standard comma-separated value (CSV) file settings
|
||||
/// </summary>
|
||||
public static readonly CSVSettings CSV = new CSVSettings();
|
||||
|
||||
/// <summary>
|
||||
/// Standard comma-separated value (CSV) file settings that permit rendering of NULL values
|
||||
/// </summary>
|
||||
public static readonly CSVSettings CSV_PERMIT_NULL = new CSVSettings()
|
||||
{
|
||||
AllowNull = true,
|
||||
NullToken = "NULL"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Standard tab-separated value (TSV) file settings
|
||||
/// </summary>
|
||||
public static readonly CSVSettings TSV = new CSVSettings()
|
||||
{
|
||||
FieldDelimiter = '\t'
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Clone the existing settings, but with a different field delimiter.
|
||||
///
|
||||
/// Used for parsing of "sep=" lines so that the original object is immutable.
|
||||
/// </summary>
|
||||
/// <param name="newDelimiter">The new delimiter for the cloned settings</param>
|
||||
/// <returns>The newly cloned settings with the updated delimiter</returns>
|
||||
public CSVSettings CloneWithNewDelimiter(char newDelimiter)
|
||||
{
|
||||
var newSettings = (CSVSettings)this.MemberwiseClone();
|
||||
newSettings.FieldDelimiter = newDelimiter;
|
||||
return newSettings;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the list of risky characters according to this settings definition
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public char[] GetRiskyChars()
|
||||
{
|
||||
var riskyChars = new List<char>();
|
||||
riskyChars.Add(FieldDelimiter);
|
||||
riskyChars.Add(TextQualifier);
|
||||
foreach (var c in LineSeparator)
|
||||
{
|
||||
riskyChars.Add(c);
|
||||
}
|
||||
|
||||
// CRLF is always considered risky
|
||||
riskyChars.Add('\n');
|
||||
riskyChars.Add('\r');
|
||||
return riskyChars.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve a hashset containing the list of types that require text qualifiers, or null if this
|
||||
/// feature is not used in this settings definition
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public Dictionary<Type, int> GetForceQualifierTypes()
|
||||
{
|
||||
if (ForceQualifierTypes == null) return null;
|
||||
var hashSet = new Dictionary<Type, int>();
|
||||
foreach (var type in ForceQualifierTypes)
|
||||
{
|
||||
hashSet.Add(type, 1);
|
||||
}
|
||||
|
||||
return hashSet;
|
||||
}
|
||||
}
|
||||
}
|
||||
269
CSVNET/CSVStateMachine.cs
Normal file
269
CSVNET/CSVStateMachine.cs
Normal file
@@ -0,0 +1,269 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
// These suggestions from Resharper apply because we don't want it to recommend fixing things needed for Net20:
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
// ReSharper disable ConvertIfStatementToNullCoalescingAssignment
|
||||
// ReSharper disable ReplaceSubstringWithRangeIndexer
|
||||
// ReSharper disable InvertIf
|
||||
// ReSharper disable ConvertIfStatementToSwitchExpression
|
||||
// ReSharper disable ConvertIfStatementToSwitchStatement
|
||||
// ReSharper disable ReturnTypeCanBeEnumerable.Global
|
||||
|
||||
namespace CSVNET
|
||||
{
|
||||
/// <summary>
|
||||
/// The current state of CSV processing, given the text that has been seen so far
|
||||
/// </summary>
|
||||
public enum CSVState
|
||||
{
|
||||
/// <summary>
|
||||
/// We have reached the end of the CSV and everything is done
|
||||
/// </summary>
|
||||
Done,
|
||||
|
||||
/// <summary>
|
||||
/// We don't need more text at the moment
|
||||
/// </summary>
|
||||
CanKeepGoing,
|
||||
|
||||
/// <summary>
|
||||
/// The CSV reached the end, but there was a missing (unpaired) text qualifier.
|
||||
/// For example:
|
||||
/// `1,2,3,"test`
|
||||
/// </summary>
|
||||
MissingTrailingQualifier
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This state machine handles all functions of CSV processing except for the I/O, which can come in a variety
|
||||
/// of forms, either from a stream or an in-memory collection.
|
||||
///
|
||||
/// Since some CSV files have a single row of data that comprises multiple lines, this state machine may or may
|
||||
/// not produce one row of data for each chunk of text received.
|
||||
/// </summary>
|
||||
public class CSVStateMachine
|
||||
{
|
||||
private readonly CSVSettings _settings;
|
||||
private string _line;
|
||||
private readonly List<string> _list;
|
||||
private readonly StringBuilder _work;
|
||||
private int _position;
|
||||
private char _delimiter;
|
||||
private bool _allowSepLine;
|
||||
private bool _inTextQualifier;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the state machine has concluded or can continue processing
|
||||
/// </summary>
|
||||
public CSVState State { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if we need more text
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool NeedsMoreText()
|
||||
{
|
||||
return String.IsNullOrEmpty(_line) || _position + _settings.LineSeparator.Length >= _line.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new state machine to begin processing CSV text
|
||||
/// </summary>
|
||||
public CSVStateMachine(CSVSettings settings)
|
||||
{
|
||||
_line = "";
|
||||
_list = new List<string>();
|
||||
_work = new StringBuilder();
|
||||
_settings = settings ?? CSVSettings.CSV;
|
||||
_position = -1;
|
||||
|
||||
// The presence of a "sep=" line may affect these values
|
||||
_delimiter = _settings.FieldDelimiter;
|
||||
_allowSepLine = _settings.AllowSepLine;
|
||||
|
||||
// We are ready for work
|
||||
State = CSVState.CanKeepGoing;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse a new chunk of text retrieved via some other means than a stream.
|
||||
///
|
||||
/// Call this function when you are retrieving your own text and when each chunk may or may not
|
||||
/// include line separators, and your stream does not consume line separators on its own.
|
||||
/// </summary>
|
||||
/// <param name="chunk">The new data to process</param>
|
||||
/// <param name="reachedEnd">Set this value to true </param>
|
||||
/// <returns>If this parsing operation produces a valid row, this will be non-null</returns>
|
||||
public string[] ParseChunk(string chunk, bool reachedEnd)
|
||||
{
|
||||
// Detect end of stream
|
||||
if (reachedEnd && string.IsNullOrEmpty(chunk) && _position == -1 && string.IsNullOrEmpty(_line))
|
||||
{
|
||||
State = CSVState.Done;
|
||||
return null;
|
||||
}
|
||||
|
||||
// If we're at the end of the line, remember to backtrack one because we increment immediately
|
||||
if (_position == _line.Length)
|
||||
{
|
||||
_position -= 1;
|
||||
}
|
||||
|
||||
// Add this chunk to the current processing logic
|
||||
_line += chunk;
|
||||
|
||||
// Check for the presence of a "sep=" line once at the beginning of a stream
|
||||
if (_allowSepLine)
|
||||
{
|
||||
var newDelimiter = CSV.ParseSepLine(_line);
|
||||
_allowSepLine = false;
|
||||
if (newDelimiter != null)
|
||||
{
|
||||
_delimiter = newDelimiter.Value;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Process one character at a time from the current line
|
||||
while (_position < _line.Length || !reachedEnd)
|
||||
{
|
||||
_position++;
|
||||
|
||||
// Have we reached the end of the stream?
|
||||
if (_position >= _line.Length)
|
||||
{
|
||||
if (reachedEnd)
|
||||
{
|
||||
// If we reached the end while still in a text qualifier, the CSV is broken
|
||||
if (_inTextQualifier)
|
||||
{
|
||||
State = CSVState.MissingTrailingQualifier;
|
||||
return null;
|
||||
}
|
||||
|
||||
// We always add the final work item here because trailing empty strings are valid
|
||||
State = CSVState.Done;
|
||||
_list.Add(_work.ToString());
|
||||
_line = string.Empty;
|
||||
_position = -1;
|
||||
return _list.ToArray();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
var c = _line[_position];
|
||||
|
||||
// If we are resuming after starting a text qualifier, can we find the end?
|
||||
if (_inTextQualifier)
|
||||
{
|
||||
var p2 = -1;
|
||||
while (p2 < 0)
|
||||
{
|
||||
p2 = _line.IndexOf(_settings.TextQualifier, _position + 1);
|
||||
if (p2 < 0)
|
||||
{
|
||||
if (reachedEnd)
|
||||
{
|
||||
State = CSVState.MissingTrailingQualifier;
|
||||
}
|
||||
|
||||
// Backtrack one character so we can move forward when the next chunk loads
|
||||
_position--;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Append the text between the qualifiers
|
||||
_work.Append(_line.Substring(_position + 1, p2 - _position - 1));
|
||||
_position = p2;
|
||||
|
||||
// If the user put in a doubled-up qualifier, e.g. `""`, insert a single one and continue
|
||||
if (p2 + 1 < _line.Length && _line[p2 + 1] == _settings.TextQualifier)
|
||||
{
|
||||
_work.Append(_settings.TextQualifier);
|
||||
_position++;
|
||||
p2 = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// We're done parsing this text qualifier
|
||||
_inTextQualifier = false;
|
||||
}
|
||||
// Is this the start of a text qualified field?
|
||||
else if (c == _settings.TextQualifier && _work.Length == 0)
|
||||
{
|
||||
_inTextQualifier = true;
|
||||
_position--;
|
||||
}
|
||||
// Are we at a line separator? Let's do a quick test first
|
||||
else if (c == _settings.LineSeparator[0])
|
||||
{
|
||||
// If we don't have enough characters left to test the line separator properly, ask for more
|
||||
var notEnoughChars = _position + _settings.LineSeparator.Length > _line.Length;
|
||||
if (notEnoughChars && !reachedEnd)
|
||||
{
|
||||
// Backtrack one character so we can pick up the line separator completely next time
|
||||
_position--;
|
||||
return null;
|
||||
}
|
||||
|
||||
// If we have reached the end, but this isn't a complete line separator, it's just text
|
||||
if (notEnoughChars)
|
||||
{
|
||||
_work.Append(c);
|
||||
}
|
||||
// OK, we have enough characters, see if this is a line separator
|
||||
else if (string.Equals(_line.Substring(_position, _settings.LineSeparator.Length), _settings.LineSeparator))
|
||||
{
|
||||
_line = _line.Substring(_position + _settings.LineSeparator.Length);
|
||||
_position = -1;
|
||||
_list.Add(_work.ToString());
|
||||
var row = _list.ToArray();
|
||||
_list.Clear();
|
||||
_work.Length = 0;
|
||||
return row;
|
||||
}
|
||||
// It's not a line separator, it's just a normal character
|
||||
else
|
||||
{
|
||||
_work.Append(c);
|
||||
}
|
||||
}
|
||||
// Does this start a new field?
|
||||
else if (c == _delimiter)
|
||||
{
|
||||
// Is this a null token, and do we permit null tokens?
|
||||
var s = _work.ToString();
|
||||
if (_settings.AllowNull && string.Equals(s, _settings.NullToken, StringComparison.Ordinal))
|
||||
{
|
||||
_list.Add(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
_list.Add(s);
|
||||
}
|
||||
_work.Length = 0;
|
||||
|
||||
// Test for special case: when the user has written a casual comma, space, and text qualifier, skip the space
|
||||
// Checks if the second parameter of the if statement will pass through successfully
|
||||
// e.g. `"bob", "mary", "bill"`
|
||||
if (_position + 2 <= _line.Length - 1)
|
||||
{
|
||||
if (_line[_position + 1].Equals(' ') && _line[_position + 2].Equals(_settings.TextQualifier))
|
||||
{
|
||||
_position++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Regular character
|
||||
else
|
||||
{
|
||||
_work.Append(c);
|
||||
}
|
||||
}
|
||||
|
||||
State = CSVState.Done;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
298
CSVNET/CSVWriter.cs
Normal file
298
CSVNET/CSVWriter.cs
Normal file
@@ -0,0 +1,298 @@
|
||||
/*
|
||||
* 2006 - 2018 Ted Spence, http://tedspence.com
|
||||
* License: http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Home page: https://github.com/tspence/csharp-csv-reader
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Data;
|
||||
using System.Reflection;
|
||||
#if HAS_ASYNC
|
||||
using System.Threading.Tasks;
|
||||
#endif
|
||||
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
// ReSharper disable ConvertIfStatementToNullCoalescingExpression
|
||||
|
||||
namespace CSVNET
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper object that implements serialization separately from the string or stream I/O
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class SerializationHelper<T> where T : class, new()
|
||||
{
|
||||
private readonly CSVSettings _settings;
|
||||
private readonly PropertyInfo[] _properties;
|
||||
private readonly FieldInfo[] _fields;
|
||||
private readonly char[] _riskyChars;
|
||||
private readonly Dictionary<Type, int> _forceQualifierTypes;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a serialization helper object separate from I/O
|
||||
/// </summary>
|
||||
/// <param name="settings"></param>
|
||||
/// <param name="riskyChars"></param>
|
||||
/// <param name="forceQualifierTypes"></param>
|
||||
public SerializationHelper(CSVSettings settings, char[] riskyChars, Dictionary<Type, int> forceQualifierTypes)
|
||||
{
|
||||
_settings = settings;
|
||||
if (_settings == null)
|
||||
{
|
||||
_settings = CSVSettings.CSV;
|
||||
}
|
||||
|
||||
// Extract properties and fields that are not excluded
|
||||
var excluded = new ExcludedColumnHelper(_settings);
|
||||
var props = new List<PropertyInfo>();
|
||||
foreach (var prop in typeof(T).GetProperties())
|
||||
{
|
||||
if (!excluded.IsExcluded(prop.Name))
|
||||
{
|
||||
props.Add(prop);
|
||||
}
|
||||
}
|
||||
|
||||
var fields = new List<FieldInfo>();
|
||||
foreach (var field in typeof(T).GetFields())
|
||||
{
|
||||
if (!excluded.IsExcluded(field.Name))
|
||||
{
|
||||
fields.Add(field);
|
||||
}
|
||||
}
|
||||
|
||||
_properties = props.ToArray();
|
||||
_fields = fields.ToArray();
|
||||
_riskyChars = riskyChars;
|
||||
_forceQualifierTypes = forceQualifierTypes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serialize the header for the CSV file
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string SerializeHeader()
|
||||
{
|
||||
var headers = new List<object>();
|
||||
foreach (var field in _fields)
|
||||
{
|
||||
headers.Add(field.Name);
|
||||
}
|
||||
foreach (var prop in _properties)
|
||||
{
|
||||
headers.Add(prop.Name);
|
||||
}
|
||||
|
||||
return CSV.ItemsToCsv(headers, _settings, _riskyChars, _forceQualifierTypes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serialize a single row for the CSV file
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
public string Serialize(T obj)
|
||||
{
|
||||
var items = new List<object>();
|
||||
foreach (var field in _fields)
|
||||
{
|
||||
items.Add(field.GetValue(obj));
|
||||
}
|
||||
foreach (var prop in _properties)
|
||||
{
|
||||
items.Add(prop.GetValue(obj, null));
|
||||
}
|
||||
return CSV.ItemsToCsv(items, _settings, _riskyChars, _forceQualifierTypes);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes CSV objects to a stream
|
||||
/// </summary>
|
||||
public class CSVWriter : IDisposable
|
||||
{
|
||||
private readonly CSVSettings _settings;
|
||||
private readonly StreamWriter _writer;
|
||||
private readonly char[] _riskyChars;
|
||||
private readonly Dictionary<Type, int> _forceQualifierTypes;
|
||||
|
||||
/// <summary>
|
||||
/// Construct a new CSV writer to produce output on the enclosed StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="dest">The stream where this CSV will be outputted</param>
|
||||
/// <param name="settings">The CSV settings to use when writing to the stream (Default: CSV)</param>
|
||||
public CSVWriter(StreamWriter dest, CSVSettings settings = null)
|
||||
{
|
||||
_writer = dest;
|
||||
_settings = settings;
|
||||
if (_settings == null)
|
||||
{
|
||||
_settings = CSVSettings.CSV;
|
||||
}
|
||||
_riskyChars = _settings.GetRiskyChars();
|
||||
_forceQualifierTypes = _settings.GetForceQualifierTypes();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Construct a new CSV writer to produce output on the enclosed stream
|
||||
/// </summary>
|
||||
/// <param name="dest">The stream where this CSV will be outputted</param>
|
||||
/// <param name="settings">The CSV settings to use when writing to the stream (Default: CSV)</param>
|
||||
public CSVWriter(Stream dest, CSVSettings settings = null)
|
||||
{
|
||||
_settings = settings;
|
||||
if (_settings == null)
|
||||
{
|
||||
_settings = CSVSettings.CSV;
|
||||
}
|
||||
_writer = new StreamWriter(dest, _settings.Encoding);
|
||||
_riskyChars = _settings.GetRiskyChars();
|
||||
_forceQualifierTypes = _settings.GetForceQualifierTypes();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write the data table to a stream in CSV format
|
||||
/// </summary>
|
||||
/// <param name="dt">The data table to write</param>
|
||||
public void Write(DataTable dt)
|
||||
{
|
||||
if (_settings.HeaderRowIncluded)
|
||||
{
|
||||
var headers = new List<object>();
|
||||
foreach (DataColumn col in dt.Columns)
|
||||
{
|
||||
headers.Add(col.ColumnName);
|
||||
}
|
||||
_writer.Write(CSV.ItemsToCsv(headers, _settings, _riskyChars, _forceQualifierTypes));
|
||||
_writer.Write(_settings.LineSeparator);
|
||||
}
|
||||
|
||||
foreach (DataRow dr in dt.Rows)
|
||||
{
|
||||
_writer.Write(CSV.ItemsToCsv(dr.ItemArray, _settings, _riskyChars, _forceQualifierTypes));
|
||||
_writer.Write(_settings.LineSeparator);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write a single line to this CSV
|
||||
/// </summary>
|
||||
/// <param name="items"></param>
|
||||
public void WriteLine(IEnumerable<object> items)
|
||||
{
|
||||
_writer.Write(CSV.ItemsToCsv(items, _settings, _riskyChars, _forceQualifierTypes));
|
||||
_writer.Write(_settings.LineSeparator);
|
||||
}
|
||||
|
||||
#if HAS_ASYNC
|
||||
/// <summary>
|
||||
/// Write a single line to this CSV
|
||||
/// </summary>
|
||||
/// <param name="items"></param>
|
||||
public async Task WriteLineAsync(IEnumerable<object> items)
|
||||
{
|
||||
await _writer.WriteAsync(CSV.ItemsToCsv(items, _settings, _riskyChars, _forceQualifierTypes));
|
||||
await _writer.WriteAsync(_settings.LineSeparator);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write the data table to a stream in CSV format
|
||||
/// </summary>
|
||||
/// <param name="dt">The data table to write</param>
|
||||
public async Task WriteAsync(DataTable dt)
|
||||
{
|
||||
if (_settings.HeaderRowIncluded)
|
||||
{
|
||||
var headers = new List<object>();
|
||||
foreach (DataColumn col in dt.Columns)
|
||||
{
|
||||
headers.Add(col.ColumnName);
|
||||
}
|
||||
await _writer.WriteAsync(CSV.ItemsToCsv(headers, _settings, _riskyChars, _forceQualifierTypes));
|
||||
await _writer.WriteAsync(_settings.LineSeparator);
|
||||
}
|
||||
|
||||
foreach (DataRow dr in dt.Rows)
|
||||
{
|
||||
await _writer.WriteAsync(CSV.ItemsToCsv(dr.ItemArray, _settings, _riskyChars, _forceQualifierTypes));
|
||||
await _writer.WriteAsync(_settings.LineSeparator);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Serialize a list of objects to CSV using this writer
|
||||
/// </summary>
|
||||
/// <param name="list">An IEnumerable that produces the list of objects to serialize.</param>
|
||||
public void Serialize<T>(IEnumerable<T> list) where T : class, new()
|
||||
{
|
||||
var serializer = new SerializationHelper<T>(_settings, _riskyChars, _forceQualifierTypes);
|
||||
if (_settings.HeaderRowIncluded)
|
||||
{
|
||||
_writer.Write(serializer.SerializeHeader());
|
||||
_writer.Write(_settings.LineSeparator);
|
||||
}
|
||||
|
||||
foreach (var row in list)
|
||||
{
|
||||
_writer.Write(serializer.Serialize(row));
|
||||
_writer.Write(_settings.LineSeparator);
|
||||
}
|
||||
}
|
||||
|
||||
#if HAS_ASYNC
|
||||
/// <summary>
|
||||
/// Serialize a list of objects to CSV using this writer
|
||||
/// </summary>
|
||||
/// <param name="list">An IEnumerable that produces the list of objects to serialize.</param>
|
||||
public async Task SerializeAsync<T>(IEnumerable<T> list) where T : class, new()
|
||||
{
|
||||
var serializer = new SerializationHelper<T>(_settings, _riskyChars, _forceQualifierTypes);
|
||||
if (_settings.HeaderRowIncluded)
|
||||
{
|
||||
await _writer.WriteAsync(serializer.SerializeHeader());
|
||||
await _writer.WriteAsync(_settings.LineSeparator);
|
||||
}
|
||||
|
||||
foreach (var row in list)
|
||||
{
|
||||
await _writer.WriteAsync(serializer.Serialize(row));
|
||||
await _writer.WriteAsync(_settings.LineSeparator);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAS_ASYNC_IENUM
|
||||
/// <summary>
|
||||
/// Serialize a list of objects to CSV using this writer
|
||||
/// </summary>
|
||||
/// <param name="list">An IEnumerable that produces the list of objects to serialize.</param>
|
||||
public async Task SerializeAsync<T>(IAsyncEnumerable<T> list) where T : class, new()
|
||||
{
|
||||
var serializer = new SerializationHelper<T>(_settings, _riskyChars, _forceQualifierTypes);
|
||||
if (_settings.HeaderRowIncluded)
|
||||
{
|
||||
await _writer.WriteAsync(serializer.SerializeHeader());
|
||||
await _writer.WriteAsync(_settings.LineSeparator);
|
||||
}
|
||||
|
||||
await foreach (var row in list)
|
||||
{
|
||||
await _writer.WriteAsync(serializer.Serialize(row));
|
||||
await _writer.WriteAsync(_settings.LineSeparator);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Close our resources - specifically, the stream reader
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_writer.Close();
|
||||
_writer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
CSVNET/Properties/AssemblyInfo.cs
Normal file
36
CSVNET/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die einer Assembly zugeordnet sind.
|
||||
[assembly: AssemblyTitle("CSVNET")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("HP Inc.")]
|
||||
[assembly: AssemblyProduct("CSVNET")]
|
||||
[assembly: AssemblyCopyright("Copyright © HP Inc. 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("417a61bc-206d-4895-baae-e6155afbdf2a")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
// indem Sie "*" wie unten gezeigt eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
BIN
CSVNET/bin/Debug/CSVNET.dll
Normal file
BIN
CSVNET/bin/Debug/CSVNET.dll
Normal file
Binary file not shown.
BIN
CSVNET/bin/Debug/CSVNET.pdb
Normal file
BIN
CSVNET/bin/Debug/CSVNET.pdb
Normal file
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
|
||||
BIN
CSVNET/obj/Debug/CSVNET.csproj.AssemblyReference.cache
Normal file
BIN
CSVNET/obj/Debug/CSVNET.csproj.AssemblyReference.cache
Normal file
Binary file not shown.
1
CSVNET/obj/Debug/CSVNET.csproj.CoreCompileInputs.cache
Normal file
1
CSVNET/obj/Debug/CSVNET.csproj.CoreCompileInputs.cache
Normal file
@@ -0,0 +1 @@
|
||||
7618766358e265572e5abcaa4cafd36b0a57b01f36171f2711451a6eafc40e83
|
||||
6
CSVNET/obj/Debug/CSVNET.csproj.FileListAbsolute.txt
Normal file
6
CSVNET/obj/Debug/CSVNET.csproj.FileListAbsolute.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
E:\Software-Projekte\OnDoc\OnDoc\CSVNET\bin\Debug\CSVNET.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\CSVNET\bin\Debug\CSVNET.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\CSVNET\obj\Debug\CSVNET.csproj.AssemblyReference.cache
|
||||
E:\Software-Projekte\OnDoc\OnDoc\CSVNET\obj\Debug\CSVNET.csproj.CoreCompileInputs.cache
|
||||
E:\Software-Projekte\OnDoc\OnDoc\CSVNET\obj\Debug\CSVNET.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\CSVNET\obj\Debug\CSVNET.pdb
|
||||
BIN
CSVNET/obj/Debug/CSVNET.dll
Normal file
BIN
CSVNET/obj/Debug/CSVNET.dll
Normal file
Binary file not shown.
BIN
CSVNET/obj/Debug/CSVNET.pdb
Normal file
BIN
CSVNET/obj/Debug/CSVNET.pdb
Normal file
Binary file not shown.
BIN
CSVNET/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Normal file
BIN
CSVNET/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Normal file
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
|
||||
BIN
CSVNET/obj/Release/CSVNET.csproj.AssemblyReference.cache
Normal file
BIN
CSVNET/obj/Release/CSVNET.csproj.AssemblyReference.cache
Normal file
Binary file not shown.
@@ -263,6 +263,7 @@ namespace OnDoc.Diverses
|
||||
//string tempdir = AppParams.tempdir + "\nativdoks";
|
||||
|
||||
string ext = System.IO.Path.GetExtension(tempfilename);
|
||||
Logging.Logging.Debug("Native-Vorlage erstellen", "OnDoc", tempfilename);
|
||||
if (ext.Length > 2)
|
||||
{
|
||||
ext = ext.Substring(0, 2).ToUpper();
|
||||
|
||||
153
Client/DocMgmt/DokTypSelect.Designer.cs
generated
153
Client/DocMgmt/DokTypSelect.Designer.cs
generated
@@ -49,6 +49,8 @@ namespace OnDoc.DocMgmt
|
||||
this.RibbonButtonVorlagen = new System.Windows.Forms.RibbonButton();
|
||||
this.ribbonPanel4 = new System.Windows.Forms.RibbonPanel();
|
||||
this.RibbonButtonFavoriten = new System.Windows.Forms.RibbonButton();
|
||||
this.ribbonButtonFilter = new System.Windows.Forms.RibbonPanel();
|
||||
this.ribboncomboboxfachverantwortung = new System.Windows.Forms.RibbonComboBox();
|
||||
this.imageListAdv1 = new Syncfusion.Windows.Forms.Tools.ImageListAdv(this.components);
|
||||
this.sfListView1 = new Syncfusion.WinForms.ListView.SfListView();
|
||||
this.treeViewAdv1 = new Syncfusion.Windows.Forms.Tools.TreeViewAdv();
|
||||
@@ -69,14 +71,24 @@ namespace OnDoc.DocMgmt
|
||||
this.tsbtnRename = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.tsbtndelete = new System.Windows.Forms.ToolStripButton();
|
||||
this.ribbonButtonFilter = new System.Windows.Forms.RibbonPanel();
|
||||
this.ribboncomboboxfachverantwortung = new System.Windows.Forms.RibbonComboBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.toolStrip2 = new System.Windows.Forms.ToolStrip();
|
||||
this.toolstriptextboxsearch = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.toolstripCombobox_Fachverantwortung = new System.Windows.Forms.ToolStripComboBox();
|
||||
this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.treeViewAdv1)).BeginInit();
|
||||
this.contextMenuStripVorlagen.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.treeViewAdv2)).BeginInit();
|
||||
this.contextMenuStripFavoriten.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.toolStrip1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.toolStrip2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// ribbon1
|
||||
@@ -137,6 +149,7 @@ namespace OnDoc.DocMgmt
|
||||
this.ribbonPanel2.Items.Add(this.ribbonItemGroup1);
|
||||
this.ribbonPanel2.Name = "ribbonPanel2";
|
||||
this.ribbonPanel2.Text = "Suche";
|
||||
this.ribbonPanel2.Visible = false;
|
||||
//
|
||||
// ribbonItemGroup1
|
||||
//
|
||||
@@ -218,6 +231,19 @@ namespace OnDoc.DocMgmt
|
||||
this.RibbonButtonFavoriten.Text = "";
|
||||
this.RibbonButtonFavoriten.Click += new System.EventHandler(this.RibbonButtonFavoriten_Click);
|
||||
//
|
||||
// ribbonButtonFilter
|
||||
//
|
||||
this.ribbonButtonFilter.Items.Add(this.ribboncomboboxfachverantwortung);
|
||||
this.ribbonButtonFilter.Name = "ribbonButtonFilter";
|
||||
this.ribbonButtonFilter.Text = "Filter Fachverantwortung";
|
||||
this.ribbonButtonFilter.Visible = false;
|
||||
//
|
||||
// ribboncomboboxfachverantwortung
|
||||
//
|
||||
this.ribboncomboboxfachverantwortung.Name = "ribboncomboboxfachverantwortung";
|
||||
this.ribboncomboboxfachverantwortung.SelectedIndex = -1;
|
||||
this.ribboncomboboxfachverantwortung.TextBoxText = "";
|
||||
//
|
||||
// imageListAdv1
|
||||
//
|
||||
this.imageListAdv1.Images.AddRange(new System.Drawing.Image[] {
|
||||
@@ -248,9 +274,9 @@ namespace OnDoc.DocMgmt
|
||||
treeNodeAdvStyleInfo1.TextColor = System.Drawing.Color.Black;
|
||||
this.treeViewAdv1.BaseStylePairs.AddRange(new Syncfusion.Windows.Forms.Tools.StyleNamePair[] {
|
||||
new Syncfusion.Windows.Forms.Tools.StyleNamePair("Standard", treeNodeAdvStyleInfo1)});
|
||||
this.treeViewAdv1.BeforeTouchSize = new System.Drawing.Size(498, 584);
|
||||
this.treeViewAdv1.BeforeTouchSize = new System.Drawing.Size(494, 517);
|
||||
this.treeViewAdv1.ContextMenuStrip = this.contextMenuStripVorlagen;
|
||||
this.treeViewAdv1.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.treeViewAdv1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -261,11 +287,11 @@ namespace OnDoc.DocMgmt
|
||||
this.treeViewAdv1.HelpTextControl.TabIndex = 0;
|
||||
this.treeViewAdv1.HelpTextControl.Visible = true;
|
||||
this.treeViewAdv1.InactiveSelectedNodeForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this.treeViewAdv1.Location = new System.Drawing.Point(2, 76);
|
||||
this.treeViewAdv1.Location = new System.Drawing.Point(3, 64);
|
||||
this.treeViewAdv1.MetroColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220)))));
|
||||
this.treeViewAdv1.Name = "treeViewAdv1";
|
||||
this.treeViewAdv1.SelectedNodeForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
this.treeViewAdv1.Size = new System.Drawing.Size(498, 584);
|
||||
this.treeViewAdv1.Size = new System.Drawing.Size(494, 517);
|
||||
this.treeViewAdv1.TabIndex = 2;
|
||||
this.treeViewAdv1.Text = "treeViewAdv1";
|
||||
this.treeViewAdv1.ThemeStyle.TreeNodeAdvStyle.CheckBoxTickThickness = 0;
|
||||
@@ -314,6 +340,10 @@ namespace OnDoc.DocMgmt
|
||||
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
|
||||
this.imageList1.Images.SetKeyName(0, "Folder.png");
|
||||
this.imageList1.Images.SetKeyName(1, "Dokumenttype.png");
|
||||
this.imageList1.Images.SetKeyName(2, "272708_word_icon.png");
|
||||
this.imageList1.Images.SetKeyName(3, "272703_excel_icon.png");
|
||||
this.imageList1.Images.SetKeyName(4, "272705_pdf_icon.png");
|
||||
this.imageList1.Images.SetKeyName(5, "DocTypeUnKnown.ico");
|
||||
//
|
||||
// treeViewAdv2
|
||||
//
|
||||
@@ -344,6 +374,7 @@ namespace OnDoc.DocMgmt
|
||||
this.treeViewAdv2.MetroColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220)))));
|
||||
this.treeViewAdv2.Name = "treeViewAdv2";
|
||||
this.treeViewAdv2.SelectedNodeForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
this.treeViewAdv2.ShouldSelectNodeOnEnter = false;
|
||||
this.treeViewAdv2.Size = new System.Drawing.Size(498, 523);
|
||||
this.treeViewAdv2.TabIndex = 3;
|
||||
this.treeViewAdv2.Text = "treeViewAdv2";
|
||||
@@ -408,7 +439,7 @@ namespace OnDoc.DocMgmt
|
||||
this.groupBox1.Controls.Add(this.treeViewAdv2);
|
||||
this.groupBox1.Controls.Add(this.toolStrip1);
|
||||
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.groupBox1.Location = new System.Drawing.Point(500, 76);
|
||||
this.groupBox1.Location = new System.Drawing.Point(502, 76);
|
||||
this.groupBox1.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Padding = new System.Windows.Forms.Padding(0);
|
||||
@@ -484,17 +515,94 @@ namespace OnDoc.DocMgmt
|
||||
this.tsbtndelete.Text = "Vorlage / Ordner mit Unterlementen löschen";
|
||||
this.tsbtndelete.Click += new System.EventHandler(this.tsbtndelete_Click);
|
||||
//
|
||||
// ribbonButtonFilter
|
||||
// groupBox2
|
||||
//
|
||||
this.ribbonButtonFilter.Items.Add(this.ribboncomboboxfachverantwortung);
|
||||
this.ribbonButtonFilter.Name = "ribbonButtonFilter";
|
||||
this.ribbonButtonFilter.Text = "Filter Fachverantwortung";
|
||||
this.groupBox2.Controls.Add(this.treeViewAdv1);
|
||||
this.groupBox2.Controls.Add(this.toolStrip2);
|
||||
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.groupBox2.Location = new System.Drawing.Point(2, 76);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(500, 584);
|
||||
this.groupBox2.TabIndex = 5;
|
||||
this.groupBox2.TabStop = false;
|
||||
//
|
||||
// ribboncomboboxfachverantwortung
|
||||
// toolStrip2
|
||||
//
|
||||
this.ribboncomboboxfachverantwortung.Name = "ribboncomboboxfachverantwortung";
|
||||
this.ribboncomboboxfachverantwortung.SelectedIndex = -1;
|
||||
this.ribboncomboboxfachverantwortung.TextBoxText = "";
|
||||
this.toolStrip2.AutoSize = false;
|
||||
this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripLabel1,
|
||||
this.toolstriptextboxsearch,
|
||||
this.toolStripButton1,
|
||||
this.toolStripButton2,
|
||||
this.toolStripSeparator2,
|
||||
this.toolStripLabel2,
|
||||
this.toolstripCombobox_Fachverantwortung,
|
||||
this.toolStripButton4});
|
||||
this.toolStrip2.Location = new System.Drawing.Point(3, 16);
|
||||
this.toolStrip2.Name = "toolStrip2";
|
||||
this.toolStrip2.Size = new System.Drawing.Size(494, 48);
|
||||
this.toolStrip2.TabIndex = 5;
|
||||
this.toolStrip2.Text = "toolStrip2";
|
||||
//
|
||||
// toolstriptextboxsearch
|
||||
//
|
||||
this.toolstriptextboxsearch.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||
this.toolstriptextboxsearch.Name = "toolstriptextboxsearch";
|
||||
this.toolstriptextboxsearch.Size = new System.Drawing.Size(100, 48);
|
||||
this.toolstriptextboxsearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.toolstriptextboxsearch_KeyDown);
|
||||
//
|
||||
// toolStripLabel1
|
||||
//
|
||||
this.toolStripLabel1.Name = "toolStripLabel1";
|
||||
this.toolStripLabel1.Size = new System.Drawing.Size(49, 45);
|
||||
this.toolStripLabel1.Text = "Suchen:";
|
||||
//
|
||||
// toolStripButton1
|
||||
//
|
||||
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.toolStripButton1.Image = global::OnDoc.Properties.Resources.Search_24x24_32;
|
||||
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton1.Name = "toolStripButton1";
|
||||
this.toolStripButton1.Size = new System.Drawing.Size(23, 45);
|
||||
this.toolStripButton1.Text = "toolStripButton1";
|
||||
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
|
||||
//
|
||||
// toolStripButton2
|
||||
//
|
||||
this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.toolStripButton2.Image = global::OnDoc.Properties.Resources.CloseApplication_24x24_32;
|
||||
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton2.Name = "toolStripButton2";
|
||||
this.toolStripButton2.Size = new System.Drawing.Size(23, 45);
|
||||
this.toolStripButton2.Text = "toolStripButton2";
|
||||
this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
|
||||
//
|
||||
// toolStripSeparator2
|
||||
//
|
||||
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 48);
|
||||
//
|
||||
// toolStripLabel2
|
||||
//
|
||||
this.toolStripLabel2.Name = "toolStripLabel2";
|
||||
this.toolStripLabel2.Size = new System.Drawing.Size(110, 45);
|
||||
this.toolStripLabel2.Text = "Fachverantwortung";
|
||||
//
|
||||
// toolstripCombobox_Fachverantwortung
|
||||
//
|
||||
this.toolstripCombobox_Fachverantwortung.Name = "toolstripCombobox_Fachverantwortung";
|
||||
this.toolstripCombobox_Fachverantwortung.Size = new System.Drawing.Size(121, 48);
|
||||
this.toolstripCombobox_Fachverantwortung.SelectedIndexChanged += new System.EventHandler(this.toolstripCombobox_Fachverantwortung_SelectedIndexChanged);
|
||||
//
|
||||
// toolStripButton4
|
||||
//
|
||||
this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.toolStripButton4.Image = global::OnDoc.Properties.Resources.CloseApplication_24x24_32;
|
||||
this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton4.Name = "toolStripButton4";
|
||||
this.toolStripButton4.Size = new System.Drawing.Size(23, 45);
|
||||
this.toolStripButton4.Text = "toolStripButton2";
|
||||
this.toolStripButton4.Click += new System.EventHandler(this.toolStripButton4_Click);
|
||||
//
|
||||
// DokTypSelect
|
||||
//
|
||||
@@ -502,7 +610,7 @@ namespace OnDoc.DocMgmt
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1000, 662);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.treeViewAdv1);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.sfListView1);
|
||||
this.Controls.Add(this.ribbon1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
@@ -520,6 +628,9 @@ namespace OnDoc.DocMgmt
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.toolStrip1.ResumeLayout(false);
|
||||
this.toolStrip1.PerformLayout();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.toolStrip2.ResumeLayout(false);
|
||||
this.toolStrip2.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -562,5 +673,15 @@ namespace OnDoc.DocMgmt
|
||||
private System.Windows.Forms.RibbonButton ribbonButtonClear;
|
||||
private System.Windows.Forms.RibbonPanel ribbonButtonFilter;
|
||||
private System.Windows.Forms.RibbonComboBox ribboncomboboxfachverantwortung;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.ToolStrip toolStrip2;
|
||||
private System.Windows.Forms.ToolStripTextBox toolstriptextboxsearch;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel1;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton1;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton2;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel2;
|
||||
private System.Windows.Forms.ToolStripComboBox toolstripCombobox_Fachverantwortung;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton4;
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ using System.Xml.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
using Microsoft.SqlServer.Server;
|
||||
using System.Collections;
|
||||
using OnDoc.UICintrols;
|
||||
|
||||
namespace OnDoc.DocMgmt
|
||||
{
|
||||
@@ -58,6 +59,7 @@ namespace OnDoc.DocMgmt
|
||||
}
|
||||
else
|
||||
{
|
||||
groupBox2.Visible = false;
|
||||
treeViewAdv1.Visible = false;
|
||||
}
|
||||
|
||||
@@ -74,17 +76,22 @@ namespace OnDoc.DocMgmt
|
||||
this.Style.TitleBar.ForeColor = Theaming.TitelFontColor();
|
||||
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Get_Tabledata("select distinct dbo.get_fachverantwortung(dbo.dokument.dokumenttypnr) from dbo.dokumenttyp", false, true);
|
||||
//foreach (System.Data.DataRow in db.dsdaten.Tables)
|
||||
db.Get_Tabledata("select distinct dbo.get_fachverantwortung(dbo.dokumenttyp.dokumenttypnr) as fv from dbo.dokumenttyp order by dbo.get_fachverantwortung(dbo.dokumenttyp.dokumenttypnr) asc", false, true);
|
||||
foreach (System.Data.DataRow dr in db.dsdaten.Tables[0].Rows)
|
||||
{
|
||||
toolstripCombobox_Fachverantwortung.Items.Add(dr[0].ToString());
|
||||
}
|
||||
|
||||
|
||||
if (this.favoriten) { Load_Favoriten(""); }
|
||||
else { load_standard(""); }
|
||||
toolstriptextboxsearch.Focus();
|
||||
|
||||
}
|
||||
|
||||
TreeNodeAdv[] nodestoexpand = new TreeNodeAdv[50];
|
||||
int nodextoexpandindex = 1;
|
||||
public void load_standard(string filter)
|
||||
public void load_standard(string filter, string filter_fachverantwortung="")
|
||||
{
|
||||
|
||||
Cursor = Cursors.WaitCursor;
|
||||
@@ -94,15 +101,28 @@ namespace OnDoc.DocMgmt
|
||||
}
|
||||
treeViewAdv1.Enabled = false;
|
||||
treeViewAdv1.Visible = false;
|
||||
groupBox2.Visible = false;
|
||||
treeViewAdv1.BeginUpdate();
|
||||
treeViewAdv1.Nodes.Clear();
|
||||
treeViewAdv1.LeftImageList = imageList1;
|
||||
|
||||
|
||||
string where = "";
|
||||
if (filter != "")
|
||||
{
|
||||
where = "and bezeichnung like '%" + filter.Replace(" ", "%") + "%'";
|
||||
}
|
||||
if (toolstripCombobox_Fachverantwortung.Text != "")
|
||||
{
|
||||
if (filter != "")
|
||||
{
|
||||
where = where + " and fachverantwortung='" + toolstripCombobox_Fachverantwortung.Text + "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
where = " and fachverantwortung='" + toolstripCombobox_Fachverantwortung.Text + "'";
|
||||
}
|
||||
}
|
||||
|
||||
if (vorlagentype == 1)
|
||||
{
|
||||
@@ -112,7 +132,7 @@ namespace OnDoc.DocMgmt
|
||||
DataTable vorlagen = new DataTable();
|
||||
DataTable Struktur = new DataTable();
|
||||
DataSet ds = new DataSet();
|
||||
db.Get_Tabledata("Select dokumenttypnr as id, bezeichnung, node, OnBase_Dokumenttyp from View_Dokumenttypen_Relaunch where aktiv=1 " + where + " order by bezeichnung", false, true);
|
||||
db.Get_Tabledata("Select dokumenttypnr as id, bezeichnung, node, OnBase_Dokumenttyp, apptype from View_Dokumenttypen_Relaunch where aktiv=1 " + where + " order by bezeichnung", false, true);
|
||||
vorlagen = db.dsdaten.Tables[0].Copy();
|
||||
db.Get_Tabledata("Select * from Dokumentart_Relaunch order by id", false, true);
|
||||
|
||||
@@ -142,7 +162,7 @@ namespace OnDoc.DocMgmt
|
||||
PopulateTree(dr, root);
|
||||
}
|
||||
}
|
||||
if (filter == "")
|
||||
if (where == "")
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -163,7 +183,7 @@ namespace OnDoc.DocMgmt
|
||||
this.Text = "Dokumentpaket auswählen";
|
||||
if (vorlagentype == 2) { RibbonButtonVorlagen.Checked = true; }
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Get_Tabledata("Select dokumentpaketnr as id, bezeichnung, dokumentartnr as node from edex_dokumentpaket where aktiv=1 " + where + " order by bezeichnung", false, true);
|
||||
db.Get_Tabledata("Select dokumentpaketnr as id, bezeichnung, dokumentartnr as node, 1 as apptype from edex_dokumentpaket where aktiv=1 " + where + " order by bezeichnung", false, true);
|
||||
|
||||
DataTable vorlagen = new DataTable();
|
||||
DataTable Struktur = new DataTable();
|
||||
@@ -208,6 +228,7 @@ namespace OnDoc.DocMgmt
|
||||
treeViewAdv1.EndUpdate();
|
||||
treeViewAdv1.Enabled = true;
|
||||
treeViewAdv1.Visible = true;
|
||||
groupBox2.Visible = true;
|
||||
|
||||
|
||||
if (ExternalCall.struktur != "")
|
||||
@@ -226,7 +247,8 @@ namespace OnDoc.DocMgmt
|
||||
{
|
||||
|
||||
TreeNodeAdv cChild = new TreeNodeAdv(row["bezeichnung"].ToString());
|
||||
cChild.LeftImageIndices = new int[] { 1 };
|
||||
//cChild.LeftImageIndices = new int[] { 1 };
|
||||
cChild.LeftImageIndices = new int[] { Convert.ToInt32(row["apptype"]) };
|
||||
cChild.Tag = Convert.ToInt32(row["id"]) * 1;
|
||||
cChild.TagObject = row;
|
||||
pNode.Nodes.Add(cChild);
|
||||
@@ -335,7 +357,7 @@ namespace OnDoc.DocMgmt
|
||||
}
|
||||
else
|
||||
{
|
||||
cChild.LeftImageIndices = new int[] { 1 };
|
||||
cChild.LeftImageIndices = new int[] { Convert.ToInt32(row["apptype"]) };
|
||||
}
|
||||
|
||||
//Recursively build the tree
|
||||
@@ -463,12 +485,14 @@ namespace OnDoc.DocMgmt
|
||||
if (RibbonButtonVorlagen.Checked == true)
|
||||
{
|
||||
treeViewAdv1.Visible = true;
|
||||
load_standard(RibbonTextSearch.TextBoxText);
|
||||
groupBox2.Visible = true;
|
||||
load_standard(toolstriptextboxsearch.Text);
|
||||
treeViewAdv1_VisibleChanged(sender, e);
|
||||
}
|
||||
else
|
||||
{
|
||||
treeViewAdv1.Visible = false;
|
||||
groupBox2.Visible = false;
|
||||
treeViewAdv1_VisibleChanged(sender, e);
|
||||
}
|
||||
|
||||
@@ -783,5 +807,37 @@ namespace OnDoc.DocMgmt
|
||||
RibbonTextSearch.Text = "";
|
||||
load_standard("");
|
||||
}
|
||||
|
||||
private void toolstriptextboxsearch_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
load_standard(toolstriptextboxsearch.Text);
|
||||
}
|
||||
}
|
||||
|
||||
private void toolStripButton1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (toolstriptextboxsearch.Text.Trim().Length > 0)
|
||||
{
|
||||
load_standard(toolstriptextboxsearch.Text);
|
||||
}
|
||||
}
|
||||
|
||||
private void toolStripButton2_Click(object sender, EventArgs e)
|
||||
{
|
||||
toolstriptextboxsearch.Text = "";
|
||||
load_standard("");
|
||||
}
|
||||
|
||||
private void toolStripButton4_Click(object sender, EventArgs e)
|
||||
{
|
||||
toolstripCombobox_Fachverantwortung.Text = "";
|
||||
}
|
||||
|
||||
private void toolstripCombobox_Fachverantwortung_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
load_standard(toolstriptextboxsearch.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,9 +283,9 @@
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACk
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAYABAAGAAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAi
|
||||
DAAAAk1TRnQBSQFMAgEBBgEAAaABAAGgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
|
||||
@@ -312,15 +312,30 @@
|
||||
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
|
||||
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
|
||||
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
|
||||
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/xMAAf8K8gH/IgAB/wHD
|
||||
DJoBwwH/AgAB8gEHCPIBBwHyIgAB9A16AVkB9AIAAvIIAALyIgAB9A16AVkBwwIAAvIIAALyIgAB9A16
|
||||
AVkBwwIAAvIBAAbvAQAC8iIAAfQNegFZAcMCAALyAQAG7wEAAvIiAAH0DXoBWQHDAgAC8gEABu8BAALy
|
||||
IgAB9A16AVkBwwIAAvIBAAbvAQAC8iIAAfQNegFZAcMCAALyAgAB8AEAAfIC7wEAAvIiAAH0DXoBWQHD
|
||||
AgAC8gIAAe8BAAHyAu8BAALyIgAB9A1ZATgB9AIAAvICAAHvAQAB8gLvAQAC8iIAAcMOOAH2AgAC8gEA
|
||||
A+0B8gLvAQAC8iIAAcMGOAFZBvQB9gMAAvIIAAHxAfMiAAH0BjgBvQoAAvIHAAH0Ae8B/yIAAf8BwwSa
|
||||
Ab0B/woAAfIBBwbyAfEB7wH/NQAB/wfyAfMB/yQAAUIBTQE+BwABPgMAASgDAAFAAwABEAMAAQEBAAEB
|
||||
BQABgBcAA/8BAAL/AcABAwYAAcABAwYAAc8B8wYAAc8B8wYAAcgBEwYAAcgBEwYAAcgBEwYAAcgBEwYA
|
||||
Ac0BEwYAAc0BEwYAAc0BEwYAAcgBEwUAAQEBzwHzBQAB/wHPAeMFAAH/AcABBwQAAv8BwAEPBAAL
|
||||
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/wEAEBcCAAHcChkBCQH0
|
||||
IQAQFwIAAQkKAAH0AfMhAAIXDQABFwIAAQkGAAHWAgkB8QH0AfMhAAIXAQACFwoAARcCAAEJCgAB9AHz
|
||||
IQACFwEAAxcGAAIXAQABFwIAAQkBAAjWAfEB9AHzIQACFwMAAhcEAAEXAQABFgEAARcCAAEJCgAB9AHz
|
||||
IQACFwQAARcBFgYXAQABFwIAAQkBAAgJAfIB9AHzIQACFwUAARcBAAEXBQABFwIAAQkKAAH0AfMhAAIX
|
||||
BQACFwYAARcCAAEJAQAICQHzAfQB8yEAAhcGAAEXBgABFwIAAQkKAAH0AfMhAAIXBQACFwYAARcCAAEJ
|
||||
AQAICQHzAfQB8yEAAhcFAAIXBgABFwIAAQkHAAG8AhkBCQHzIQACFwUAAhcGAAEXAgABCQEABhkECSIA
|
||||
AhcGAAEXBgABFwIAAQkHAAIJAdwjABAXAgABCQcAAQkB3CQAEBcCAAHxCAk3AAH/CvIB/wIAELIQcAH/
|
||||
AcMMmgHDAf8CAAHyAQcI8gEHAfICABCyEHAB9A16AVkB9AIAAvIIAALyAgACsg0AAbICcA0AAXAB9A16
|
||||
AVkBwwIAAvIIAALyAgACsg0AAbICcA0AAXAB9A16AVkBwwIAAvIBAAbvAQAC8gIAArIDAAKyAgABtAKy
|
||||
AwABsgJwAgADcAMAAnADAAFwAfQNegFZAcMCAALyAQAG7wEAAvICAAKyAgAB8gKyAQkBAAOyAwABsgJw
|
||||
AwADcAEAA3ADAAFwAfQNegFZAcMCAALyAQAG7wEAAvICAAKyAgAEsgEAA7IB3QIAAbICcAQABXAEAAFw
|
||||
AfQNegFZAcMCAALyAQAG7wEAAvICAAKyAgACsgG0AbIBGQGyAQACsgIAAbICcAUAA3AFAAFwAfQNegFZ
|
||||
AcMCAALyAgAB8AEAAfIC7wEAAvICAAKyAgABsgEZAQADsgEAArICAAGyAnAFAANwBQABcAH0DXoBWQHD
|
||||
AgAC8gIAAe8BAAHyAu8BAALyAgACsgEAArICAAOyAgABsgHzAQABsgJwBAAFcAQAAXAB9A1ZATgB9AIA
|
||||
AvICAAHvAQAB8gLvAQAC8gIAArIBAAKyAgABCQGyAwACsgEAAbICcAMAA3ABAANwAwABcAHDDjgB9gIA
|
||||
AvIBAAPtAfIC7wEAAvICAAKyDQABsgJwAwACcAMAAnADAAFwAcMGOAFZBvQB9gMAAvIIAAHxAfMCAAKy
|
||||
DQABsgJwDQABcAH0BjgBvQoAAvIHAAH0Ae8B/wIAArINAAGyAnANAAFwAf8BwwSaAb0B/woAAfIBBwby
|
||||
AfEB7wH/AwAQshBwEgAB/wfyAfMB/wQAELIQcAFCAU0BPgcAAT4DAAEoAwABQAMAASADAAEBAQABAQYA
|
||||
AQEWAAP/AwABwAEBBgAB3wH5BAABPwH+Ad8BgQQAAScB/gHfAfkEAAEjAfIB0AEBBAABOQHqAd8B+QQA
|
||||
ATwBAgHQAQEEAAE+Ab4B3wH5BAABPgF+AdABAQQAAT8BfgHfAfkEAAE+AX4B0AEBBAABPgF+Ad8BwQQA
|
||||
AT4BfgHQAQMEAAE/AX4B3wHHBgAB3wHPBgABwAEfBAAC/wHAAQMGAAHAAQMGAAHPAfMBPwH+AT8B/gIA
|
||||
Ac8B8wE/Af4BPwH+AgAByAETATkBjgExAc4CAAHIARMBMAGOATgBjgIAAcgBEwEwAYYBPAEeAgAByAET
|
||||
ATABJgI+AgABzQETATIBJgI+AgABzQETASYBMgE8AR4CAAHNARMBJgFyATgBjgIAAcgBEwE/Af4BOQHO
|
||||
AQABAQHPAfMBPwH+AT8B/gEAAf8BzwHjAT8B/gE/Af4BAAH/AcABBwQAAv8BwAEPBAAL
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="contextMenuStripFavoriten.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
@@ -329,6 +344,9 @@
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>618, 16</value>
|
||||
</metadata>
|
||||
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>723, 16</value>
|
||||
</metadata>
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAUAAAAAAAEAIADIHQAAVgAAADAwAAABACAAqCUAAB4eAAAgIAAAAQAgAKgQAADGQwAAGBgAAAEA
|
||||
|
||||
46
Client/DocMgmt/Dokumenterstellung.Designer.cs
generated
46
Client/DocMgmt/Dokumenterstellung.Designer.cs
generated
@@ -33,7 +33,9 @@
|
||||
this.sfButton3 = new Syncfusion.WinForms.Controls.SfButton();
|
||||
this.btnDokumenterstellen = new Syncfusion.WinForms.Controls.SfButton();
|
||||
this.PnlPreview = new System.Windows.Forms.Panel();
|
||||
this.docPreview1 = new OnDoc.UIControls.DocPreview();
|
||||
this.GrpFnkt = new System.Windows.Forms.GroupBox();
|
||||
this.btnOfficePrint = new System.Windows.Forms.Button();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.ribbonButtonVersandstrasse = new System.Windows.Forms.Button();
|
||||
@@ -46,8 +48,6 @@
|
||||
this.lbledit = new System.Windows.Forms.Label();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.btnOfficePrint = new System.Windows.Forms.Button();
|
||||
this.docPreview1 = new OnDoc.UIControls.DocPreview();
|
||||
this.ucAllgemeineDokumentParam1 = new OnDoc.UIControls.UCAllgemeineDokumentParam();
|
||||
this.PnlPreview.SuspendLayout();
|
||||
this.GrpFnkt.SuspendLayout();
|
||||
@@ -83,6 +83,15 @@
|
||||
this.PnlPreview.TabIndex = 19;
|
||||
this.PnlPreview.Visible = false;
|
||||
//
|
||||
// docPreview1
|
||||
//
|
||||
this.docPreview1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.docPreview1.Location = new System.Drawing.Point(0, 123);
|
||||
this.docPreview1.Name = "docPreview1";
|
||||
this.docPreview1.Size = new System.Drawing.Size(668, 292);
|
||||
this.docPreview1.TabIndex = 1;
|
||||
this.docPreview1.ZoomPercentage = 0;
|
||||
//
|
||||
// GrpFnkt
|
||||
//
|
||||
this.GrpFnkt.BackColor = System.Drawing.Color.SeaShell;
|
||||
@@ -108,6 +117,18 @@
|
||||
this.GrpFnkt.Text = "Funktionen";
|
||||
this.GrpFnkt.Enter += new System.EventHandler(this.GrpFnkt_Enter);
|
||||
//
|
||||
// btnOfficePrint
|
||||
//
|
||||
this.btnOfficePrint.Image = ((System.Drawing.Image)(resources.GetObject("btnOfficePrint.Image")));
|
||||
this.btnOfficePrint.Location = new System.Drawing.Point(419, 19);
|
||||
this.btnOfficePrint.Name = "btnOfficePrint";
|
||||
this.btnOfficePrint.Size = new System.Drawing.Size(74, 79);
|
||||
this.btnOfficePrint.TabIndex = 12;
|
||||
this.btnOfficePrint.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
|
||||
this.btnOfficePrint.UseVisualStyleBackColor = true;
|
||||
this.btnOfficePrint.Visible = false;
|
||||
this.btnOfficePrint.Click += new System.EventHandler(this.btnOfficePrint_Click);
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
@@ -228,26 +249,6 @@
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// btnOfficePrint
|
||||
//
|
||||
this.btnOfficePrint.Image = ((System.Drawing.Image)(resources.GetObject("btnOfficePrint.Image")));
|
||||
this.btnOfficePrint.Location = new System.Drawing.Point(419, 19);
|
||||
this.btnOfficePrint.Name = "btnOfficePrint";
|
||||
this.btnOfficePrint.Size = new System.Drawing.Size(74, 79);
|
||||
this.btnOfficePrint.TabIndex = 12;
|
||||
this.btnOfficePrint.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
|
||||
this.btnOfficePrint.UseVisualStyleBackColor = true;
|
||||
this.btnOfficePrint.Click += new System.EventHandler(this.btnOfficePrint_Click);
|
||||
//
|
||||
// docPreview1
|
||||
//
|
||||
this.docPreview1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.docPreview1.Location = new System.Drawing.Point(0, 123);
|
||||
this.docPreview1.Name = "docPreview1";
|
||||
this.docPreview1.Size = new System.Drawing.Size(668, 292);
|
||||
this.docPreview1.TabIndex = 1;
|
||||
this.docPreview1.ZoomPercentage = 0;
|
||||
//
|
||||
// ucAllgemeineDokumentParam1
|
||||
//
|
||||
this.ucAllgemeineDokumentParam1.ausDokumentpaket = false;
|
||||
@@ -261,6 +262,7 @@
|
||||
clsdocgendata1.dokumenttypnr = null;
|
||||
clsdocgendata1.dokumentwerte = null;
|
||||
clsdocgendata1.ersteller = null;
|
||||
clsdocgendata1.erstelling_in_office = false;
|
||||
clsdocgendata1.erstellungsart = Model.Erstellungsart.DokumentBearbeiten;
|
||||
clsdocgendata1.frormularOhneUnterschrift = false;
|
||||
clsdocgendata1.inhaberadresse = null;
|
||||
|
||||
@@ -1483,17 +1483,14 @@ namespace OnDoc.UIControls
|
||||
onbasedoc.dokumentDatum = db.dsdaten.Tables[0].Rows[0]["DokumentDatum"].ToString();
|
||||
onbasedoc.dokumentTyp = db.dsdaten.Tables[0].Rows[0]["dokumenttyp"].ToString();
|
||||
onbasedoc.dateiTyp = db.dsdaten.Tables[0].Rows[0]["dateityp"].ToString();
|
||||
var Attribute = new List<Model.OnBaseDocUpload.attribute>();
|
||||
|
||||
onbasedoc.attributes = new List<Model.OnBaseDocUpload.attribute>();
|
||||
foreach (System.Data.DataRow rw in db.dsdaten.Tables[1].Rows)
|
||||
|
||||
{
|
||||
var p = new OnBaseDocUpload.attribute()
|
||||
{
|
||||
fieldname = rw["fieldname"].ToString(),
|
||||
fieldvalue = rw["fieldvalue"].ToString()
|
||||
};
|
||||
Attribute.Add(p);
|
||||
OnBaseDocUpload.attribute p = new OnBaseDocUpload.attribute(rw["fieldname"].ToString(), rw["fieldvalue"].ToString());
|
||||
onbasedoc.attributes.Add(p);
|
||||
}
|
||||
onbasedoc.attributes = Attribute;
|
||||
db.Get_Tabledata("Select dbo.BinaryToBase64(dokument) from edex_sb_serienbrief_dokument where serienbriefnr=" + sb.serienbriefnr.ToString() + " and inteintragnr=" + dr["IntEintragNr"].ToString(), false, true);
|
||||
onbasedoc.dokumentDatei = db.dsdaten.Tables[0].Rows[0][0].ToString();
|
||||
string URL = "";
|
||||
|
||||
@@ -593,9 +593,11 @@ namespace OnDoc.UICintrols
|
||||
|
||||
public void dokument_loeschen(string dokumentid)
|
||||
{
|
||||
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Exec_SQL("Delete from dokument where dokumentid='" + dokumentid + "'");
|
||||
db.Exec_SQL("Delete from dokument_trefferliste where dokumentid='" + dokumentid + "'");
|
||||
db.Exec_SQL("Update dokument set aktiv=0, mutiertam=getdate(), mutierer=" + AppParams.CurrentMitarbieter.ToString() + " where dokumentid='" + dokumentid + "'");
|
||||
//db.Exec_SQL("Delete from dokument where dokumentid='" + dokumentid + "'");
|
||||
//db.Exec_SQL("Delete from dokument_trefferliste where dokumentid='" + dokumentid + "'");
|
||||
db = null;
|
||||
Logging.DocLog.Info("Dokument gelöscht", "Doklist.Dokument_loeschen", dokumentid, "", "Dokument gelöscht");
|
||||
}
|
||||
|
||||
@@ -190,6 +190,7 @@
|
||||
this.GrpVerwendung.TabIndex = 23;
|
||||
this.GrpVerwendung.TabStop = false;
|
||||
this.GrpVerwendung.Text = "Dokumentvewendung";
|
||||
this.GrpVerwendung.Visible = false;
|
||||
//
|
||||
// rbasPDF
|
||||
//
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Client/bin/Debug/OFFEDK0082024002454520
Normal file
BIN
Client/bin/Debug/OFFEDK0082024002454520
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user