using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Gestor_de_Contenidos
{
    public partial class frm_nuevo_paciente : Form
    {
        private Paciente paciente;
        public frm_nuevo_paciente()
        {
            InitializeComponent();
        }

        private void btn_aceptar_Click(object sender, EventArgs e)
        {
            if (!tb_nombre.Text.Equals("") && !tb_apellidos.Text.Equals("") && dateTimePicker1.Value != null)
            {
                if (dateTimePicker1.Value.CompareTo(System.DateTime.Today) <= 0)
                {
                    paciente = new Paciente(tb_nombre.Text, tb_apellidos.Text, dateTimePicker1.Value);
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                    lbl_fecha_maxima.Visible = true;
            }

            else 
            {
                lbl_rellene_todo.Visible = true;         
            }
        }

        public Paciente getPaciente(){return paciente;}

        private void btn_cancelar_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
