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); } }
public ActionResult SubmitForm(DictItemInputDto dictItemInputDto, string keyValue) { dictItemService.SubmitForm(dictItemInputDto, keyValue); return Success("操作成功。"); }