public async Task <TData <string> > SaveForm(WishUserEntity entity) { TData <string> obj = new TData <string>(); obj.SetDefault(); if (entity.MobilePhone.IsEmpty() || entity.RealName.IsEmpty()) { obj.Message = "手机号和姓名不能为空"; return(obj); } WishUserEntity user = await wishUserService.GetEntityByPhone(entity.MobilePhone); if (user != null && user.Id > 0) { obj.Message = "您已经登记,不需要重复录入"; } else { await wishUserService.SaveForm(entity); obj.Data = entity.Id.ParseToString(); obj.Tag = 1; obj.Refresh(); } return(obj); }
public async Task SaveForm(WishUserEntity entity) { if (entity.Id.IsNullOrZero()) { await entity.Create(); await this.BaseRepository().Insert(entity); } else { await entity.Modify(); await this.BaseRepository().Update(entity); } }
//WishUserParam public async Task <TData <string> > SaveForm(WishUserParam entity, OperatorInfo user) { TData <string> obj = new TData <string>(); obj.SetDefault(); #region 检测短信验证码 obj = new SmsCodeBLL().CheckSms(entity.MobilePhone, entity.SmsCode); #endregion if (obj.Tag == 1) { #region 封装数据 WishUserEntity wishModel = new WishUserEntity(); ClassValueCopierHelper.Copy(wishModel, entity); wishModel.TuiJianUserId = long.Parse(user.UserIdStr); wishModel.TuiJianUserTxt = user.RealName; wishModel.SrcFlag = "1"; #endregion obj = await SaveForm(wishModel); } return(obj); }
public async Task <ActionResult> SaveFormJson(WishUserEntity entity) { TData <string> obj = await wishUserBLL.SaveForm(entity); return(Json(obj)); }