예제 #1
0
		public async void  OnSubmit (object sender, EventArgs e)
		{
			string postTitle = PostTitle.Text;
			string postContent = PostContent.Text;
			string authorName = ((App)Application.Current).UserEmail;

			if (postTitle != "") {
				if (postContent != "") {
						Forum1Post new_post = new Forum1Post (postTitle,postContent,authorName);
						var database = new Forum1DB ();
						database.InsertNewPost (new_post);
									}
			}
		}
예제 #2
0
        public static List<Forum1Post> CreatePosts()
        {
            //fpost 1 = variable hold datas, Forum1Post = get set method, post_f1 = temporary data
            var postDB = new Forum1DB();

            List<Forum1Post> fpost1 = new List<Forum1Post>();

            for (int i = 0; i < Forum1PostTitle.Count ; i++) {
                string title   = Forum1PostTitle [i];
                string content_f1 = Forum1PostContent [i];
                Forum1Post post_f1 = new Forum1Post();
                post_f1.Forum1PostTitle = title;
                post_f1.Forum1PostContent = content_f1;
                fpost1.Add (post_f1);

            }
            return fpost1;
        }