update 20241206

This commit is contained in:
Stefan Hutter
2024-12-06 21:38:12 +01:00
parent 9dccb8be8f
commit 8ade484063
187 changed files with 60608 additions and 705 deletions

View File

@@ -16,6 +16,7 @@ using System.Configuration;
using System.Runtime.CompilerServices;
using NLog.LayoutRenderers;
using Helper;
using System.Transactions;
@@ -1820,6 +1821,57 @@ namespace Database
catch { return false; }
}
public Boolean save_edk(string filename, int mitarbeiternr)
{
try
{
SqlConnection Connection = new SqlConnection();
SqlDataAdapter DA = new SqlDataAdapter("select * from edk_log where rowid=-1 ", Connection);
SqlCommandBuilder cb = new SqlCommandBuilder(DA);
DataSet ds = new DataSet();
FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read);
byte[] mydata = new byte[fs.Length];
try
{
fs.Read(mydata, 0, Convert.ToInt32(fs.Length));
fs.Close();
Connection.ConnectionString = connectionstring;
Connection.Open();
DA.Fill(ds, "edk_log");
DataRow myRow;
if (ds.Tables[0].Rows.Count == 0)
{
myRow = ds.Tables[0].NewRow();
myRow[1] = "0";
myRow[2] = mitarbeiternr;
myRow[5] = DateTime.Now;
myRow[6] = mydata;
myRow[7] = filename;
ds.Tables[0].Rows.Add(myRow);
DA.Update(ds, "edk_log");
}
}
catch (Exception ex)
{
return false;
}
finally
{
fs = null;
cb = null;
ds = null;
DA = null;
Connection.Close();
Connection = null;
}
return true;
}
catch (Exception EX)
{
return false;
}
}
}