private void HoursAccounting_Load(object sender, EventArgs e)
        {
            Login loginForm = new Login();
            loginForm.ShowDialog();

            txtDate.Text = DateTime.Now.ToShortDateString();

            if (File.Exists(_xmlFilePath))
            {
                TextReader tr = null;
                try
                {
                    XmlSerializer serializer = new XmlSerializer(typeof(TimeEntry[]));
                    tr = new StreamReader(_xmlFilePath);
                    TimeEntry[] data = (TimeEntry[])serializer.Deserialize(tr);
                    foreach( TimeEntry time in data)
                    {
                        ListViewItem item = lvHours.Items.Add(new ListViewItem(new string[] { time.Key.Day.ToShortDateString(), time.Key.Type, time.Key.Project, time.Key.Activity, time.Duration.ToString() }));
                        _hours.Add(time.Key, new TimeProps(item, time));
                    }

                }
                finally
                {
                    if (tr != null) tr.Close();
                }
            }
        }
        private void HoursAccounting_Load(object sender, EventArgs e)
        {
            Login loginForm = new Login();
            loginForm.ShowDialog();

            if (string.IsNullOrEmpty(SessionId)) this.Close();

            txtDate.Text = DateTime.Now.ToShortDateString();
            findProject.SessionId = SessionId;
            findActivity.SessionId = SessionId;

            findProject.FinderParams.Add("level", "1");
            findActivity.FinderParams.Add("level", "2");

            findProject.CodeChanged += new HoursAccountability.Controls.CodeNameFinder.CodeChangedEventHandler(findProject_CodeChanged);

            if (File.Exists(_xmlFilePath))
            {
                TextReader tr = null;
                try
                {
                    XmlSerializer serializer = new XmlSerializer(typeof(TimeEntry[]));
                    tr = new StreamReader(_xmlFilePath);
                    TimeEntry[] data = (TimeEntry[])serializer.Deserialize(tr);
                    foreach( TimeEntry time in data)
                    {
                        ListViewItem item = lvHours.Items.Add(new ListViewItem(new string[] { time.Key.Day.ToShortDateString(), time.Key.Type, time.Key.Project, time.Key.Activity, time.Duration.ToString() }));
                        _hours.Add(time.Key, new TimeProps(item, time));
                    }

                }
                finally
                {
                    if (tr != null) tr.Close();
                }
            }
        }