public virtual bool SaveSystemConfig(string key, string val, Hashtable result) { if (String.IsNullOrEmpty(key) || String.IsNullOrEmpty(val)) { result["r"] = false; result["d"] = "key或者val为空,保存失败!"; } else { List <KeyValuePair <string, object> > pars = new List <KeyValuePair <string, object> >(); pars.Add(new KeyValuePair <string, object>("[key]", key)); SystemConfig config = SystemConfigDao.Get(pars); if (config == null) { config = new SystemConfig(); config.Key = key; config.Value = val; int i = SystemConfigDao.Insert(config); result["r"] = true; result["d"] = "服务配置保存成功!"; } else { config.Value = val; SystemConfigDao.Update(config); result["r"] = true; result["d"] = "服务配置保存成功!"; } SmartBox.Console.Service.ServiceReference1.ManagerServiceClient ms = new Service.ServiceReference1.ManagerServiceClient(); ms.ResetRuntimeConfigs(); } return((bool)result["r"]); }
public virtual void ResetConfigs() { try { SmartBox.Console.Service.ServiceReference1.ManagerServiceClient ms = new Service.ServiceReference1.ManagerServiceClient(); ms.ResetRuntimeConfigs(); } catch (Exception ex) { Log4NetHelper.Error(ex); } }
public JsonResult SaveDeviceAuthSetting(string enableDeviceAuth) { enableDeviceAuth = Server.UrlEncode(enableDeviceAuth); GlobalParam p = Bo.BoFactory.GetGlobalParamBO.GetGlobalParam("device_need_auth"); if (p == null) { p = new GlobalParam(); p.ConfigKey = "device_need_auth"; } p.ConfigValue = enableDeviceAuth; Bo.BoFactory.GetGlobalParamBO.Save(p); string val = enableDeviceAuth == "1" ? "true" : "false"; Hashtable hr = new Hashtable(); Bo.BoFactory.GetSystemConfigBO.SaveSystemConfig("com.beyondbit.user.auth.apply.enable", val, hr); Service.ServiceReference1.ManagerServiceClient msc = new Service.ServiceReference1.ManagerServiceClient(); msc.ResetRuntimeConfigs(); Hashtable result = new Hashtable(); result["r"] = true; result["d"] = "设备审核设置成功!"; return Json(result); }