Update 20240909
This commit is contained in:
@@ -228,6 +228,31 @@ namespace Database
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
public int Get_Teamnr(string mitarbeiternr)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (mitarbeiternr == "")
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Get_Tabledata("Select team from profil where standard=1 and aktiv=1 and mitarbeiternr=" + mitarbeiternr + "", false, true);
|
||||
if (dsdaten.Tables[0].Rows.Count < 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Convert.ToInt32(dsdaten.Tables[0].Rows[0]["team"].ToString());
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
public DataTable Get_Vorlage_By_DokumentID(string dokumentid)
|
||||
{
|
||||
@@ -684,7 +709,7 @@ namespace Database
|
||||
|
||||
|
||||
}
|
||||
public bool Save_To_DB(string sDokumentID, string sDokumentName)
|
||||
public bool Save_To_DB(string sDokumentID, string sDokumentName, string base64document = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -694,12 +719,22 @@ namespace Database
|
||||
SqlDataAdapter DA = new SqlDataAdapter("select * from doks where dokumentid='" + DokumentID + "'", Connection);
|
||||
SqlCommandBuilder cb = new SqlCommandBuilder(DA);
|
||||
DataSet ds = new DataSet();
|
||||
FileStream fs = new FileStream(Dokumentname, FileMode.Open, FileAccess.Read);
|
||||
byte[] mydata = new byte[fs.Length];
|
||||
try
|
||||
byte [] mydata = null;
|
||||
if (base64document == "")
|
||||
{
|
||||
FileStream fs = new FileStream(Dokumentname, FileMode.Open, FileAccess.Read);
|
||||
mydata = new byte[fs.Length];
|
||||
fs.Read(mydata, 0, Convert.ToInt32(fs.Length));
|
||||
fs.Close();
|
||||
fs = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
mydata = System.Convert.FromBase64String(base64document);
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
Connection.ConnectionString = connectionstring;
|
||||
Connection.Open();
|
||||
DA.Fill(ds, "docs");
|
||||
@@ -725,7 +760,7 @@ namespace Database
|
||||
}
|
||||
finally
|
||||
{
|
||||
fs = null;
|
||||
//fs = null;
|
||||
cb = null;
|
||||
ds = null;
|
||||
DA = null;
|
||||
@@ -1003,5 +1038,5 @@ namespace Database
|
||||
Update_Data();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user