예제 #1
0
        public bool Update(SystemDicEntity entity)
        {
            var description = "更新系统字典配置";

            try
            {
                var sql          = @"update [SystemDic] set [Key]=@Key,[Value]=@Value,Description=@Description where Id=@Id";
                var sqlParameter = new List <SqlParameter> {
                    new SqlParameter("@Id", SqlDbType.VarChar)
                    {
                        Value = entity.Id
                    },
                    new SqlParameter("@Key", SqlDbType.VarChar)
                    {
                        Value = entity.Key
                    },
                    new SqlParameter("@Value", SqlDbType.VarChar)
                    {
                        Value = entity.Value
                    },
                    new SqlParameter("@Description", SqlDbType.VarChar)
                    {
                        Value = entity.Description
                    },
                };
                RPoney.Log.LoggerManager.Debug(GetType().Name, $"{description}sql:{sql},参数:{entity.SerializeToJSON()}");
                return(DataBaseManager.MainDb().ExecuteNonQuery(sql, sqlParameter.ToArray()) > 0);
            }
            catch (Exception ex)
            {
                RPoney.Log.LoggerManager.Error(GetType().Name, $"{description}异常", ex);
                return(false);
            }
        }
예제 #2
0
        public ActionResult Save(SystemDicEntity entity)
        {
            var dic = _systemDicBll.Value.Get(entity.Id);

            dic.Key         = entity.Key;
            dic.Value       = entity.Value;
            dic.Description = entity.Description;
            var description = "保存系统全局配置";

            if (_systemDicBll.Value.Update(dic))
            {
                return(LayerHelper.SuccessAndClose("", $"{description}成功"));
            }
            return(LayerHelper.Warn($"{description}失败"));
        }
예제 #3
0
 public bool Update(SystemDicEntity entity)
 {
     return(_systemDicDal.Value.Update(entity));
 }
예제 #4
0
        public ActionResult Edit(SystemDicEntity entity)
        {
            var dic = _systemDicBll.Value.Get(entity.Id);

            return(View(dic));
        }