using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using banco1.domain;

namespace banco1.presentacion
{
	/// <summary>
	/// Descripción breve de FCliente.
	/// </summary>
	public class FCliente : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.TextBox tfNombre;
		private System.Windows.Forms.TextBox tfApellidos;
		private System.Windows.Forms.TextBox tfNIF;
		private System.Windows.Forms.Button bCrear;
		/// <summary>
		/// Variable del diseñador requerida.
		/// </summary>
		private System.ComponentModel.Container components = null;

		//******
		protected Cliente mCliente;

		public FCliente()
		{
			//
			// Necesario para admitir el Diseñador de Windows Forms
			//
			InitializeComponent();

			//
			// TODO: Agregar código de constructor después de llamar a InitializeComponent
			//
		}

		/// <summary>
		/// Limpiar los recursos que se estén utilizando.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Método necesario para admitir el Diseñador, no se puede modificar
		/// el contenido del método con el editor de código.
		/// </summary>
		private void InitializeComponent()
		{
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.tfNombre = new System.Windows.Forms.TextBox();
			this.tfApellidos = new System.Windows.Forms.TextBox();
			this.tfNIF = new System.Windows.Forms.TextBox();
			this.bCrear = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(16, 24);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(64, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "Nombre:";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(16, 56);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(64, 16);
			this.label2.TabIndex = 1;
			this.label2.Text = "Apellidos:";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(16, 88);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(56, 16);
			this.label3.TabIndex = 2;
			this.label3.Text = "NIF:";
			// 
			// tfNombre
			// 
			this.tfNombre.Location = new System.Drawing.Point(80, 16);
			this.tfNombre.Name = "tfNombre";
			this.tfNombre.Size = new System.Drawing.Size(192, 20);
			this.tfNombre.TabIndex = 3;
			this.tfNombre.Text = "";
			// 
			// tfApellidos
			// 
			this.tfApellidos.Location = new System.Drawing.Point(80, 48);
			this.tfApellidos.Name = "tfApellidos";
			this.tfApellidos.Size = new System.Drawing.Size(192, 20);
			this.tfApellidos.TabIndex = 4;
			this.tfApellidos.Text = "";
			// 
			// tfNIF
			// 
			this.tfNIF.Location = new System.Drawing.Point(80, 80);
			this.tfNIF.Name = "tfNIF";
			this.tfNIF.Size = new System.Drawing.Size(88, 20);
			this.tfNIF.TabIndex = 5;
			this.tfNIF.Text = "";
			// 
			// bCrear
			// 
			this.bCrear.Location = new System.Drawing.Point(200, 80);
			this.bCrear.Name = "bCrear";
			this.bCrear.Size = new System.Drawing.Size(72, 24);
			this.bCrear.TabIndex = 6;
			this.bCrear.Text = "Crear";
			this.bCrear.Click += new System.EventHandler(this.bCrear_Click);
			// 
			// FCliente
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(296, 125);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.bCrear,
																		  this.tfNIF,
																		  this.tfApellidos,
																		  this.tfNombre,
																		  this.label3,
																		  this.label2,
																		  this.label1});
			this.Name = "FCliente";
			this.Text = "Creación de clientes";
			this.ResumeLayout(false);

		}
		#endregion

		private void bCrear_Click(object sender, System.EventArgs e)
		{
			mCliente=new Cliente(this.tfNombre.Text, this.tfApellidos.Text, this.tfNIF.Text);
			this.Dispose(true);
		}

		public Cliente cliente
		{
			get { return mCliente; }
		}
	}
}
