Exemple #1
0
 public JsonResult UpdateUserInfo(MemberUpdate model)
 {
     if (!model.BirthDay.HasValue && !CurrentUser.BirthDay.HasValue)
     {
         return(Json(new Result()
         {
             success = false, msg = "生日必须填写"
         }));
     }
     //if (string.IsNullOrWhiteSpace(model.CellPhone) || string.IsNullOrWhiteSpace(CurrentUser.CellPhone))
     //{
     //    return Json(new Result() { success = false, msg = "请先绑定手机号码" });
     //}
     if (string.IsNullOrWhiteSpace(model.RealName))
     {
         return(Json(new Result()
         {
             success = false, msg = "用户姓名必须填写"
         }));
     }
     model.Id = CurrentUser.Id;
     MemberApplication.UpdateMemberInfo(model);
     return(Json(new Result()
     {
         success = true, msg = "修改成功"
     }));
 }
 /// <summary>
 /// 保存个人信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public object SaveUserInfo(MemberUpdate model)
 {
     CheckUserLogin();
     if (string.IsNullOrWhiteSpace(model.RealName))
     {
         return(ErrorResult("真实姓名必须填写"));
     }
     if (!string.IsNullOrWhiteSpace(model.Photo))
     {
         model.Photo = UploadPhoto(model.Photo);
     }
     model.Id = CurrentUser.Id;
     MemberApplication.UpdateMemberInfo(model);
     return(Json(new { success = true, msg = "修改成功" }));
 }