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>
	/// BetItem item in the bet history list
	/// </summary>
	public class BetItem : System.Windows.Forms.UserControl
	{
		private System.Windows.Forms.Label lblBetID;
		private System.Windows.Forms.Label lblDesc;
		private System.Windows.Forms.Label lblBidType;
		private System.Windows.Forms.Label lblPlaced;
		private System.Windows.Forms.Label lblPrice;
		private System.Windows.Forms.Label lblSize;
		private System.Windows.Forms.Label lblPL;
		private System.Windows.Forms.Label lblResult;

		public BetItem(long betID, string desc, string type, DateTime placed, double price, double size, double pl, string result)
		{
			InitializeComponent();
			
			lblBetID.Text = betID.ToString();
			lblDesc.Text = desc;
			lblBidType.Text = type;
			lblPlaced.Text = placed.ToString();
			lblPrice.Text = price.ToString("0.00");
			lblSize.Text = size.ToString("0.00");

            if (pl < 0)
            {
                lblPL.ForeColor = Color.Red;
            }

			lblPL.Text = pl.ToString("0.00");

            if (result.ToLower() == "lost")
            {
                lblResult.ForeColor = Color.Red;
            }

			lblResult.Text = result;
		}

		#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.lblBetID = new System.Windows.Forms.Label();
            this.lblDesc = new System.Windows.Forms.Label();
            this.lblBidType = new System.Windows.Forms.Label();
            this.lblPlaced = new System.Windows.Forms.Label();
            this.lblPrice = new System.Windows.Forms.Label();
            this.lblSize = new System.Windows.Forms.Label();
            this.lblPL = new System.Windows.Forms.Label();
            this.lblResult = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // lblBetID
            // 
            this.lblBetID.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblBetID.Location = new System.Drawing.Point(0, 0);
            this.lblBetID.Name = "lblBetID";
            this.lblBetID.Size = new System.Drawing.Size(100, 32);
            this.lblBetID.TabIndex = 0;
            this.lblBetID.Text = "BetID";
            this.lblBetID.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // lblDesc
            // 
            this.lblDesc.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblDesc.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblDesc.Location = new System.Drawing.Point(97, 0);
            this.lblDesc.Name = "lblDesc";
            this.lblDesc.Size = new System.Drawing.Size(200, 32);
            this.lblDesc.TabIndex = 1;
            this.lblDesc.Text = "Desc";
            // 
            // lblBidType
            // 
            this.lblBidType.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblBidType.Location = new System.Drawing.Point(296, 0);
            this.lblBidType.Name = "lblBidType";
            this.lblBidType.Size = new System.Drawing.Size(72, 32);
            this.lblBidType.TabIndex = 2;
            this.lblBidType.Text = "Type";
            this.lblBidType.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(367, 0);
            this.lblPlaced.Name = "lblPlaced";
            this.lblPlaced.Size = new System.Drawing.Size(72, 32);
            this.lblPlaced.TabIndex = 3;
            this.lblPlaced.Text = "Placed";
            // 
            // lblPrice
            // 
            this.lblPrice.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblPrice.Location = new System.Drawing.Point(438, 0);
            this.lblPrice.Name = "lblPrice";
            this.lblPrice.Size = new System.Drawing.Size(56, 32);
            this.lblPrice.TabIndex = 4;
            this.lblPrice.Text = "Price";
            this.lblPrice.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // lblSize
            // 
            this.lblSize.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblSize.Location = new System.Drawing.Point(493, 0);
            this.lblSize.Name = "lblSize";
            this.lblSize.Size = new System.Drawing.Size(64, 32);
            this.lblSize.TabIndex = 5;
            this.lblSize.Text = "Size";
            this.lblSize.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // lblPL
            // 
            this.lblPL.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblPL.Location = new System.Drawing.Point(556, 0);
            this.lblPL.Name = "lblPL";
            this.lblPL.Size = new System.Drawing.Size(56, 32);
            this.lblPL.TabIndex = 6;
            this.lblPL.Text = "P/L";
            this.lblPL.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // lblResult
            // 
            this.lblResult.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.lblResult.Location = new System.Drawing.Point(611, 0);
            this.lblResult.Name = "lblResult";
            this.lblResult.Size = new System.Drawing.Size(69, 32);
            this.lblResult.TabIndex = 7;
            this.lblResult.Text = "Result";
            this.lblResult.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // BetItem
            // 
            this.BackColor = System.Drawing.SystemColors.Window;
            this.Controls.Add(this.lblResult);
            this.Controls.Add(this.lblPL);
            this.Controls.Add(this.lblSize);
            this.Controls.Add(this.lblPrice);
            this.Controls.Add(this.lblPlaced);
            this.Controls.Add(this.lblBidType);
            this.Controls.Add(this.lblDesc);
            this.Controls.Add(this.lblBetID);
            this.Name = "BetItem";
            this.Size = new System.Drawing.Size(680, 32);
            this.ResumeLayout(false);

		}
		#endregion
	}
}
