Beispiel #1
0
        /// <summary>
        /// 获取SQL字符串
        /// </summary>
        /// <param name="level">对象</param>
        /// <returns></returns>
        private string GetThreatLevelSqlString(ThreatLevel level)
        {
            string sql = string.Empty;

            if (level != null)
            {
                sql = string.Format(level.Id <= 0 ? "insert into t_base_threatlevels (level_num, level_value) values ({0}, {1})" : "update t_base_threatlevels set level_value = {1} where level_num = {0}", level.Id, level.Name);
            }
            return(sql);
        }
Beispiel #2
0
 /// <summary>
 /// 保存信息
 /// </summary>
 /// <param name="level">对象</param>
 /// <returns></returns>
 public int SaveThreatLevel(ThreatLevel level)
 {
     return(this.provider.ExecuteSql(this.GetThreatLevelSqlString(level)));
 }