public static int AddService(ServiceInfo service)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin
                | DemandAccount.IsActive);
            if (accountCheck < 0) return accountCheck;

            TaskManager.StartTask("SERVER", "ADD_SERVICE");
            TaskManager.ItemId = service.ServerId;
            TaskManager.ItemName = GetServerByIdInternal(service.ServerId).ServerName;
            TaskManager.WriteParameter("Service name", service.ServiceName);
            TaskManager.WriteParameter("Provider", service.ProviderId);

            int serviceId = DataProvider.AddService(service.ServerId, service.ProviderId, service.ServiceName,
                service.ServiceQuotaValue, service.ClusterId, service.Comments);

            // read service default settings
            try
            {
                // load original settings
                StringDictionary origSettings = GetServiceSettingsAdmin(serviceId);

                // load provider settings
                ServiceProvider svc = new ServiceProvider();
                ServiceProviderProxy.Init(svc, serviceId);

                SettingPair[] settings = svc.GetProviderDefaultSettings();

                if (settings != null && settings.Length > 0)
                {
                    // merge settings
                    foreach (SettingPair pair in settings)
                        origSettings[pair.Name] = pair.Value;

                    // update settings in the meta base
                    string[] bareSettings = new string[origSettings.Count];
                    int i = 0;
                    foreach (string key in origSettings.Keys)
                        bareSettings[i++] = key + "=" + origSettings[key];

                    UpdateServiceSettings(serviceId, bareSettings);
                }
            }
            catch (Exception ex)
            {
                TaskManager.WriteError(ex, "Error reading default provider settings");
            }

            TaskManager.CompleteTask();

            return serviceId;
        }