public void SubmitForm(DictInputDto dictInputDto, string keyValue) { Dict dict = new Dict(); if (!string.IsNullOrEmpty(keyValue)) { long id = long.Parse(keyValue); dict = dictRepository.Get(id); AutoMapper.Mapper.Map <DictInputDto, Dict>(dictInputDto, dict); dict.LastModificationTime = DateTime.Now; dictRepository.Update(dict); } else { AutoMapper.Mapper.Map <DictInputDto, Dict>(dictInputDto, dict); dict.Id = IdWorkerHelper.GenId64(); dict.CreationTime = DateTime.Now; dictRepository.Add(dict); } }
public ActionResult SubmitForm(DictInputDto dictInputDto, string keyValue) { dictService.SubmitForm(dictInputDto, keyValue); return(Success("操作成功。")); }