public void SubmitForm(WxTextInputDto wxTextInputDto, string keyValue) { string appId = WxOperatorProvider.Provider.GetCurrent().AppId; WxText wxText = new WxText(); if (!string.IsNullOrEmpty(keyValue)) { var id = Convert.ToInt64(keyValue); wxText = wxTextRepository.Get(id); AutoMapper.Mapper.Map <WxTextInputDto, WxText>(wxTextInputDto, wxText); wxText.LastModificationTime = DateTime.Now; wxTextRepository.Update(wxText); } else { AutoMapper.Mapper.Map <WxTextInputDto, WxText>(wxTextInputDto, wxText); wxText.Id = IdWorkerHelper.GenId64(); wxText.AppId = appId; wxText.DeletedMark = false; wxText.CreationTime = DateTime.Now; wxText.CreatorUserId = 1; wxTextRepository.Add(wxText); } }
public ActionResult SubmitForm(WxTextInputDto wxTextInputDto, string keyValue) { wxTextService.SubmitForm(wxTextInputDto, keyValue); return(Success("操作成功。")); }