using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CareersOnlineLibrary;
using CareersOnlineLibrary.Entity;
using CareersOnlineLibrary.Controller;
namespace WebApplication1.Articles
{
public partial class ArticleDetail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
}
else
{
CareersOnlineController controller = new CareersOnlineController();
Article article = controller.GetArticleDetails(int.Parse(Request.QueryString["ArticleID"]));
// add title (use a single column)
TableRow tr = new TableRow();
tr.Cells.Add(new TableCell());
// change title color slightly
tr.Cells[0].ForeColor = System.Drawing.Color.Navy;
tr.Cells[0].Width = 400;
// make the text title big and purple
tr.Cells[0].Text = "" + article.Title + "";
this.ArticleTable.Rows.Add(tr);
// add blog in a single column and span 2 columns
tr = new TableRow();
tr.Cells.Add(new TableCell());
tr.Cells[0].Width = 550;
tr.Cells[0].ColumnSpan = 2;
tr.Cells[0].Text = article.FullDescription;
this.ArticleTable.Rows.Add(tr);
// add user who posted and date (use two columns in the row)
tr = new TableRow();
tr.Height = 50;
tr.HorizontalAlign = HorizontalAlign.Left;
tr.VerticalAlign = VerticalAlign.Bottom;
tr.Cells.Add(new TableCell());
tr.Cells.Add(new TableCell());
DateTime postTime = DateTime.Parse(article.Date.ToString());
tr.Cells[0].Text = "Posted on " + String.Format("{0}", postTime.ToString("MMM dd, yyyy @ hh:mm")); ;
tr.Cells[1].HorizontalAlign = HorizontalAlign.Right;
this.ArticleTable.Rows.Add(tr);
controller = null;
article = null;
}
}
}
}