Exemplo n.º 1
0
        /// <summary>
        /// 删除配置项
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int DelNotifySetting(NotifySettingEntity entity)
        {
            const string sql =
                @"DELETE FROM NotifySetting WHERE SettingKey=@SettingKey";

            using (IDbConnection conn = ConnectionFactory.JinRiNotify_CMD)
            {
                return(conn.Execute(sql, entity));
            }
        }
Exemplo n.º 2
0
        public int SaveNotifySetting(NotifySettingEntity entity)
        {
            const string sql =
                @"INSERT INTO NotifySetting(SettingKey, SettingValue, Remark, Memo, ClassName, CreateTime, LastModifyTime) 
VALUES(@SettingKey, @SettingValue, @Remark ,@Memo, @ClassName, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP())";

            using (IDbConnection conn = ConnectionFactory.JinRiNotify_CMD)
            {
                int ret = conn.Execute(sql, entity);
                return(ret);
            }
        }
Exemplo n.º 3
0
        public int EditNotifySetting(NotifySettingEntity entity)
        {
            const string sql =
                @"UPDATE NotifySetting SET LastModifyTime = CURRENT_TIMESTAMP(), {0} WHERE NotifyId = @NotifyId";

            List <string> list = new List <string>();

            if (!Null.IsNull(entity.SettingKey))
            {
                list.Add("SettingKey");
            }
            if (!Null.IsNull(entity.SettingValue))
            {
                list.Add("SettingValue");
            }
            if (!Null.IsNull(entity.Remark))
            {
                list.Add("Remark");
            }
            if (!Null.IsNull(entity.Memo))
            {
                list.Add("Memo");
            }
            if (!Null.IsNull(entity.ClassName))
            {
                list.Add("ClassName");
            }

            List <string> cmdList = new List <string>();

            foreach (string s in list)
            {
                if (s.Equals("Memo", StringComparison.OrdinalIgnoreCase))
                {
                    cmdList.Add(string.Format("{0} = CONCAT({0}, @{0})", s));
                }
                else
                {
                    cmdList.Add(string.Format("{0} = @{0}", s));
                }
            }
            using (IDbConnection conn = ConnectionFactory.JinRiNotify_CMD)
            {
                return(conn.Execute(string.Format(sql, string.Join(", ", cmdList)), entity));
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// 删除配置项
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public int DelNotifySetting(NotifySettingEntity entity)
 {
     return(JinRiNotifyCMD.Instance.DelNotifySetting(entity));
 }