20250112
This commit is contained in:
@@ -21,6 +21,9 @@ using System.Security.Cryptography;
|
||||
using System.Net.Http.Headers;
|
||||
using SecuringWebApiUsingApiKey.Middleware;
|
||||
using DOCGEN.Klassen;
|
||||
using CSVNET;
|
||||
using System.Data;
|
||||
using Helper;
|
||||
|
||||
|
||||
namespace API_NetFramework.Controllers
|
||||
@@ -151,9 +154,51 @@ namespace API_NetFramework.Controllers
|
||||
|
||||
DocGet dg = new DocGet(connectionstring);
|
||||
clsdok dok = new clsdok("", "", "");
|
||||
|
||||
|
||||
|
||||
string[] officeformat = System.Configuration.ConfigurationManager.AppSettings["ArchivierungOfficeFormat"].ToString().Split(',');
|
||||
string[] excelconvert = System.Configuration.ConfigurationManager.AppSettings["ExcelDokType"].ToString().Split(',');
|
||||
string excelvaluefile = System.Configuration.ConfigurationManager.AppSettings["ExcelValueFile"].ToString();
|
||||
if (excelconvert.Contains(doktypnr))
|
||||
{
|
||||
var settings = new CSVSettings()
|
||||
{
|
||||
FieldDelimiter = ';',
|
||||
TextQualifier = '\'',
|
||||
ForceQualifiers = true
|
||||
};
|
||||
DataTable dt = CSVDataTable.FromFile(excelvaluefile, settings);
|
||||
DataTable dt1 = dt.Copy();
|
||||
dt1.Rows.Clear();
|
||||
foreach (System.Data.DataRow dr in dt.Rows)
|
||||
{
|
||||
if (dr[0].ToString() == doktypnr.ToString()) { dt1.ImportRow(dr); }
|
||||
}
|
||||
dt.Dispose();
|
||||
dt1.Columns.Add("value");
|
||||
|
||||
|
||||
Excel_Reader reader = new Excel_Reader();
|
||||
dok = dg.GetDoc(DokumentID);
|
||||
|
||||
DB db1 = new DB(connectionstring);
|
||||
reader.get_valus_from_excel(ref dt1, dok.dokument);
|
||||
foreach (System.Data.DataRow dr in dt1.Rows)
|
||||
{
|
||||
try
|
||||
{
|
||||
db1.clear_parameter();
|
||||
db1.add_parameter("@dokumentid", DokumentID);
|
||||
db1.add_parameter("@vorlagenfeldnr", dr["valuenr"].ToString());
|
||||
db1.add_parameter("@value", dr["bezeichnung"].ToString() + ";" + dr["value"].ToString());
|
||||
db1.Get_Tabledata("dbo.SP_Dokument_Information_Wert", true, false);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
db1 = null;
|
||||
dt = null;
|
||||
reader = null;
|
||||
|
||||
}
|
||||
if (officeformat.Contains(doktypnr) || extension.ToUpper()=="PDF")
|
||||
{
|
||||
dg.GetDoc(DokumentID);
|
||||
|
||||
Reference in New Issue
Block a user