private String getLastUpdateInfo(LastUpdateInfo info) { if (info.IsEmpty()) { return(string.Empty); } String lnkPost = ""; if (info.PostType.Equals(typeof(ForumTopic).Name)) { lnkPost = to(new TopicController().Show, info.PostId); } else if (info.PostType.Equals(typeof(ForumPost).Name)) { lnkPost = to(new PostController().Show, info.PostId); } return(string.Format("<div class=\"fblastTitle\"><a href='{0}'>{1}</a></div><div class=\"fblastTime\">by <a href='{3}'>{2}</a> at {4}</div>", lnkPost, strUtil.CutString(info.PostTitle, 30), info.CreatorName, toUser(info.CreatorUrl), info.UpdateTime.ToShortDateString() )); }
private void updateCount(ForumTopic topic, User user, IApp app) { ForumBoard fb = boardService.GetById(topic.ForumBoard.Id, topic.OwnerId, topic.OwnerType); fb.TodayPosts++; fb.Topics = boardService.CountTopic(fb.Id); LastUpdateInfo info = new LastUpdateInfo(); info.PostId = topic.Id; info.PostType = typeof(ForumTopic).Name; info.PostTitle = topic.Title; info.CreatorName = user.Name; info.CreatorUrl = user.Url; info.UpdateTime = DateTime.Now; fb.LastUpdateInfo = info; fb.Updated = info.UpdateTime; boardService.Update(fb); ForumApp forum = app as ForumApp; forum.TopicCount = forum.CountTopic(); forum.TodayTopicCount++; forum.LastUpdateMemberName = user.Name; forum.LastUpdateMemberUrl = user.Url; forum.LastUpdatePostTitle = topic.Title; forum.LastUpdateTime = topic.Created; forumService.Update(forum); userService.AddPostCount(user); }
/// <remarks> /// Note: any commitments with CommitmentStatus == Active are filtered out before GetStatus is called on them /// </remarks> public RequestStatus GetStatus(EditStatus editStatus, int apprenticeshipCount, LastAction lastAction, AgreementStatus overallAgreementStatus, LastUpdateInfo providerLastUpdateInfo, long?transferSenderId, TransferApprovalStatus?transferApprovalStatus) { if (transferSenderId.HasValue) { return(GetTransferStatus(editStatus, transferApprovalStatus, lastAction, overallAgreementStatus)); } if (editStatus == EditStatus.Both) { return(RequestStatus.Approved); } if (editStatus == EditStatus.ProviderOnly) { return(GetProviderOnlyStatus(lastAction, overallAgreementStatus)); } if (editStatus == EditStatus.EmployerOnly) { return(GetEmployerOnlyStatus(lastAction)); } return(RequestStatus.None); }
private void updateCount(ForumPost post, User user, IMember owner, IApp app) { ForumTopic topic = post.Topic; if (topic == null) { topic = topicService.GetById(post.TopicId, owner); } topic.Replies = topicService.CountReply(post.TopicId); topic.RepliedUserName = user.Name; topic.RepliedUserFriendUrl = user.Url; topic.Replied = DateTime.Now; topicService.UpdateReply(topic); ForumBoard fb = ForumBoard.findById(post.ForumBoardId); fb.TodayPosts++; fb.Posts++; LastUpdateInfo info = new LastUpdateInfo(); info.PostId = post.Id; info.PostType = typeof(ForumPost).Name; info.PostTitle = post.Title; info.CreatorName = user.Name; info.CreatorUrl = user.Url; info.UpdateTime = DateTime.Now; fb.LastUpdateInfo = info; fb.Updated = info.UpdateTime; boardService.Update(fb); ForumApp forum = app as ForumApp; forum.PostCount++; forum.TodayPostCount++; forum.LastUpdateMemberName = user.Name; forum.LastUpdateMemberUrl = user.Url; forum.LastUpdatePostTitle = post.Title; forum.LastUpdateTime = post.Created; forumService.Update(forum); userService.AddPostCount(user); }
private void updateForumLastupdate(ForumTopic topic, User user) { ForumBoard fb = boardService.GetById(topic.ForumBoard.Id, topic.OwnerId, topic.OwnerType); LastUpdateInfo info = new LastUpdateInfo(); info.PostId = topic.Id; info.PostType = typeof(ForumTopic).Name; info.PostTitle = topic.Title; info.CreatorName = user.Name; info.CreatorUrl = user.Url; info.UpdateTime = DateTime.Now; fb.LastUpdateInfo = info; fb.Updated = info.UpdateTime; boardService.Update(fb); }
public virtual void UpdateLastInfo(ForumBoard fb) { ForumTopic topic = ForumTopic .find("ForumBoardId=" + fb.Id + " and " + TopicStatus.GetShowCondition() + " order by Id desc") .first(); LastUpdateInfo info = new LastUpdateInfo(); info.PostId = topic.Id; info.PostType = typeof(ForumTopic).Name; info.PostTitle = topic.Title; User user = topic.Creator; info.CreatorName = user.Name; info.CreatorUrl = user.Url; info.UpdateTime = topic.Created; fb.LastUpdateInfo = info; fb.Updated = info.UpdateTime; db.update(fb); }
public CommitmentView() { Apprenticeships = new List <Apprenticeship.Apprenticeship>(); EmployerLastUpdateInfo = new LastUpdateInfo(); ProviderLastUpdateInfo = new LastUpdateInfo(); }
public Commitment() { EmployerLastUpdateInfo = new LastUpdateInfo(); ProviderLastUpdateInfo = new LastUpdateInfo(); }