public ActionResult SaveCard(Sale_UserStepEntity entity) { string OpenId = CurrentWxUser.OpenId; if (!string.IsNullOrEmpty(OpenId)) { var stepentity = userStepbll.GetEntity(OpenId); if (stepentity != null) { entity.OpenId = CurrentWxUser.OpenId; entity.NickName = CurrentWxUser.NickName; entity.HeadimgUrl = CurrentWxUser.HeadimgUrl; userStepbll.SaveForm(OpenId, entity); return(Content("修改成功!")); } else { entity.OpenId = CurrentWxUser.OpenId; entity.NickName = CurrentWxUser.NickName; entity.HeadimgUrl = CurrentWxUser.HeadimgUrl; userStepbll.SaveForm(null, entity); return(Content("提交成功!")); } } else { return(Content("不存在微信id!")); } }
/// <summary> /// 保存表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="entity">实体对象</param> /// <returns></returns> public void SaveForm(string keyValue, Sale_UserStepEntity entity) { try { service.SaveForm(keyValue, entity); } catch (Exception) { throw; } }
public ActionResult SaveForm(string keyValue, Sale_UserStepEntity entity) { sale_userstepbll.SaveForm(keyValue, entity); return(Success("操作成功。")); }