예제 #1
0
        protected virtual async Task <VisitExamineEditDto> CreateVisitExamineAsync(VisitExamineEditDto input)
        {
            //TODO:新增前的逻辑判断,是否允许新增

            var entity = ObjectMapper.Map <VisitExamine>(input);

            entity = await _visitexamineRepository.InsertAsync(entity);

            return(entity.MapTo <VisitExamineEditDto>());
        }
예제 #2
0
        protected virtual async Task UpdateVisitExamineAsync(VisitExamineEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新

            var entity = await _visitexamineRepository.GetAsync(input.Id.Value);

            input.MapTo(entity);

            // ObjectMapper.Map(input, entity);
            await _visitexamineRepository.UpdateAsync(entity);
        }
예제 #3
0
        /// <summary>
        /// MPA版本才会用到的方法
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <GetVisitExamineForEditOutput> GetVisitExamineForEdit(NullableIdDto <Guid> input)
        {
            var output = new GetVisitExamineForEditOutput();
            VisitExamineEditDto visitexamineEditDto;

            if (input.Id.HasValue)
            {
                var entity = await _visitexamineRepository.GetAsync(input.Id.Value);

                visitexamineEditDto = entity.MapTo <VisitExamineEditDto>();

                //visitexamineEditDto = ObjectMapper.Map<List <visitexamineEditDto>>(entity);
            }
            else
            {
                visitexamineEditDto = new VisitExamineEditDto();
            }

            output.VisitExamine = visitexamineEditDto;
            return(output);
        }