private static void NewServerSqlData(int ServerId, string ServerName) { var db = DManager.QueryFirstRow("SELECT 1 FROM channels WHERE ServerId = '{0}'", ServerId); if (db.IsNull()) { DManager.Insert("`channels`(ServerId, ServerName, Channel, Password, Language)", ServerId, ServerName, IRCConfig.List[ServerName].MasterChannel, IRCConfig.List[ServerName].MasterChannelPassword, sLManager.Locale); } db = DManager.QueryFirstRow("SELECT 1 FROM schumix WHERE ServerId = '{0}'", ServerId); if (db.IsNull()) { foreach (var function in Enum.GetNames(typeof(IFunctions))) { if (function == IFunctions.Mantisbt.ToString() || function == IFunctions.Wordpress.ToString() || function == IFunctions.Svn.ToString() || function == IFunctions.Git.ToString() || function == IFunctions.Hg.ToString()) { DManager.Insert("`schumix`(ServerId, ServerName, FunctionName, FunctionStatus)", ServerId, ServerName, function.ToLower(), Off); } else { DManager.Insert("`schumix`(ServerId, ServerName, FunctionName, FunctionStatus)", ServerId, ServerName, function.ToLower(), On); } } } }
private static void IsAllSchumixFunction(int ServerId, string ServerName) { foreach (var function in Enum.GetNames(typeof(IFunctions))) { var db = DManager.QueryFirstRow("SELECT 1 FROM schumix WHERE ServerId = '{0}' And FunctionName = '{1}'", ServerId, function.ToLower()); if (db.IsNull()) { if (function == IFunctions.Mantisbt.ToString() || function == IFunctions.Wordpress.ToString() || function == IFunctions.Svn.ToString() || function == IFunctions.Git.ToString() || function == IFunctions.Hg.ToString()) { DManager.Insert("`schumix`(ServerId, ServerName, FunctionName, FunctionStatus)", ServerId, ServerName, function.ToLower(), Off); } else { DManager.Insert("`schumix`(ServerId, ServerName, FunctionName, FunctionStatus)", ServerId, ServerName, function.ToLower(), On); } } } }