public static void FillComplaintModelBuilder(ComplaintModel.Builder aBuilder, IUserRetrievalService<User> aUserRetrievalService, IHAVIssueService aIssueService, IHAVIssueReplyService anIssueReplyService, IHAVIssueReplyCommentService anIssueReplyCommentService, IPhotoService<User, PhotoAlbum, Photo, Friend> aPhotoService) { UserInformationModel<User> myUser = HaveAVoice.Helpers.UserInformation.HAVUserInformationFactory.GetUserInformation(); switch (aBuilder.ComplaintType()) { case ComplaintType.Issue: Issue myIssue = aIssueService.GetIssue(aBuilder.SourceId(), myUser); aBuilder.TowardUser(myIssue.User); aBuilder.SourceDescription(myIssue.Title); break; case ComplaintType.IssueReply: IssueReply myIssueReply = anIssueReplyService.GetIssueReply(aBuilder.SourceId()); aBuilder.TowardUser(myIssueReply.User); aBuilder.SourceDescription(myIssueReply.Reply); break; case ComplaintType.IssueReplyComment: IssueReplyComment myIssueReplyComment = anIssueReplyCommentService.GetIssueReplyComment(aBuilder.SourceId()); aBuilder.TowardUser(myIssueReplyComment.User); aBuilder.SourceDescription(myIssueReplyComment.Comment); break; case ComplaintType.ProfileComplaint: User myTowardUser = aUserRetrievalService.GetUser(aBuilder.SourceId()); aBuilder.TowardUser(myTowardUser); aBuilder.SourceDescription("You are reporting this user because of their profile."); break; case ComplaintType.PhotoComplaint: Photo myPhoto = aPhotoService.GetPhoto(SocialUserModel.Create(myUser.Details), aBuilder.SourceId()).Model; aBuilder.TowardUser(myPhoto.User); aBuilder.SourceDescription(myPhoto.ImageName); break; } }
public ComplaintController() { ModelStateWrapper myModelWrapper = new ModelStateWrapper(this.ModelState); theService = new HAVComplaintService(myModelWrapper); theUserRetrievalService = new UserRetrievalService<User>(new EntityHAVUserRetrievalRepository()); theIssueService = new HAVIssueService(myModelWrapper); theIssueReplyService = new HAVIssueReplyService(myModelWrapper); theIssueReplyCommentService = new HAVIssueReplyCommentService(myModelWrapper); thePhotoService = new PhotoService<User, PhotoAlbum, Photo, Friend>(new FriendService<User, Friend>(new EntityHAVFriendRepository()), new EntityHAVPhotoAlbumRepository(), new EntityHAVPhotoRepository()); }
public IssueReplyCommentController(IHAVIssueReplyCommentService aService) { theService = aService; }
public IssueReplyCommentController() { theService = new HAVIssueReplyCommentService(new Social.Validation.ModelStateWrapper(this.ModelState)); }
public IssueReplyController() { IValidationDictionary myModelState = new ModelStateWrapper(this.ModelState); theIssueReplyService = new HAVIssueReplyService(myModelState); theIssueReplyCommentService = new HAVIssueReplyCommentService(myModelState); }