/// <summary> /// 用户重新上传,增加日志,等待审核 /// </summary> /// <param name="user"></param> /// <param name="ip"></param> public virtual void AddLog( User user, string ip ) { UserErrorPic log = new UserErrorPic(); log.UserId = user.Id; log.Ip = ip; log.insert(); }
/// <summary> /// 用户重新上传,增加日志,等待审核 /// </summary> /// <param name="user"></param> /// <param name="ip"></param> public void AddLog(User user, string ip) { UserErrorPic log = new UserErrorPic(); log.UserId = user.Id; log.Ip = ip; log.insert(); }
/// <summary> /// 在管理员尚未审核之前,用户重新上传 /// </summary> /// <param name="user"></param> /// <param name="ip"></param> public void UpdateLastUpload(User user, string ip) { UserErrorPic x = UserErrorPic.find("UserId=" + user.Id + " order by Id desc").first(); x.Created = DateTime.Now; x.Ip = ip; x.update(); }
public String GetLastReviewMsg(User user) { UserErrorPic x = UserErrorPic.find("UserId=" + user.Id + " and ReviewMsg<>'' order by Id desc").first(); if (x == null) { return(null); } return(x.ReviewMsg); }
public virtual void AddLogAndPass( User user, string ip ) { user.IsPicError = 0; user.update(); UserErrorPic log = new UserErrorPic(); log.UserId = user.Id; log.Ip = ip; log.IsPass = 1; log.ReviewMsg = "auto pass"; log.insert(); }
public void AddLogAndPass(User user, string ip) { user.IsPicError = 0; user.update(); UserErrorPic log = new UserErrorPic(); log.UserId = user.Id; log.Ip = ip; log.IsPass = 1; log.ReviewMsg = "auto pass"; log.insert(); }
/// <summary> /// 管理员审核通过 /// </summary> /// <param name="ids"></param> /// <param name="reviewMsg"></param> public void ApproveOk(String ids, String reviewMsg) { List <User> userList = getUserList(ids); foreach (User user in userList) { user.IsPicError = 0; user.update(); UserErrorPic x = UserErrorPic.find("UserId=" + user.Id + " order by Id desc").first(); x.ReviewMsg = reviewMsg; x.IsPass = 1; x.update(); } }
public int GetStatus(User user) { UserErrorPic x = UserErrorPic.find("UserId=" + user.Id + " order by Id desc").first(); if (x == null) { return(UserErrorPic.StatusFirstUpload); } if (strUtil.HasText(x.ReviewMsg)) { if (x.IsPass == 0) { return(UserErrorPic.StatusWaitingUpload); } else { return(UserErrorPic.StatusOk); } } return(UserErrorPic.StatusWaitingApprove); }
/// <summary> /// 管理员审核没有通过,将日志增加到数据库 /// </summary> /// <param name="ids"></param> /// <param name="reviewMsg"></param> /// <param name="isNextApprove">下次上传是否前置审核</param> public virtual void ApproveError( String ids, String reviewMsg, int isNextApprove, int isDelete ) { List<User> userList = getUserList( ids ); foreach (User user in userList) { user.IsPicError = 1; user.update(); UserErrorPic log = new UserErrorPic(); log.UserId = user.Id; log.Ip = ""; log.ReviewMsg = reviewMsg; log.IsNextAutoPass = isNextApprove; log.insert(); if (isDelete == 1 ) { deleteUserPic( user ); } } }
/// <summary> /// 管理员审核没有通过,将日志增加到数据库 /// </summary> /// <param name="ids"></param> /// <param name="reviewMsg"></param> /// <param name="isNextApprove">下次上传是否前置审核</param> public void ApproveError(String ids, String reviewMsg, int isNextApprove, int isDelete) { List <User> userList = getUserList(ids); foreach (User user in userList) { user.IsPicError = 1; user.update(); UserErrorPic log = new UserErrorPic(); log.UserId = user.Id; log.Ip = ""; log.ReviewMsg = reviewMsg; log.IsNextAutoPass = isNextApprove; log.insert(); if (isDelete == 1) { deleteUserPic(user); } } }
private void saveWaitingUpload() { User user = ctx.owner.obj as User; Result result = AvatarUploader.Save(ctx.GetFileSingle(), user.Id); if (result.HasErrors) { echoError(result); return; } if (user.Pic != UserFactory.Guest.Pic) { AvatarUploader.Delete(user.Pic); } // 增加日志 UserErrorPic lastLog = errorPicService.GetLastLog(user); if (lastLog.IsNextAutoPass == 1) { errorPicService.AddLogAndPass(user, ctx.Ip); } else { errorPicService.AddLog(user, ctx.Ip); } // 2) 保存图像、不会增加积分、不会发送邮件鼓励;给管理员发通知 userService.UpdateAvatarWhenError(user, result.Info.ToString()); String msg = "感谢上传!"; echoRedirect(msg); }
public UserErrorPic GetLastLog(User user) { return(UserErrorPic.find("UserId=" + user.Id + " and ReviewMsg<>'' order by Id desc").first()); }
public int CheckErrorCount(User user) { return(UserErrorPic.count("UserId=" + user.Id + " and ReviewMsg<>'' and IsPass=0")); }