コード例 #1
0
ファイル: MailService.cs プロジェクト: j3itchtits/jumblist
        public void SendTestEmail( Post post, User user )
        {
            string emailSubject = "Test PostMail";

            IDictionary tokens = new Hashtable();
            tokens.Add( "post", post );
            tokens.Add( "user", user );
            tokens.Add( "postdate", post.PublishDateTime.ToFriendlyJumblistLongDateTimeString( false ) );
            tokens.Add( "homeurl", homeUrl );

            string emailBody = GenerateEmailText( tokens, "TestEmail.vm" );

            SendMail( user.Email, emailSubject, emailBody, true );
        }
コード例 #2
0
ファイル: MailService.cs プロジェクト: j3itchtits/jumblist
        public void SendPostEmail( Post post, string email )
        {
            string emailSubject = "Post Mail";

            IDictionary tokens = new Hashtable();
            tokens.Add( "post", post );
            tokens.Add( "postdate", post.PublishDateTime.ToFriendlyJumblistLongDateTimeString( false ) );
            tokens.Add( "homeurl", homeUrl );

            string emailBody = GenerateEmailText( tokens, "PostEmailUnauthenticated.vm" );

            //SendMailAsync( email, emailSubject, emailBody, true );
            SendMail( email, emailSubject, emailBody, true );
        }
コード例 #3
0
ファイル: Post.cs プロジェクト: j3itchtits/jumblist
 public static Expression<Func<Post, bool>> WhereNotEquals( Post post )
 {
     return x => x.PostId != post.PostId;
 }
コード例 #4
0
ファイル: PostLocation.cs プロジェクト: j3itchtits/jumblist
 public static Expression<Func<PostLocation, bool>> WherePostEquals( Post post )
 {
     return x => x.PostId == post.PostId;
 }
コード例 #5
0
ファイル: Basket.cs プロジェクト: j3itchtits/jumblist
 public void ClearItem( Post post )
 {
     items.RemoveAll(p => p.PostId == post.PostId );
 }
コード例 #6
0
ファイル: Basket.cs プロジェクト: j3itchtits/jumblist
 public void AddItem( Post post )
 {
     var first = items.FirstOrDefault( p => p.PostId == post.PostId );
     if (first == null)
         items.Add( post );
 }
コード例 #7
0
        private void SavePostsToDatabase( Feed feed, SyndicationFeed feedOutput )
        {
            var postService = ServiceLocator.Current.GetInstance<IPostService>();

            foreach (var item in feedOutput.Items)
            {
                if ( ((IDataService<Post>)postService).IsDuplicate( Post.WhereUrlEquals( item.Links[0].Uri.ToString() ) ) ) 
                    continue;

                var post = new Post();
                //post.Guid = item.Id;
                post.Url = item.Links[0].Uri.ToString();
                post.Title = item.Title.Text;
                post.Body = item.Summary.Text;
                post.PublishDateTime = item.PublishDate.LocalDateTime;
                post.LastUpdatedDateTime = item.LastUpdatedTime.LocalDateTime;
                post.Display = false;
                post.UserId = User.Anonymous.UserId;
                post.FeedId = feed.FeedId;
                post.LastUpdatedDateTime = DateTime.Now;
                post.PostCategoryId = postService.ExtractPostCategoryId( post );

                if ( PostCategoryId.Wanted.Is( post.PostCategoryId ) || PostCategoryId.Offered.Is( post.PostCategoryId ) )
                {
                    postService.Import( post );
                }

                
                
            }
        }