public void SubmitForm(WxOfficialInputDto wxOfficialInputDto, string keyValue) { WxOfficial wxOfficial = new WxOfficial(); if (!string.IsNullOrEmpty(keyValue)) { var id = Convert.ToInt64(keyValue); wxOfficial = wxOfficialRepository.Get(id); AutoMapper.Mapper.Map <WxOfficialInputDto, WxOfficial>(wxOfficialInputDto, wxOfficial); wxOfficial.LastModificationTime = DateTime.Now; wxOfficialRepository.Update(wxOfficial); } else { AutoMapper.Mapper.Map <WxOfficialInputDto, WxOfficial>(wxOfficialInputDto, wxOfficial); wxOfficial.Id = IdWorkerHelper.GenId64(); wxOfficial.DeletedMark = false; wxOfficial.CreationTime = DateTime.Now; wxOfficial.CreatorUserId = 1; wxOfficialRepository.Add(wxOfficial); } }
public ActionResult SubmitForm(WxOfficialInputDto wxOfficialInputDto, string keyValue) { wxOfficialService.SubmitForm(wxOfficialInputDto, keyValue); return(Success("操作成功。")); }