Exemplo n.º 1
0
        public void WriteMainEventLog(DateTime dtEvent, EventCode e1, EventSubCode e2, string Text, string Value, string LoginUserId)
        {
            if (ConnectionString == null)
            {
                ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["SelfiConnectionString"];
            }
            SqlConnection connection = new SqlConnection(ConnectionString);

            try
            {
                string     queryString = "INSERT Selfi.dbo.MainEventLog ([CreateDate],[Program],[LoginUser],[eventType],[eventSubType],[Text],[Value]) VALUES (@CreateDate,@Program,@LoginUser,@eventType,@eventSubType,@Text,@Value)";
                SqlCommand command     = new SqlCommand(queryString, connection);
                command.Connection.Open();
                command.Parameters.AddWithValue("@CreateDate", dtEvent);
                AddParams(command.Parameters, "@LoginUser", LoginUserId, 50);
                AddParams(command.Parameters, "@Program", ApplicationName, 50);
                command.Parameters.AddWithValue("@eventType", e1);
                command.Parameters.AddWithValue("@eventSubType", e2);
                AddParams(command.Parameters, "@Text", Text, 4000);
                AddParams(command.Parameters, "@Value", Value, 100);
                command.ExecuteNonQuery();
            }
            catch (Exception Ex)
            {
                // Co proboha udelat pokud selze log
            }
            finally
            {
                connection.Close();
            }
        }
Exemplo n.º 2
0
 public void WriteMainEventLog(EventCode e1, EventSubCode e2, string Text)
 {
     WriteMainEventLog(DateTime.Now, e1, e2, Text, "");
 }
Exemplo n.º 3
0
 public CMainEventLog(EventCode eventCode, EventSubCode eventSubCode, string Text, string Value, string sUserId)
     : this()
 {
     WriteMainEventLog(eventCode, eventSubCode, Text, Value, sUserId);
 }
Exemplo n.º 4
0
 public CMainEventLog(EventCode eventCode, EventSubCode eventSubCode, string Text)
     : this()
 {
     WriteMainEventLog(eventCode, eventSubCode, Text);
 }
Exemplo n.º 5
0
 public void WriteMainEventLog(EventCode e1, EventSubCode e2, string Text, string Value, string LoginUserId)
 {
     WriteMainEventLog(DateTime.Now, e1, e2, Text, Value, LoginUserId);
 }