Update Alabus Transfer (Log, Mail)
This commit is contained in:
@@ -16,20 +16,24 @@ using System.Configuration;
|
||||
using Convert = System.Convert;
|
||||
|
||||
|
||||
public class Log
|
||||
namespace AlabusTransfer.Helper
|
||||
{
|
||||
public void insert_entry(int loglevel, int userid, string description)
|
||||
public class Log
|
||||
{
|
||||
clsDB db = new clsDB();
|
||||
if (loglevel <= get_level()) db.insert_log(loglevel, userid, description);
|
||||
}
|
||||
public void insert_entry(int loglevel, int userid, string description)
|
||||
{
|
||||
clsDB db = new clsDB();
|
||||
db.insert_log(1, userid, description);
|
||||
}
|
||||
|
||||
private int get_level()
|
||||
{
|
||||
return Convert.ToInt32(AlabusTransfer.Properties.Settings.Default.LogLevel);
|
||||
private int get_level()
|
||||
{
|
||||
return Convert.ToInt32(AlabusTransfer.Properties.Settings.Default.LogLevel);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
28
AlabusTransfer/Helper/clsMailClient.cs
Normal file
28
AlabusTransfer/Helper/clsMailClient.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net.Mail;
|
||||
using System.Net;
|
||||
|
||||
namespace AlabusTransfer.Helper
|
||||
{
|
||||
internal class clsMailClient
|
||||
{
|
||||
public void CreateTestMessage(string Betreff, string Nachricht)
|
||||
{
|
||||
var smtpClient = new SmtpClient(Properties.Settings.Default.mailserver)
|
||||
{
|
||||
Port = 587,
|
||||
Credentials = new NetworkCredential(Properties.Settings.Default.sender, Properties.Settings.Default.cred),
|
||||
EnableSsl = true,
|
||||
};
|
||||
|
||||
smtpClient.Send(Properties.Settings.Default.sender, Properties.Settings.Default.empfaenger, Betreff, Nachricht);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -699,6 +699,34 @@ public class clsDB
|
||||
}
|
||||
//return 0;
|
||||
}
|
||||
public string get_importstatistik()
|
||||
{
|
||||
SqlConnection myConnection = new SqlConnection(this.Connectionstring);
|
||||
SqlCommand myCommand = new SqlCommand("dbo.sp_import_statistik", myConnection);
|
||||
myCommand.Parameters.Add("@fnkt", SqlDbType.Int, 4);
|
||||
myCommand.Parameters[0].Value = 2;
|
||||
myCommand.CommandType = CommandType.StoredProcedure;
|
||||
myCommand.CommandTimeout = 600;
|
||||
|
||||
SqlDataAdapter da = new SqlDataAdapter(myCommand);
|
||||
dsdaten.Tables.Clear();
|
||||
try
|
||||
{
|
||||
myConnection.Open();
|
||||
da.Fill(dsdaten, "Daten");
|
||||
//myCommand.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (myConnection.State == ConnectionState.Open)
|
||||
myConnection.Close();
|
||||
}
|
||||
return dsdaten.Tables[0].Rows[0][0].ToString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user