Exemplo n.º 1
0
 /// <summary>
 /// Deletes everything from the event_log table
 /// </summary>
 public static void EventLogClear()
 {
     using (MySqlCommand command = new MySqlCommand())
     {
         command.CommandText = "CALL osae_sp_event_log_clear";
         try
         {
             OSAESql.RunQuery(command);
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
 }
Exemplo n.º 2
0
 public static DataSet LoadSources()
 {
     using (MySqlCommand command = new MySqlCommand())
     {
         command.CommandText = "SELECT DISTINCT Logger FROM osae_log";
         try
         {
             return(OSAESql.RunQuery(command));
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
 }
Exemplo n.º 3
0
 public static DataSet Load(bool info, bool debug, bool error, string source)
 {
     using (MySqlCommand command = new MySqlCommand())
     {
         command.CommandText = "CALL osae_sp_server_log_get (@pinfo, @pdebug, @perror, @psource)";
         command.Parameters.AddWithValue("@pinfo", info);
         command.Parameters.AddWithValue("@pdebug", debug);
         command.Parameters.AddWithValue("@perror", error);
         command.Parameters.AddWithValue("@psource", source);
         try
         { return(OSAESql.RunQuery(command)); }
         catch (Exception ex)
         { throw ex; }
     }
 }
Exemplo n.º 4
0
 public void DebugLogAdd(string entry)
 {
     try
     {
         using (MySqlCommand command = new MySqlCommand())
         {
             command.CommandText = "CALL osae_sp_debug_log_add (@Entry,@Process)";
             command.Parameters.AddWithValue("@Entry", entry);
             command.Parameters.AddWithValue("@Process", logSource.ToString());
             OSAESql.RunQuery(command);
         }
     }
     catch
     {
         // Not a lot we can do if it fails here
     }
 }
        public OSAEObjectCollection GetAllObjects()
        {
            MySqlCommand command = new MySqlCommand("SELECT object_name, object_description, object_type_description, container_name, state_label, last_updated, address, enabled, time_in_state, base_type FROM osae_v_object");
            DataSet      ds      = OSAESql.RunQuery(command);

            OSAEObjectCollection objs = new OSAEObjectCollection();
            OSAEObject           obj;

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                obj                   = new OSAEObject(dr["object_name"].ToString(), dr["object_description"].ToString(), dr["object_type_description"].ToString(), dr["address"].ToString(), dr["container_name"].ToString(), Int32.Parse(dr["enabled"].ToString()));
                obj.LastUpd           = dr["last_updated"].ToString();
                obj.State.Value       = dr["state_label"].ToString();
                obj.State.TimeInState = long.Parse(dr["time_in_state"].ToString());
                obj.BaseType          = dr["base_type"].ToString();
                objs.Add(obj);
            }
            return(objs);
        }
        public DataSet ExecuteSQL(string sql)
        {
            MySqlCommand command = new MySqlCommand(sql);

            return(OSAESql.RunQuery(command));
        }