Exemple #1
0
        /// <summary>
        /// 设置规则信息
        /// </summary>
        /// <param name="noRuleInfo"></param>
        /// <param name="departmentId"></param>
        public void SetNoRuleInfo(JNoRuleInfo noRuleInfo, string departmentId)
        {
            ParameterData parData = new ParameterData();

            parData.参数ID = SqlHelper.GetCmpUID();
            parData.参数名称 = NoRuleModel.NoRuleParName;
            parData.参数标记 = departmentId;


            parData.参数取值 = noRuleInfo.ToString();

            _pm.WriteParameter(parData);
        }
Exemple #2
0
        public ParameterData ReadParameter(string parName, string parTag)
        {
            SQL sql = CreateSQL("读取参数配置", "select 参数ID,参数名称,参数标记,参数取值 from 影像参数信息 where 参数名称=:参数名称 and 参数标记=:参数标记");

            sql.AddParameter("参数名称", parName);
            sql.AddParameter("参数标记", parTag);

            DataTable dtPar = sql.ExecuteSql();

            if (dtPar == null || dtPar.Rows.Count <= 0)
            {
                return(null);
            }

            ParameterData parData = new ParameterData();

            parData.BindRowData(dtPar.Rows[0]);

            return(parData);
        }
Exemple #3
0
        /// <summary>
        /// 获取规则信息
        /// </summary>
        /// <param name="departmentId"></param>
        /// <returns></returns>
        public JNoRuleInfo GetNoRuleInfo(string departmentId)
        {
            DataTable parInfo = _pm.GetParameterInfo(NoRuleParName, departmentId);

            if (parInfo == null || parInfo.Rows.Count <= 0)
            {
                return(null);
            }

            ParameterData parData = new ParameterData();

            parData.BindRowData(parInfo.Rows[0]);

            JNoRuleInfo noRule = JsonHelper.DeserializeObject <JNoRuleInfo>(parData.参数取值);

            if (noRule == null)
            {
                return(null);
            }

            return(noRule);
        }
Exemple #4
0
        /// <summary>
        /// 更新参数
        /// </summary>
        /// <param name="parData"></param>
        public void WriteParameter(ParameterData parData)
        {
            string parId = GetParameterId(parData.参数名称, parData.参数标记);

            string sql = "";

            if (string.IsNullOrEmpty(parId))
            {
                parId = parData.参数ID;

                sql = "insert into 影像参数信息(参数ID,参数名称,参数标记,参数取值) values(:参数ID, :参数名称, :参数标记, :参数取值)";
                sql = SqlHelper.GetSqlBiz().GetSqlContext("插入影像参数信息", sql);
            }
            else
            {
                sql = "update 影像参数信息 set 参数取值=:参数取值 where 参数ID=:参数ID";
                sql = SqlHelper.GetSqlBiz().GetSqlContext("更新影像参数信息", sql);
            }

            _dbHelper.ExecuteSQL(sql, new SqlParamInfo[] { new SqlParamInfo("参数名称", DbType.String, parData.参数名称),
                                                           new SqlParamInfo("参数标记", DbType.String, parData.参数标记),
                                                           new SqlParamInfo("参数取值", DbType.String, parData.参数取值),
                                                           new SqlParamInfo("参数ID", DbType.String, parId) });
        }