using System;
using System.Windows.Forms;


namespace BookCommunityClient
{
	/// <summary>
	/// TableStyleGenerator 的摘要说明。
	/// </summary>
	public sealed class TableStyleGenerator
	{
		public static DataGridTableStyle GetStyleForUser()
		{

			// creates the table style that's used for the datagrid
			DataGridTableStyle dgTableStyle = new DataGridTableStyle();
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null, 
				"用户名",
				"UserName", 
				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"真实姓名",
				"RealName",
				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"地址",
				"Address",
				300));

			dgTableStyle.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			dgTableStyle.MappingName = "USER_INFO";
			dgTableStyle.RowHeadersVisible = false;
			dgTableStyle.AlternatingBackColor = System.Drawing.Color.LemonChiffon;

			//dgTableStyle.GridColumnStyles[@"ID"].PropertyDescriptor.IsBrowsable = false;

			return dgTableStyle;
		}
		public static DataGridTableStyle GetStyleForMessage()
		{

			// creates the table style that's used for the datagrid
			DataGridTableStyle dgTableStyle = new DataGridTableStyle();
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null, 
				"发件人",
				"Sender", 
				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"标题",
				"Title",
				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn("d",
				"发送时间",
				"SendDate",
				100));

			dgTableStyle.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			dgTableStyle.MappingName = "MESSAGE_INFO";
			dgTableStyle.RowHeadersVisible = false;
			dgTableStyle.AlternatingBackColor = System.Drawing.Color.LemonChiffon;


			return dgTableStyle;
		}
		public static DataGridTableStyle GetStyleForBook()
		{

			// creates the table style that's used for the datagrid
			DataGridTableStyle dgTableStyle = new DataGridTableStyle();
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null, 
				"中文书名",
				"BookNameChn",
				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"英文书名",
				"BookNameEng",
				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"当前状态",
				"Status",
				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"拥有者",
				"Ownername",
				300));


			dgTableStyle.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			dgTableStyle.MappingName = "BOOK_INFO";
			dgTableStyle.RowHeadersVisible = false;
			dgTableStyle.AlternatingBackColor = System.Drawing.Color.LemonChiffon;

			return dgTableStyle;
		}
		public static DataGridTableStyle GetStyleForShareInfo()
		{
			// creates the table style that's used for the datagrid
			DataGridTableStyle dgTableStyle = new DataGridTableStyle();

//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null, 
//				"中文书名",
//				"bookChn",
//				100));
//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
//				"英文书名",
//				"bookEng",
//				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"借阅者",
				"ShareTo",
				50));
//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
//				"拥有者",
//				"ShareFrom",
//				50));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn("d",
				"计划借阅时间",
				"PlanBeginDate",
				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn("d",
				"计划还书时间",
				"PlanEndDate",
				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn("d",
				"实际借阅时间",
				"ActualBeginDate",
				100));
//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
//				"实际还书时间",
//				"ActualEndDate",
//				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"磨损",
				"Depreciation",
				45));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"当前状态",
				"Status",
				70));

			dgTableStyle.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			dgTableStyle.MappingName = "BookRelatedShareInfo";
			dgTableStyle.RowHeadersVisible = false;
			dgTableStyle.AlternatingBackColor = System.Drawing.Color.LemonChiffon;

			return dgTableStyle;
		}
		public static DataGridTableStyle GetStyleForBorrowShareInfo()
		{
			// creates the table style that's used for the datagrid
			DataGridTableStyle dgTableStyle = new DataGridTableStyle();

			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null, 
				"中文书名",
				"BookNameChn",
				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"英文书名",
				"BookNameEng",
				100));
//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
//				"借阅者",
//				"ShareTo",
//				50));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"拥有者",
				"ShareFrom",
				50));
//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn("d",
//				"计划借阅时间",
//				"PlanBeginDate",
//				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn("d",
				"计划还书时间",
				"PlanEndDate",
				100));
//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn("d",
//				"实际借阅时间",
//				"ActualBeginDate",
//				100));
			//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
			//				"实际还书时间",
			//				"ActualEndDate",
			//				100));
//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
//				"磨损",
//				"Depreciation",
//				45));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"当前状态",
				"Status",
				70));

			dgTableStyle.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			dgTableStyle.MappingName = "SHARE_INFO";
			dgTableStyle.RowHeadersVisible = false;
			dgTableStyle.AlternatingBackColor = System.Drawing.Color.LemonChiffon;

			return dgTableStyle;
		}
		public static DataGridTableStyle GetStyleForLendShareInfo()
		{
			// creates the table style that's used for the datagrid
			DataGridTableStyle dgTableStyle = new DataGridTableStyle();

			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null, 
				"中文书名",
				"BookNameChn",
				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"英文书名",
				"BookNameEnd",
				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"借阅者",
				"ShareTo",
				50));
//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
//				"拥有者",
//				"ShareFrom",
//				50));
			//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn("d",
			//				"计划借阅时间",
			//				"PlanBeginDate",
			//				100));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn("d",
				"计划还书时间",
				"PlanEndDate",
				100));
			//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn("d",
			//				"实际借阅时间",
			//				"ActualBeginDate",
			//				100));
			//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
			//				"实际还书时间",
			//				"ActualEndDate",
			//				100));
			//			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
			//				"磨损",
			//				"Depreciation",
			//				45));
			dgTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(null,
				"当前状态",
				"Status",
				70));

			dgTableStyle.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			dgTableStyle.MappingName = "SHARE_INFO";
			dgTableStyle.RowHeadersVisible = false;
			dgTableStyle.AlternatingBackColor = System.Drawing.Color.LemonChiffon;

			return dgTableStyle;
		}
	}
}
