using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace Betfair.Gamex.API.UberClient.Controls
{
	/// <summary>
	/// AccountItem shows a single account item entry
	/// </summary>
	public class AccountItem : System.Windows.Forms.UserControl
	{
		private System.Windows.Forms.Label lblType;
		private System.Windows.Forms.Label lblPlaced;
		private System.Windows.Forms.Label lblSettled;
		private System.Windows.Forms.Label lblDetails;
		private System.Windows.Forms.Label lblAmount;
		private System.Windows.Forms.Label lblBalance;

		public AccountItem(string type, DateTime placed, DateTime settled, string details, double amount, double balance)
		{
			InitializeComponent();

			lblType.Text = type;
			lblPlaced.Text = placed.ToString();
			lblSettled.Text = placed.ToString();
			lblDetails.Text = details;

            if (amount < 0)
            {
                lblAmount.ForeColor = Color.Red;
            }

			lblAmount.Text = amount.ToString("0.00");

            if (balance < 0)
            {
                lblBalance.ForeColor = Color.Red;
            }

			lblBalance.Text = balance.ToString("0.00");
		}

		#region Component Designer generated code
		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.lblType = new System.Windows.Forms.Label();
            this.lblPlaced = new System.Windows.Forms.Label();
            this.lblSettled = new System.Windows.Forms.Label();
            this.lblDetails = new System.Windows.Forms.Label();
            this.lblAmount = new System.Windows.Forms.Label();
            this.lblBalance = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // lblType
            // 
            this.lblType.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblType.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblType.Location = new System.Drawing.Point(0, 0);
            this.lblType.Name = "lblType";
            this.lblType.Size = new System.Drawing.Size(64, 32);
            this.lblType.TabIndex = 0;
            this.lblType.Text = "Type";
            this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // lblPlaced
            // 
            this.lblPlaced.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblPlaced.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblPlaced.Location = new System.Drawing.Point(63, 0);
            this.lblPlaced.Name = "lblPlaced";
            this.lblPlaced.Size = new System.Drawing.Size(64, 32);
            this.lblPlaced.TabIndex = 1;
            this.lblPlaced.Text = "Placed";
            this.lblPlaced.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // lblSettled
            // 
            this.lblSettled.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblSettled.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblSettled.Location = new System.Drawing.Point(126, 0);
            this.lblSettled.Name = "lblSettled";
            this.lblSettled.Size = new System.Drawing.Size(72, 32);
            this.lblSettled.TabIndex = 2;
            this.lblSettled.Text = "Settled";
            this.lblSettled.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // lblDetails
            // 
            this.lblDetails.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblDetails.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblDetails.Location = new System.Drawing.Point(197, 0);
            this.lblDetails.Name = "lblDetails";
            this.lblDetails.Size = new System.Drawing.Size(165, 32);
            this.lblDetails.TabIndex = 3;
            this.lblDetails.Text = "Details";
            this.lblDetails.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // lblAmount
            // 
            this.lblAmount.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblAmount.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblAmount.Location = new System.Drawing.Point(361, 0);
            this.lblAmount.Name = "lblAmount";
            this.lblAmount.Size = new System.Drawing.Size(56, 32);
            this.lblAmount.TabIndex = 4;
            this.lblAmount.Text = "Amount";
            this.lblAmount.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // lblBalance
            // 
            this.lblBalance.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblBalance.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblBalance.Location = new System.Drawing.Point(416, 0);
            this.lblBalance.Name = "lblBalance";
            this.lblBalance.Size = new System.Drawing.Size(56, 32);
            this.lblBalance.TabIndex = 5;
            this.lblBalance.Text = "Balance";
            this.lblBalance.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // AccountItem
            // 
            this.BackColor = System.Drawing.SystemColors.Window;
            this.Controls.Add(this.lblBalance);
            this.Controls.Add(this.lblAmount);
            this.Controls.Add(this.lblDetails);
            this.Controls.Add(this.lblSettled);
            this.Controls.Add(this.lblPlaced);
            this.Controls.Add(this.lblType);
            this.Name = "AccountItem";
            this.Size = new System.Drawing.Size(472, 32);
            this.ResumeLayout(false);

		}
		#endregion
	}
}
