using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using FingersDance.Data;

namespace FingersDance.Control.SessionInput
{
    /// <summary>
    /// Interaction logic for UserControlNewProject.xaml
    /// </summary>
    public partial class UserControlNewProject : UserControl
    {
        public event EventHandler EH_NewProject_ContactDown;
        public Project Project = new Project();
        User _User = new User();

        public UserControlNewProject(User u)
        {
            InitializeComponent();
            ST_Date.Text = DateTime.Now.Day.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString();
            _User = u;


        }

        #region Actions

        private void SurfaceButtonSubmit_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
        {
            Project = new Project(_User, new Cutting());   
            if (EH_NewProject_ContactDown != null)
                EH_NewProject_ContactDown(this, new EventArgs());
        }

        private void SurfaceButtonSubmit_Click(object sender, RoutedEventArgs e)
        {
            Project = new Project(ST_ProjectName.Text, ST_Date.Text, ST_Desc.Text, _User, new Cutting());
            if (EH_NewProject_ContactDown != null)
                EH_NewProject_ContactDown(this, new EventArgs());   
        }

        #endregion
    }
}
