protected void btnAdminSave_Click(object sender, EventArgs e)
 {
     try
     {
         OSAEAdmin newadSet = new OSAEAdmin();
         newadSet.ScreenTrust = Convert.ToInt32(screensLev.Text);
         newadSet.defaultScreen = mainScreen.Text;
         newadSet.ObjectsTrust = Convert.ToInt32(objectsLev.Text);
         newadSet.ObjectsAddTrust = Convert.ToInt32(objectsAddLev.Text);
         newadSet.ObjectsUpdateTrust = Convert.ToInt32(objectsUpdateLev.Text);
         newadSet.ObjectsDeleteTrust = Convert.ToInt32(objectsDeleteLev.Text);
         newadSet.AnalyticsTrust = Convert.ToInt32(analyticsLev.Text);
         newadSet.ManagementTrust = Convert.ToInt32(manageLev.Text);
         newadSet.ObjectTypeTrust = Convert.ToInt32(objecttypeLev.Text);
         newadSet.ObjectTypeAddTrust = Convert.ToInt32(objecttypeAddLev.Text);
         newadSet.ObjectTypeUpdateTrust = Convert.ToInt32(objecttypeUpdateLev.Text);
         newadSet.ObjectTypeDeleteTrust = Convert.ToInt32(objecttypeDeleteLev.Text);
         newadSet.ScriptTrust = Convert.ToInt32(scriptLev.Text);
         newadSet.ScriptAddTrust = Convert.ToInt32(scriptAddLev.Text);
         newadSet.ScriptUpdateTrust = Convert.ToInt32(scriptUpdateLev.Text);
         newadSet.ScriptDeleteTrust = Convert.ToInt32(scriptDeleteLev.Text);
         newadSet.ScriptObjectAddTrust = Convert.ToInt32(scriptObjectEventLev.Text);
         newadSet.ScriptObjectTypeAddTrust = Convert.ToInt32(scriptObjectTypeEventLev.Text);
         newadSet.PatternTrust = Convert.ToInt32(patternLev.Text);
         newadSet.PatternAddTrust = Convert.ToInt32(patternAddLev.Text);
         newadSet.PatternUpdateTrust = Convert.ToInt32(patternUpdateLev.Text);
         newadSet.PatternDeleteTrust = Convert.ToInt32(patternDeleteLev.Text);
         newadSet.ReaderTrust = Convert.ToInt32(readerLev.Text);
         newadSet.ReaderAddTrust = Convert.ToInt32(readerAddLev.Text);
         newadSet.ReaderUpdateTrust = Convert.ToInt32(readerUpdateLev.Text);
         newadSet.ReaderDeleteTrust = Convert.ToInt32(readerDeleteLev.Text);
         newadSet.ScheduleTrust = Convert.ToInt32(scheduleLev.Text);
         newadSet.ScheduleAddTrust = Convert.ToInt32(scheduleAddLev.Text);
         newadSet.ScheduleUpdateTrust = Convert.ToInt32(scheduleUpdateLev.Text);
         newadSet.ScheduleDeleteTrust = Convert.ToInt32(scheduleDeleteLev.Text);
         newadSet.ImagesTrust = Convert.ToInt32(imageLev.Text);
         newadSet.ImagesAddTrust = Convert.ToInt32(imageAddLev.Text);
         newadSet.ImagesDeleteTrust = Convert.ToInt32(imageDeleteLev.Text);
         newadSet.LogsTrust = Convert.ToInt32(logsLev.Text);
         newadSet.LogsClearTrust = Convert.ToInt32(logsClearLev.Text);
         newadSet.EventLogTrust = Convert.ToInt32(eventlogLev.Text);
         newadSet.MethodLogTrust = Convert.ToInt32(methodlogLev.Text);
         newadSet.ServerLogTrust = Convert.ToInt32(serverlogLev.Text);
         newadSet.DebugLogTrust = Convert.ToInt32(debuglogLev.Text);
         newadSet.ValuesTrust = Convert.ToInt32(valuesLev.Text);
         newadSet.ConfigTrust = Convert.ToInt32(configLev.Text);
         OSAEAdminManager.UpdateAdminSettings(newadSet);
         saveSuc.Visible = true;
     }
     catch { }
 }
        public static OSAEAdmin GetAdminSettings()
        {
            OSAEAdmin  adSets  = new OSAEAdmin();
            OSAEObject oObject = OSAEObjectManager.GetObjectByName("WEB SERVER");

            adSets.ScreenTrust              = Convert.ToInt32(oObject.Property("Screen Trust").Value);
            adSets.defaultScreen            = Convert.ToString(oObject.Property("Screen Trust").Value);
            adSets.ObjectsTrust             = Convert.ToInt32(oObject.Property("Objects Trust").Value);
            adSets.ObjectsAddTrust          = Convert.ToInt32(oObject.Property("Objects Add Trust").Value);
            adSets.ObjectsUpdateTrust       = Convert.ToInt32(oObject.Property("Objects Update Trust").Value);
            adSets.ObjectsDeleteTrust       = Convert.ToInt32(oObject.Property("Objects Delete Trust").Value);
            adSets.AnalyticsTrust           = Convert.ToInt32(oObject.Property("Analytics Trust").Value);
            adSets.LogsTrust                = Convert.ToInt32(oObject.Property("Logs Trust").Value);
            adSets.LogsClearTrust           = Convert.ToInt32(oObject.Property("Logs Clear Trust").Value);
            adSets.EventLogTrust            = Convert.ToInt32(oObject.Property("Event Log Trust").Value);
            adSets.MethodLogTrust           = Convert.ToInt32(oObject.Property("Method Log Trust").Value);
            adSets.ServerLogTrust           = Convert.ToInt32(oObject.Property("Server Log Trust").Value);
            adSets.DebugLogTrust            = Convert.ToInt32(oObject.Property("Debug Log Trust").Value);
            adSets.ValuesTrust              = Convert.ToInt32(oObject.Property("Values Trust").Value);
            adSets.ManagementTrust          = Convert.ToInt32(oObject.Property("Management Trust").Value);
            adSets.ObjectTypeTrust          = Convert.ToInt32(oObject.Property("ObjectType Trust").Value);
            adSets.ObjectTypeAddTrust       = Convert.ToInt32(oObject.Property("ObjectType Add Trust").Value);
            adSets.ObjectTypeUpdateTrust    = Convert.ToInt32(oObject.Property("ObjectType Update Trust").Value);
            adSets.ObjectTypeDeleteTrust    = Convert.ToInt32(oObject.Property("ObjectType Delete Trust").Value);
            adSets.ScriptTrust              = Convert.ToInt32(oObject.Property("Script Trust").Value);
            adSets.ScriptAddTrust           = Convert.ToInt32(oObject.Property("Script Add Trust").Value);
            adSets.ScriptUpdateTrust        = Convert.ToInt32(oObject.Property("Script Update Trust").Value);
            adSets.ScriptDeleteTrust        = Convert.ToInt32(oObject.Property("Script Delete Trust").Value);
            adSets.ScriptObjectAddTrust     = Convert.ToInt32(oObject.Property("Script Object Add Trust").Value);
            adSets.ScriptObjectTypeAddTrust = Convert.ToInt32(oObject.Property("Script ObjectType Add Trust").Value);
            adSets.PatternTrust             = Convert.ToInt32(oObject.Property("Pattern Trust").Value);
            adSets.PatternAddTrust          = Convert.ToInt32(oObject.Property("Pattern Add Trust").Value);
            adSets.PatternUpdateTrust       = Convert.ToInt32(oObject.Property("Pattern Update Trust").Value);
            adSets.PatternDeleteTrust       = Convert.ToInt32(oObject.Property("Pattern Delete Trust").Value);
            adSets.ReaderTrust              = Convert.ToInt32(oObject.Property("Reader Trust").Value);
            adSets.ReaderAddTrust           = Convert.ToInt32(oObject.Property("Reader Add Trust").Value);
            adSets.ReaderUpdateTrust        = Convert.ToInt32(oObject.Property("Reader Update Trust").Value);
            adSets.ReaderDeleteTrust        = Convert.ToInt32(oObject.Property("Reader Delete Trust").Value);
            adSets.ScheduleTrust            = Convert.ToInt32(oObject.Property("Schedule Trust").Value);
            adSets.ScheduleAddTrust         = Convert.ToInt32(oObject.Property("Schedule Add Trust").Value);
            adSets.ScheduleUpdateTrust      = Convert.ToInt32(oObject.Property("Schedule Update Trust").Value);
            adSets.ScheduleDeleteTrust      = Convert.ToInt32(oObject.Property("Schedule Delete Trust").Value);
            adSets.ImagesTrust              = Convert.ToInt32(oObject.Property("Images Trust").Value);
            adSets.ImagesAddTrust           = Convert.ToInt32(oObject.Property("Images Add Trust").Value);
            adSets.ImagesDeleteTrust        = Convert.ToInt32(oObject.Property("Images Delete Trust").Value);
            adSets.ConfigTrust              = Convert.ToInt32(oObject.Property("Config Trust").Value);
            return(adSets);
        }
 public static void UpdateAdminSettings(OSAEAdmin adSet)
 {
     try
     {
         foreach (var prop in adSet.GetType().GetProperties())
         {
             using (MySqlConnection connection = new MySqlConnection(Common.ConnectionString))
             {
                 MySqlCommand command = new MySqlCommand();
                 command.Connection  = connection;
                 command.CommandText = "UPDATE osae_admin SET Value = '" + prop.GetValue(adSet, null) + "' WHERE ID = '" + prop.Name + "'";
                 connection.Open();
                 int x = command.ExecuteNonQuery();
                 connection.Dispose();
             }
         }
     }
     catch { }
 }
 //public static void UpdateAdminSettingsAll(string ScreenTrust, string ObjectsTrust, string AnalyticsTrust, string LogsTrust, string ValuesTrust, string ConfigTrust, string ManagementTrust, string ObjectTypeTrust, string ScriptTrust, string PatternTrust, string ReaderTrust, string ScheduleTrust, string ImagesTrust, string EventLogTrust, string MethodLogTrust, string ServerLogTrust, string DebugLogTrust, string defaultScreen)
 public static void UpdateAdminSettings(OSAEAdmin adSet)
 {
     try
     {
         foreach (var prop in adSet.GetType().GetProperties())
         {
             using (MySqlConnection connection = new MySqlConnection(Common.ConnectionString))
             {
                 MySqlCommand command = new MySqlCommand();
                 command.Connection = connection;
                 //command.CommandText = "UPDATE osae_admin SET ScreenTrust=" + ScreenTrust + ",ObjectsTrust=" + ObjectsTrust + ",AnalyticsTrust=" + AnalyticsTrust + ",LogsTrust=" + LogsTrust + ",ValuesTrust=" + ValuesTrust + ",ConfigTrust=" + ConfigTrust + ",ManagementTrust=" + ManagementTrust + ",ObjectTypeTrust=" + ObjectTypeTrust + ",ScriptTrust=" + ScriptTrust + ",PatternTrust=" + PatternTrust + ",ReaderTrust=" + ReaderTrust + ",ScheduleTrust=" + ScheduleTrust + ",ImagesTrust=" + ImagesTrust + ",EventLogTrust=" + EventLogTrust + ",MethodLogTrust=" + MethodLogTrust + ",ServerLogTrust=" + ServerLogTrust + ",DebugLogTrust=" + DebugLogTrust + ",defaultScreen='" + defaultScreen + "' WHERE primary_key = 1";
                 command.CommandText = "UPDATE osae_admin SET Value = '" + prop.GetValue(adSet, null) + "' WHERE ID = '" + prop.Name + "'";
                 connection.Open();
                 int x = command.ExecuteNonQuery();
                 connection.Dispose();
             }
         }
     }
     catch { }
 }
 //public static void UpdateAdminSettingsAll(string ScreenTrust, string ObjectsTrust, string AnalyticsTrust, string LogsTrust, string ValuesTrust, string ConfigTrust, string ManagementTrust, string ObjectTypeTrust, string ScriptTrust, string PatternTrust, string ReaderTrust, string ScheduleTrust, string ImagesTrust, string EventLogTrust, string MethodLogTrust, string ServerLogTrust, string DebugLogTrust, string defaultScreen)
 public static void UpdateAdminSettings(OSAEAdmin adSet)
 {
     try
     {
         foreach (var prop in adSet.GetType().GetProperties())
         {
             using (MySqlConnection connection = new MySqlConnection(Common.ConnectionString))
             {
                 MySqlCommand command = new MySqlCommand();
                 command.Connection = connection;
                 //command.CommandText = "UPDATE osae_admin SET ScreenTrust=" + ScreenTrust + ",ObjectsTrust=" + ObjectsTrust + ",AnalyticsTrust=" + AnalyticsTrust + ",LogsTrust=" + LogsTrust + ",ValuesTrust=" + ValuesTrust + ",ConfigTrust=" + ConfigTrust + ",ManagementTrust=" + ManagementTrust + ",ObjectTypeTrust=" + ObjectTypeTrust + ",ScriptTrust=" + ScriptTrust + ",PatternTrust=" + PatternTrust + ",ReaderTrust=" + ReaderTrust + ",ScheduleTrust=" + ScheduleTrust + ",ImagesTrust=" + ImagesTrust + ",EventLogTrust=" + EventLogTrust + ",MethodLogTrust=" + MethodLogTrust + ",ServerLogTrust=" + ServerLogTrust + ",DebugLogTrust=" + DebugLogTrust + ",defaultScreen='" + defaultScreen + "' WHERE primary_key = 1";
                 command.CommandText = "UPDATE osae_admin SET Value = '" + prop.GetValue(adSet, null) + "' WHERE ID = '" + prop.Name + "'";
                 connection.Open();
                 int x = command.ExecuteNonQuery();
                 connection.Dispose();
             }
         }
     }
     catch { }
 }
        public static OSAEAdmin GetAdminSettings()
        {
            OSAEAdmin adSets = new OSAEAdmin();
            OSAE.OSAEObject oObject = OSAE.OSAEObjectManager.GetObjectByName("WEB SERVER");

            adSets.ScreenTrust = Convert.ToInt32(oObject.Property("Screen Trust").Value);
            adSets.defaultScreen = Convert.ToString(oObject.Property("Screen Trust").Value);
            adSets.ObjectsTrust = Convert.ToInt32(oObject.Property("Objects Trust").Value);
            adSets.ObjectsAddTrust = Convert.ToInt32(oObject.Property("Objects Add Trust").Value);
            adSets.ObjectsUpdateTrust = Convert.ToInt32(oObject.Property("Objects Update Trust").Value);
            adSets.ObjectsDeleteTrust = Convert.ToInt32(oObject.Property("Objects Delete Trust").Value);
            adSets.AnalyticsTrust = Convert.ToInt32(oObject.Property("Analytics Trust").Value);
            adSets.LogsTrust = Convert.ToInt32(oObject.Property("Logs Trust").Value);
            adSets.LogsClearTrust = Convert.ToInt32(oObject.Property("Logs Clear Trust").Value);
            adSets.EventLogTrust = Convert.ToInt32(oObject.Property("Event Log Trust").Value);
            adSets.MethodLogTrust = Convert.ToInt32(oObject.Property("Method Log Trust").Value);
            adSets.ServerLogTrust = Convert.ToInt32(oObject.Property("Server Log Trust").Value);
            adSets.DebugLogTrust = Convert.ToInt32(oObject.Property("Debug Log Trust").Value);
            adSets.ValuesTrust = Convert.ToInt32(oObject.Property("Values Trust").Value);
            adSets.ManagementTrust = Convert.ToInt32(oObject.Property("Management Trust").Value);
            adSets.ObjectTypeTrust = Convert.ToInt32(oObject.Property("ObjectType Trust").Value);
            adSets.ObjectTypeAddTrust = Convert.ToInt32(oObject.Property("ObjectType Add Trust").Value);
            adSets.ObjectTypeUpdateTrust = Convert.ToInt32(oObject.Property("ObjectType Update Trust").Value);
            adSets.ObjectTypeDeleteTrust = Convert.ToInt32(oObject.Property("ObjectType Delete Trust").Value);
            adSets.ScriptTrust = Convert.ToInt32(oObject.Property("Script Trust").Value);
            adSets.ScriptAddTrust = Convert.ToInt32(oObject.Property("Script Add Trust").Value);
            adSets.ScriptUpdateTrust = Convert.ToInt32(oObject.Property("Script Update Trust").Value);
            adSets.ScriptDeleteTrust = Convert.ToInt32(oObject.Property("Script Delete Trust").Value);
            adSets.ScriptObjectAddTrust = Convert.ToInt32(oObject.Property("Script Object Add Trust").Value);
            adSets.ScriptObjectTypeAddTrust = Convert.ToInt32(oObject.Property("Script ObjectType Add Trust").Value);
            adSets.PatternTrust = Convert.ToInt32(oObject.Property("Pattern Trust").Value);
            adSets.PatternAddTrust = Convert.ToInt32(oObject.Property("Pattern Add Trust").Value);
            adSets.PatternUpdateTrust = Convert.ToInt32(oObject.Property("Pattern Update Trust").Value);
            adSets.PatternDeleteTrust = Convert.ToInt32(oObject.Property("Pattern Delete Trust").Value);
            adSets.ReaderTrust = Convert.ToInt32(oObject.Property("Reader Trust").Value);
            adSets.ReaderAddTrust = Convert.ToInt32(oObject.Property("Reader Add Trust").Value);
            adSets.ReaderUpdateTrust = Convert.ToInt32(oObject.Property("Reader Update Trust").Value);
            adSets.ReaderDeleteTrust = Convert.ToInt32(oObject.Property("Reader Delete Trust").Value);
            adSets.ScheduleTrust = Convert.ToInt32(oObject.Property("Schedule Trust").Value);
            adSets.ScheduleAddTrust = Convert.ToInt32(oObject.Property("Schedule Add Trust").Value);
            adSets.ScheduleUpdateTrust = Convert.ToInt32(oObject.Property("Schedule Update Trust").Value);
            adSets.ScheduleDeleteTrust = Convert.ToInt32(oObject.Property("Schedule Delete Trust").Value);
            adSets.ImagesTrust = Convert.ToInt32(oObject.Property("Images Trust").Value);
            adSets.ImagesAddTrust = Convert.ToInt32(oObject.Property("Images Add Trust").Value);
            adSets.ImagesDeleteTrust = Convert.ToInt32(oObject.Property("Images Delete Trust").Value);
            adSets.ConfigTrust = Convert.ToInt32(oObject.Property("Config Trust").Value);

            return adSets;

            /*
            try
            {
                using (MySqlCommand command = new MySqlCommand())
                {
                    DataSet dataset = new DataSet();
                    command.CommandText = "SELECT * FROM osae_admin";
                    dataset = OSAESql.RunQuery(command);
                    if (dataset.Tables[0].Rows.Count > 0)
                    {
                        DataTable dt = dataset.Tables[0];
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["ID"].ToString() == "ScreenTrust")
                                adSets.ScreenTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "defaultScreen")
                                adSets.defaultScreen = dr["Value"].ToString();
                            else if (dr["ID"].ToString() == "ObjectsTrust")
                                adSets.ObjectsTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ObjectsAddTrust")
                                adSets.ObjectsAddTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ObjectsUpdateTrust")
                                adSets.ObjectsUpdateTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ObjectsDeleteTrust")
                                adSets.ObjectsDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "AnalyticsTrust")
                                adSets.AnalyticsTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "LogsTrust")
                                adSets.LogsTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "LogsClearTrust")
                                adSets.LogsClearTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "EventLogTrust")
                                adSets.EventLogTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "MethodLogTrust")
                                adSets.MethodLogTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ServerLogTrust")
                                adSets.ServerLogTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "DebugLogTrust")
                                adSets.DebugLogTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ValuesTrust")
                                adSets.ValuesTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ManagementTrust")
                                adSets.ManagementTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ObjectTypeTrust")
                                adSets.ObjectTypeTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ObjectTypeAddTrust")
                                adSets.ObjectTypeAddTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ObjectTypeUpdateTrust")
                                adSets.ObjectTypeUpdateTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ObjectTypeDeleteTrust")
                                adSets.ObjectTypeDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ScriptTrust")
                                adSets.ScriptTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ScriptAddTrust")
                                adSets.ScriptAddTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ScriptUpdateTrust")
                                adSets.ScriptUpdateTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ScriptDeleteTrust")
                                adSets.ScriptDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ScriptObjectAddTrust")
                                adSets.ScriptObjectAddTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ScriptObjectTypeAddTrust")
                                adSets.ScriptObjectTypeAddTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "PatternTrust")
                                adSets.PatternTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "PatternAddTrust")
                                adSets.PatternAddTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "PatternUpdateTrust")
                                adSets.PatternUpdateTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "PatternDeleteTrust")
                                adSets.PatternDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ReaderTrust")
                                adSets.ReaderTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ReaderAddTrust")
                                adSets.ReaderAddTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ReaderUpdateTrust")
                                adSets.ReaderUpdateTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ReaderDeleteTrust")
                                adSets.ReaderDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ScheduleTrust")
                                adSets.ScheduleTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ScheduleAddTrust")
                                adSets.ScheduleAddTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ScheduleUpdateTrust")
                                adSets.ScheduleUpdateTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ScheduleDeleteTrust")
                                adSets.ScheduleDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ImagesTrust")
                                adSets.ImagesTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ImagesAddTrust")
                                adSets.ImagesAddTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ImagesDeleteTrust")
                                adSets.ImagesDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
                            else if (dr["ID"].ToString() == "ConfigTrust")
                                adSets.ConfigTrust = Convert.ToInt32(dr["Value"].ToString());
                        }
                    }
                    return adSets;
                }
            }
            catch { return null; }
            */
        }
        public static OSAEAdmin GetAdminSettings()
        {
            OSAEAdmin adSets = new OSAEAdmin();

            OSAE.OSAEObject oObject = OSAE.OSAEObjectManager.GetObjectByName("WEB SERVER");

            adSets.ScreenTrust              = Convert.ToInt32(oObject.Property("Screen Trust").Value);
            adSets.defaultScreen            = Convert.ToString(oObject.Property("Screen Trust").Value);
            adSets.ObjectsTrust             = Convert.ToInt32(oObject.Property("Objects Trust").Value);
            adSets.ObjectsAddTrust          = Convert.ToInt32(oObject.Property("Objects Add Trust").Value);
            adSets.ObjectsUpdateTrust       = Convert.ToInt32(oObject.Property("Objects Update Trust").Value);
            adSets.ObjectsDeleteTrust       = Convert.ToInt32(oObject.Property("Objects Delete Trust").Value);
            adSets.AnalyticsTrust           = Convert.ToInt32(oObject.Property("Analytics Trust").Value);
            adSets.LogsTrust                = Convert.ToInt32(oObject.Property("Logs Trust").Value);
            adSets.LogsClearTrust           = Convert.ToInt32(oObject.Property("Logs Clear Trust").Value);
            adSets.EventLogTrust            = Convert.ToInt32(oObject.Property("Event Log Trust").Value);
            adSets.MethodLogTrust           = Convert.ToInt32(oObject.Property("Method Log Trust").Value);
            adSets.ServerLogTrust           = Convert.ToInt32(oObject.Property("Server Log Trust").Value);
            adSets.DebugLogTrust            = Convert.ToInt32(oObject.Property("Debug Log Trust").Value);
            adSets.ValuesTrust              = Convert.ToInt32(oObject.Property("Values Trust").Value);
            adSets.ManagementTrust          = Convert.ToInt32(oObject.Property("Management Trust").Value);
            adSets.ObjectTypeTrust          = Convert.ToInt32(oObject.Property("ObjectType Trust").Value);
            adSets.ObjectTypeAddTrust       = Convert.ToInt32(oObject.Property("ObjectType Add Trust").Value);
            adSets.ObjectTypeUpdateTrust    = Convert.ToInt32(oObject.Property("ObjectType Update Trust").Value);
            adSets.ObjectTypeDeleteTrust    = Convert.ToInt32(oObject.Property("ObjectType Delete Trust").Value);
            adSets.ScriptTrust              = Convert.ToInt32(oObject.Property("Script Trust").Value);
            adSets.ScriptAddTrust           = Convert.ToInt32(oObject.Property("Script Add Trust").Value);
            adSets.ScriptUpdateTrust        = Convert.ToInt32(oObject.Property("Script Update Trust").Value);
            adSets.ScriptDeleteTrust        = Convert.ToInt32(oObject.Property("Script Delete Trust").Value);
            adSets.ScriptObjectAddTrust     = Convert.ToInt32(oObject.Property("Script Object Add Trust").Value);
            adSets.ScriptObjectTypeAddTrust = Convert.ToInt32(oObject.Property("Script ObjectType Add Trust").Value);
            adSets.PatternTrust             = Convert.ToInt32(oObject.Property("Pattern Trust").Value);
            adSets.PatternAddTrust          = Convert.ToInt32(oObject.Property("Pattern Add Trust").Value);
            adSets.PatternUpdateTrust       = Convert.ToInt32(oObject.Property("Pattern Update Trust").Value);
            adSets.PatternDeleteTrust       = Convert.ToInt32(oObject.Property("Pattern Delete Trust").Value);
            adSets.ReaderTrust              = Convert.ToInt32(oObject.Property("Reader Trust").Value);
            adSets.ReaderAddTrust           = Convert.ToInt32(oObject.Property("Reader Add Trust").Value);
            adSets.ReaderUpdateTrust        = Convert.ToInt32(oObject.Property("Reader Update Trust").Value);
            adSets.ReaderDeleteTrust        = Convert.ToInt32(oObject.Property("Reader Delete Trust").Value);
            adSets.ScheduleTrust            = Convert.ToInt32(oObject.Property("Schedule Trust").Value);
            adSets.ScheduleAddTrust         = Convert.ToInt32(oObject.Property("Schedule Add Trust").Value);
            adSets.ScheduleUpdateTrust      = Convert.ToInt32(oObject.Property("Schedule Update Trust").Value);
            adSets.ScheduleDeleteTrust      = Convert.ToInt32(oObject.Property("Schedule Delete Trust").Value);
            adSets.ImagesTrust              = Convert.ToInt32(oObject.Property("Images Trust").Value);
            adSets.ImagesAddTrust           = Convert.ToInt32(oObject.Property("Images Add Trust").Value);
            adSets.ImagesDeleteTrust        = Convert.ToInt32(oObject.Property("Images Delete Trust").Value);
            adSets.ConfigTrust              = Convert.ToInt32(oObject.Property("Config Trust").Value);

            return(adSets);

            /*
             * try
             * {
             *  using (MySqlCommand command = new MySqlCommand())
             *  {
             *      DataSet dataset = new DataSet();
             *      command.CommandText = "SELECT * FROM osae_admin";
             *      dataset = OSAESql.RunQuery(command);
             *      if (dataset.Tables[0].Rows.Count > 0)
             *      {
             *          DataTable dt = dataset.Tables[0];
             *          foreach (DataRow dr in dt.Rows)
             *          {
             *              if (dr["ID"].ToString() == "ScreenTrust")
             *                  adSets.ScreenTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "defaultScreen")
             *                  adSets.defaultScreen = dr["Value"].ToString();
             *              else if (dr["ID"].ToString() == "ObjectsTrust")
             *                  adSets.ObjectsTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ObjectsAddTrust")
             *                  adSets.ObjectsAddTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ObjectsUpdateTrust")
             *                  adSets.ObjectsUpdateTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ObjectsDeleteTrust")
             *                  adSets.ObjectsDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "AnalyticsTrust")
             *                  adSets.AnalyticsTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "LogsTrust")
             *                  adSets.LogsTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "LogsClearTrust")
             *                  adSets.LogsClearTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "EventLogTrust")
             *                  adSets.EventLogTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "MethodLogTrust")
             *                  adSets.MethodLogTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ServerLogTrust")
             *                  adSets.ServerLogTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "DebugLogTrust")
             *                  adSets.DebugLogTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ValuesTrust")
             *                  adSets.ValuesTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ManagementTrust")
             *                  adSets.ManagementTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ObjectTypeTrust")
             *                  adSets.ObjectTypeTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ObjectTypeAddTrust")
             *                  adSets.ObjectTypeAddTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ObjectTypeUpdateTrust")
             *                  adSets.ObjectTypeUpdateTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ObjectTypeDeleteTrust")
             *                  adSets.ObjectTypeDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ScriptTrust")
             *                  adSets.ScriptTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ScriptAddTrust")
             *                  adSets.ScriptAddTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ScriptUpdateTrust")
             *                  adSets.ScriptUpdateTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ScriptDeleteTrust")
             *                  adSets.ScriptDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ScriptObjectAddTrust")
             *                  adSets.ScriptObjectAddTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ScriptObjectTypeAddTrust")
             *                  adSets.ScriptObjectTypeAddTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "PatternTrust")
             *                  adSets.PatternTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "PatternAddTrust")
             *                  adSets.PatternAddTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "PatternUpdateTrust")
             *                  adSets.PatternUpdateTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "PatternDeleteTrust")
             *                  adSets.PatternDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ReaderTrust")
             *                  adSets.ReaderTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ReaderAddTrust")
             *                  adSets.ReaderAddTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ReaderUpdateTrust")
             *                  adSets.ReaderUpdateTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ReaderDeleteTrust")
             *                  adSets.ReaderDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ScheduleTrust")
             *                  adSets.ScheduleTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ScheduleAddTrust")
             *                  adSets.ScheduleAddTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ScheduleUpdateTrust")
             *                  adSets.ScheduleUpdateTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ScheduleDeleteTrust")
             *                  adSets.ScheduleDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ImagesTrust")
             *                  adSets.ImagesTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ImagesAddTrust")
             *                  adSets.ImagesAddTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ImagesDeleteTrust")
             *                  adSets.ImagesDeleteTrust = Convert.ToInt32(dr["Value"].ToString());
             *              else if (dr["ID"].ToString() == "ConfigTrust")
             *                  adSets.ConfigTrust = Convert.ToInt32(dr["Value"].ToString());
             *          }
             *      }
             *      return adSets;
             *  }
             * }
             * catch { return null; }
             */
        }