示例#1
0
        private void GetYdModelsSendCmd(DataTable dtSource)
        {
            foreach (DataRow dr in dtSource.Rows)
            {
                CommandVModel cmd = ModelHandler <CommandVModel> .FillModel(dr);

                ListenVModel vm = new ListenVModel();
                vm.cfun    = ListenCFun.cmd.ToString();
                vm.content = JsonHelper.Serialize(cmd);
                CacheMgr.BeginSend(vm);
            }
        }
示例#2
0
        /// <summary>
        /// 设置邮件接口信息
        /// </summary>
        /// <param name="MailFrom">邮件发送人</param>
        /// <param name="MailSmtpHost">邮件服务器地址</param>
        /// <param name="MailSmtpPassword">邮件登陆密码</param>
        /// <param name="MailSmtpUser">邮件登陆名</param>
        /// <returns></returns>
        public APIRst SetMailConfig(string MailFrom, string MailSmtpHost, string MailSmtpPassword, string MailSmtpUser)
        {
            APIRst rst = new APIRst();

            try
            {
                if (string.IsNullOrEmpty(MailFrom))
                {
                    throw new Exception(" 邮件发送人不能为空");
                }
                if (string.IsNullOrEmpty(MailSmtpHost))
                {
                    throw new Exception(" 邮件服务器地址不能为空");
                }
                if (string.IsNullOrEmpty(MailSmtpPassword))
                {
                    throw new Exception(" 邮件登陆密码不能为空");
                }
                if (string.IsNullOrEmpty(MailSmtpUser))
                {
                    throw new Exception(" 邮件登陆名不能为空");
                }

                rst.data = bll.SetMailConfig(MailFrom, MailSmtpHost, MailSmtpPassword, MailSmtpUser);

                WebConfig.GetSysConfig();
                ListenVModel vm = new ListenVModel();
                vm.cfun    = ListenCFun.config.ToString();
                vm.content = "";
                CacheMgr.BeginSend(vm);
            }
            catch (Exception ex)
            {
                rst.rst      = false;
                rst.err.code = (int)ResultCodeDefine.Error;
                rst.err.msg  = ex.Message;
                FileLog.WriteLog("系统配置-短信接口信息错误(SetAlarmCfg):" + ex.Message + ex.StackTrace);
            }
            return(rst);
        }