Esempio n. 1
0
 public void Update(InputConfigDto dto)
 {
     this.InputType    = dto.InputType;
     this.IsRequired   = dto.IsRequired;
     this.ValidType    = dto.ValidType;
     this.DefaultValue = dto.DefaultValue;
     this.Tips         = dto.Tips;
     this.Memo         = dto.Memo;
 }
Esempio n. 2
0
        public void UpsertInputConfig(InputConfigDto dto)
        {
            var input = Mapper.Map <InputConfigDto, InputConfig>(dto);

            if (this.Input == null)
            {
                this.Input = input;
            }
            else
            {
                this.Input.Update(dto); // todo: 验证手工赋值的必要性
            }
        }
Esempio n. 3
0
        public OperationResult UpsertInputConfig(InputConfigDto dto)
        {
            var section = SectionConfig.FindById(dto.SectionId);

            if (section == null)
            {
                return(new OperationResult(StatusCode.NotFound, "").SetExtras(dto.Id));
            }
            else
            {
                section.UpsertInputConfig(dto);
                return(UnitOfWork.Commit() > 0
                           ? new OperationResult(StatusCode.Okey).SetExtras(section.Input.Id)
                           : new OperationResult(StatusCode.Failed).SetExtras(section.Input.Id));
            }
        }