示例#1
0
        public void SubmitForm(DictItemInputDto dictItemInputDto, string keyValue)
        {
            DictItem dictItem = new DictItem();

            if (!string.IsNullOrEmpty(keyValue))
            {
                var id = Convert.ToInt64(keyValue);
                dictItem = dictItemRepository.Get(id);
                AutoMapper.Mapper.Map <DictItemInputDto, DictItem>(dictItemInputDto, dictItem);
                dictItemRepository.Update(dictItem);
            }
            else
            {
                AutoMapper.Mapper.Map <DictItemInputDto, DictItem>(dictItemInputDto, dictItem);
                dictItem.Id            = IdWorkerHelper.GenId64();
                dictItem.CreationTime  = DateTime.Now;
                dictItem.CreatorUserId = 1;
                dictItemRepository.Add(dictItem);
            }
        }
示例#2
0
 public ActionResult SubmitForm(DictItemInputDto dictItemInputDto, string keyValue)
 {
     dictItemService.SubmitForm(dictItemInputDto, keyValue);
     return Success("操作成功。");
 }