예제 #1
0
 public async Task SaveForm(ConfigEntity entity)
 {
     if (entity.Id.IsNullOrZero())
     {
         entity.Create();
         await this.BaseRepository().Insert(entity);
     }
     else
     {
         await this.BaseRepository().Update(entity);
     }
 }
예제 #2
0
파일: ConfigApp.cs 프로젝트: ahbaer/baer
        public string SubmitForm(ConfigEntity configEntity, string keyValue)
        {
            string tip = "";

            if (service.IQueryable(m => m.ConfigName == configEntity.ConfigName && m.F_Id != keyValue).ToList().Count > 0)
            {
                tip = "已存在该系统参数!";
            }
            else
            {
                if (!string.IsNullOrEmpty(keyValue))
                {
                    configEntity.Modify(keyValue);
                    service.Update(configEntity);
                }
                else
                {
                    configEntity.Create();
                    service.Insert(configEntity);
                }
            }

            return(tip);
        }