using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using System.Xml.Xsl;

namespace IT_Project_2014
{
    public partial class WebForm3 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            LoadDescription();

            if (Global.GetRegisteredCount() >= Global.GetMaxRegisteredCount())
            {
                register_container.InnerHtml = "Rejestracja zakończona! Wszystkie miejsca zajętę!";
            }
        }

        protected void LoadDescription()
        {
            Label1_NazwaWydarzenia.Text = Server.HtmlDecode(Global.LoadVariableFromXml("title"));
            TextBox_description.Text = Server.HtmlDecode(Global.LoadVariableFromXml("description"));
        }

        private void EditXmlContent(XmlDataSource doc, string tag, string value)
        {
        }

        protected void Button1_Rejestruj_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                String name = TextBox1_Imie.Text;
                String surname = TextBox2_Nazwisko.Text;
                String email = TextBox3_Email.Text;

                Global.AddToRegisteredList(TextBox1_Imie.Text, TextBox2_Nazwisko.Text, TextBox3_Email.Text);
                Response.Redirect("RegisterSuccess.html");
            }

        }

    }
}