Example #1
0
        private void WelcomeForm_Load(object sender, EventArgs e)
        {
            DbUtil  dbUtil = new DbUtil();
            DataRow dr     = dbUtil.ExecuteRow("select * from config where id = '1'");

            sysConfig = new Dictionary <string, string>();
            sysConfig.Add("systemName", dr["systemName"].ToString());
            sysConfig.Add("Copyright", dr["Copyright"].ToString());
            sysConfig.Add("pay_time_out", dr["pay_time_out"].ToString());
            sysConfig.Add("pay_poll_time", dr["pay_poll_time"].ToString());
            sysConfig.Add("MainFormTimeOut", dr["MainFormTimeOut"].ToString());
            sysConfig.Add("PaySuccessTimeOut", dr["PaySuccessTimeOut"].ToString());
            sysConfig.Add("MaxPay", dr["MaxPay"].ToString());
            sysConfig.Add("contactNumber", dr["contactNumber"].ToString());
            sysConfig.Add("workingHours", dr["workingHours"].ToString());


            this.label2.Text = dr["systemName"].ToString();
            this.label3.Text = $"Copyright@{dr["Copyright"].ToString()}";
            this.label6.Text = $"退款失败,后台程序会继续尝试退款操作,如24小时内还未收到退款提醒,请在上班{dr["workingHours"].ToString()}时间内,拨打电话:{dr["contactNumber"].ToString()}";
            bool refund_failed_task_off = bool.Parse(ConfigAppSettings.GetValue("refund_failed_task_off"));

            if (!refund_failed_task_off)
            {
                this.timer1.Enabled = true;
                this.timer1.Start();
            }
        }
        public ClientSideContentBaseProvider()
        {
            MasterDynamicPath = "/static";

            StaticsAreExternal = true;
            Settings           = new ConfigAppSettings();
        }
Example #3
0
        /// <summary>
        /// 向智能主机发送音响语音内容,异步返回答案为null
        /// </summary>
        /// <param name="body"></param>
        /// <returns></returns>
        public static NlpAnswers SendMsg(SoundBodyRequest body)
        {
            log.Info($"音响{body.sessionId}向智能家居smarthome发送问题:{body.questions}");
            string user    = "******";
            string sendstr = "";

            if (!string.IsNullOrEmpty(body.deviceId))
            {
                //读取配置文件中音响对应的主机
                user = ConfigAppSettings.GetValue(body.deviceId);//wali_Server
                log.Info($"音响{body.deviceId}对应的主机为:{user}");
            }
            else
            {
                log.Info($"音响{body.deviceId}对应的主机不存在,请配置。");
            }

            try
            {
                ///这里要判断,数据类型了
                if (body.sourceId == "mengdou")
                {
                    String temp = body.req.ToString();
                    if (temp.IndexOf("service\":\"musicX") > -1)
                    {
                        sendstr = body.sessionId + "_" + body.deviceId + ";5;517;" + EncryptionHelp.Encryption("music@" + body.req, false) + "$/r$" + "\r\n";
                    }
                    else
                    if (temp.IndexOf("service\":\"news") > -1)
                    {
                        sendstr = body.sessionId + "_" + body.deviceId + ";5;517;" + EncryptionHelp.Encryption("news@" + body.req, false) + "$/r$" + "\r\n";
                    }
                    else
                    if (temp.IndexOf("service\":\"story") > -1)
                    {
                        sendstr = body.sessionId + "_" + body.deviceId + ";5;517;" + EncryptionHelp.Encryption("story@" + body.req, false) + "$/r$" + "\r\n";
                    }
                    else
                    if (temp.IndexOf("service\":\"joke") > -1)
                    {
                        sendstr = body.sessionId + "_" + body.deviceId + ";5;517;" + EncryptionHelp.Encryption("joke@" + body.req, false) + "$/r$" + "\r\n";
                    }
                    else
                    {
                        sendstr = body.sessionId + "_" + body.deviceId + ";5;513;" + EncryptionHelp.Encryption(body.questions, false) + "$/r$" + "\r\n";
                    }
                }
                else
                {
                    //sessionid_deviceId;5;513;base64不zip(打开窗帘)$/r$
                    sendstr = body.sessionId + "_" + body.deviceId + ";5;513;" + EncryptionHelp.Encryption(body.questions, false) + "$/r$" + "\r\n";
                }
                SmartHomeServer.SendMsg(user, sendstr);
                log.Info($"智能家居给{user}发送数据:{sendstr}完毕");
            }
            catch
            {};
            return(null);
        }
