public async Task <MessageModel <string> > Post([FromBody] sysUserInfo sysUserInfo) { var data = new MessageModel <string>(); var id = await _sysUserInfoServices.Add(sysUserInfo); data.success = id > 0; if (data.success) { data.response = id.ObjToString(); data.msg = "添加成功"; } return(data); }
public ActionResult Add(sysUserInfo model) { if (model != null) { model.uCreateTime = DateTime.Now; model.uLastErrTime = DateTime.Now; model.uUpdateTime = DateTime.Now; UserInfoService.Add(model); UserInfoService.SaverChanges(); return(Content("<script type='text/javascript'>alert('恭喜!添加成功└(^o^)┘!');window.parent.location.reload();parent.layer.close(index);</script>")); } else { return(Content("<script type='text/javascript'>alert('好像哪里出错 了,咋办 ╮(╯_╰)╭!');;</script>")); } }
public async Task <MessageModel <string> > Post([FromBody] sysUserInfo sysUserInfo) { var data = new MessageModel <string>(); sysUserInfo.uLoginPWD = MD5Helper.MD5Encrypt32(sysUserInfo.uLoginPWD); sysUserInfo.uRemark = _user.Name; var id = await _sysUserInfoServices.Add(sysUserInfo); data.success = id > 0; if (data.success) { data.response = id.ObjToString(); data.msg = "添加成功"; } return(data); }