public string SetGlobalAlarmConfig(string loginIdentifer, string UseAlarm, string UseVoice, string AutoPopup) { JavaScriptObject obj2 = new JavaScriptObject(); obj2.Add("Result", false); obj2.Add("Message", ""); LoginUser loginUser = GlobalAppModule.GetLoginUser(loginIdentifer); if (loginUser == null) { obj2["Message"] = "未登录"; return(JavaScriptConvert.SerializeObject(obj2)); } if (loginUser.LoginTimeout) { obj2["Message"] = "登录超时"; return(JavaScriptConvert.SerializeObject(obj2)); } loginUser.LastOperateTime = DateTime.Now; CommonUtil.WaitMainLibInit(); try { bool blUseAlarm = UseAlarm.ToLower() == "true"; bool blUseVoice = UseVoice.ToLower() == "true"; bool blAutoPopup = AutoPopup.ToLower() == "true"; GlobalAlarmModule.SetGlobalAlarmConfig(loginUser.UserId.ToString(), blUseAlarm, blUseVoice, blAutoPopup); obj2["Result"] = true; } catch (Exception exception) { obj2["Message"] = exception.Message; } return(JavaScriptConvert.SerializeObject(obj2)); }
public string GetGlobalAlarmConfig(string loginIdentifer) { JavaScriptObject obj2 = new JavaScriptObject(); JavaScriptObject obj3 = new JavaScriptObject(); obj2.Add("Result", false); obj2.Add("Message", ""); obj2.Add("AlarmConfig", obj3); LoginUser loginUser = GlobalAppModule.GetLoginUser(loginIdentifer); if (loginUser == null) { obj2["Message"] = "未登录"; return(JavaScriptConvert.SerializeObject(obj2)); } if (loginUser.LoginTimeout) { obj2["Message"] = "登录超时"; return(JavaScriptConvert.SerializeObject(obj2)); } loginUser.LastOperateTime = DateTime.Now; CommonUtil.WaitMainLibInit(); GlobalAlarmConfig globalAlarmConfigByUserId = GlobalAlarmModule.GetGlobalAlarmConfigByUserId(loginUser.UserId.ToString()); obj2["Result"] = true; obj3.Add("UseAlarm", globalAlarmConfigByUserId.UseAlarm.ToString()); obj3.Add("UseVoice", globalAlarmConfigByUserId.UseVoice.ToString()); obj3.Add("AutoPopup", globalAlarmConfigByUserId.AutoPopup.ToString()); return(JavaScriptConvert.SerializeObject(obj2)); }