Example #4
0
        public ConfigManagerCore(IConfigPersistor defaultPersistor)
        {
            m_environment      = ObjectFactory.GetInstance <IEnvironment>();
            m_persistor        = defaultPersistor ?? ObjectFactory.GetInstance <IConfigPersistor>();
            m_assemblyResolver = VBinManager.Resolver;

            m_appSettings = new ConfigAppSettings(this);
        }
Example #5
0
        private void InitSettings()
        {
            if (!settingsInitialized)
            {
                Settings = new ConfigAppSettings();

                cfg_DigestExceptions = Settings["ClientAwareController.DigestExceptions"];
                cfg_RevealExceptions = Settings["ClientAwareController.RevealExceptions"];

                settingsInitialized = true;
            }
        }
Example #6
0
 public AccountController(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     IModelDataService modelDataSvc,
     ILoggerFactory loggerFactory,
     IUserDataService usrDataSvc,
     IOptions <ConfigAppSettings> configAppSettings)
 {
     _userManager       = userManager;
     _signInManager     = signInManager;
     _modelDataSvc      = modelDataSvc;
     _usrDataSvc        = usrDataSvc;
     _configAppSettings = configAppSettings.Value;
     _logger            = loggerFactory.CreateLogger <AccountController>();
 }
Example #7
0
 private static void getConfig()
 {
     if (api_domain == null)
     {
         api_domain = ConfigAppSettings.GetValue("ApiDomain");
     }
     if (AppId == null)
     {
         AppId = ConfigAppSettings.GetValue("AppId");
     }
     if (SubAppId == null)
     {
         SubAppId = ConfigAppSettings.GetValue("SubAppId");
     }
     if (PrivateKey == null)
     {
         PrivateKey = ConfigAppSettings.GetValue("PrivateKey");
     }
     if (StoreId == null)
     {
         StoreId = ConfigAppSettings.GetValue("StoreId");
     }
     if (SignType == null)
     {
         SignType = ConfigAppSettings.GetValue("SignType");
     }
     if (Format == null)
     {
         Format = ConfigAppSettings.GetValue("Format");
     }
     if (Version == null)
     {
         Version = ConfigAppSettings.GetValue("Version");
     }
     if (notify_url == null)
     {
         notify_url = ConfigAppSettings.GetValue("notify_url");
     }
 }
Example #8
0
 public static void LogAppSettings()
 {
     _this.Log().Info("All AppSettings:");
     LogKeyValuePairCollection(ConfigAppSettings.AsEnumerable());
 }
 public InsertOrUpdateAppSettingsAction(ConfigAppSettings configAppSettings)
 {
     _configAppSettings = configAppSettings;
 }
Example #10
0
        // Token: 0x06000506 RID: 1286 RVA: 0x00051B60 File Offset: 0x0004FD60
        public DbUtil()
        {
            string datasource = ConfigAppSettings.GetValue("cnstr");

            this.init(datasource);
        }
Example #11
0
        public string sendvoice(SoundBodyRequest body)
        {
            log.Info("智能家居smarthome:::::::" + body.questions);
            string user    = "******";
            string sendstr = "";

            if (!string.IsNullOrEmpty(body.deviceId))
            {
                user = ConfigAppSettings.GetValue(body.deviceId);//wali_Server
            }
            else
            {
                return("");
            }
            bool sok = false;

            //群发广播
            if (user.IndexOf("%") > 0)
            {
                user = user.Replace("%", "");
                foreach (var us in ls)
                {
                    if (us.user.IndexOf(user) > -1)
                    {
                        try
                        {
                            //sendstr = requestInfo.Body.Split(' ')[2].Substring(4, requestInfo.Body.Split(' ')[2].Length - 4);
                            sendstr = "connect user:"******" type:other msg:" + "12345678_Ying" + ";5;513;5omT5byA56qX5biY" + "$/r$" + "\r\n";
                            us.sesson.Send(sendstr);
                        }
                        catch
                        {
                        };
                        sok = true;
                    }
                }
            }
            else
            {
                user = "******";
                foreach (var us in ls)
                {
                    if (us.user == user)
                    {
                        try
                        {
                            //Task.Run(() =>
                            //{
                            log.Info("多线程发送数据user是:" + user);
                            sendstr = body.sessionId + "_" + body.deviceId + ";5;513;" + EncryptionHelp.Encryption(body.questions, true) + "$/r$" + "\r\n";
                            us.sesson.Send(sendstr);
                            log.Info("给user发送数据完毕" + body.sessionId);
                            //});
                        }
                        catch
                        {
                        };
                        sok = true;
                        break;
                    }
                }
            }

            if (!sok)
            {
                //requestInfo.Body.Split(' ')[2].Split(':')[1].Split(';')[0]
                return("server noactive");
            }

            log.Info("智能家居smarthome完毕:::::::" + body.sessionId);
            return("sendok");
        }