Ejemplo n.º 1
0
        /// <summary>
        /// Reads the build.
        /// </summary>
        /// <param name="filename">The filename.</param>
        public void ReadBuild(string filename)
        {
            Parse(filename);
            DateTime date = Timesheet.GetADate();

            Timesheet.UpdateMonthAndYear(date.Month, date.Year);
            UnsavedChanges = false;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Reads the XML.
        /// </summary>
        /// <param name="filename">The filename.</param>
        public void ReadXML(string filename)
        {
            Timesheet timesheet    = Serialization.DeserializeTimesheet(filename);
            bool      isFirstEntry = true;

            foreach (Entry entry in timesheet.Entries)
            {
                if (isFirstEntry)
                {
                    Timesheet.Month = entry.Date.Month;
                    Timesheet.Year  = entry.Date.Year;
                    New();
                    isFirstEntry = false;
                }

                AddEntry(entry);
            }

            DateTime aDate = Timesheet.GetADate();

            Timesheet.Month = aDate.Month;
            Timesheet.Year  = aDate.Year;
            UnsavedChanges  = false;
        }