コード例 #1
0
        public async Task <PopularResult <string> > UpdateAsync(DictDto dto)
        {
            var result = new PopularResult <string>();
            var dict   = ObjectMapper.Map <DictDto, DictEntity>(dto);
            await _dictRepository.UpdateAsync(dict);

            result.Success("更新成功");
            return(result);
        }
コード例 #2
0
ファイル: DictService.cs プロジェクト: dahaideyu/api
        public void Update(DictDto config)
        {
            var entity = _dictRepository.GetById(config.DictID);

            entity.DictName = config.DictName;
            entity.DictCode = config.DictCode;
            entity.DictType = config.DictType;
            entity.OrderID  = config.OrderID;
            _dictRepository.Update(entity);
        }
コード例 #3
0
ファイル: DictController.cs プロジェクト: zxbe/EFX.Core
        public JsonResult List(DictDto dto)
        {
            IList <Dict> list    = new List <Dict>();
            PageResponse reponse = new PageResponse();

            if (!string.IsNullOrEmpty(dto.Tid))
            {
                reponse = _DictService.GetList(dto);
            }
            return(Json(reponse));
        }
コード例 #4
0
        public async Task <PopularResult <string> > InsertAsync(DictDto dto)
        {
            var result = new PopularResult <string>();
            var entity = ObjectMapper.Map <DictDto, DictEntity>(dto);
            var dict   = await _dictRepository.InsertAsync(entity);

            if (dict == null)
            {
                result.Failed("添加失败");
                return(result);
            }
            result.Success("添加成功");
            return(result);
        }
コード例 #5
0
 public async Task <PopularResult <string> > UpdateAsync([FromBody] DictDto dto)
 {
     return(await _dictService.UpdateAsync(dto));
 }
コード例 #6
0
 public static DictEntity ToEntity(this DictDto model, DictEntity destination)
 {
     return(model.MapTo(destination));
 }
コード例 #7
0
 public static DictEntity ToEntity(this DictDto model)
 {
     return(model.MapTo <DictDto, DictEntity>());
 }
コード例 #8
0
ファイル: DictService.cs プロジェクト: dahaideyu/api
        public void Create(DictDto config)
        {
            var entity = config.MapTo <DictEntity>();

            _dictRepository.Insert(entity);
        }
コード例 #9
0
 public ResponseModel UpdateBatch([FromBody] DictDto model, int dictId)
 {
     dictService.Update(model);
     return(new ResponseModel());
 }
コード例 #10
0
 public ResponseModel Create([FromBody] DictDto model)
 {
     dictService.Create(model);
     return(new ResponseModel());
 }