protected void btn_guardar_Click(object sender, EventArgs e) { BlogControl _blogControl = new BlogControl(); BlogPost _post = new BlogPost(); _post.Author = new AuthorControl().getAuthor(Convert.ToInt32(DropDownList_author.SelectedValue)); _post.Title = txt_title.Text; _post.DatePost = DateTime.Now; _post.PostContent = txt_contenido.Text; if (_blogControl.savePost(_post)) { lbl_msg.Text = "Post Publicado"; lbl_msg.ForeColor = System.Drawing.Color.Green; } else { lbl_msg.Text = "Error publicando Post!"; lbl_msg.ForeColor = System.Drawing.Color.Red; } cleanForm(); }
protected void btn_Save_Click(object sender, EventArgs e) { BlogControl _blogControl = new BlogControl(); BlogPost _post = new BlogPost(); _post.Author = "Yefry"; _post.Title = "Post 1"; _post.DatePost = DateTime.Now; _post.PostContent = "First Post"; _blogControl.savePost(_post); }