コード例 #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;
        }
コード例 #2
0
        /// <summary>
        /// Adds the entry.
        /// </summary>
        /// <param name="newEntry">The new entry.</param>
        /// <exception cref="TimesheetProgramLogic.EntriesNotInSameMonthException">blah blah blah</exception>
        /// <exception cref="TimesheetProgramLogic.ProjectCantBeBillableAndAccountableException">blha blha blha</exception>
        /// <exception cref="EntriesNotInSameMonthException">Occurs when all entries aren't in the same month</exception>
        /// <exception cref="ProjectCantBeBillableAndAccountableException">Occurs when the project is both billable and accountable</exception>
        public void AddEntry(Entry newEntry)
        {
            if (Timesheet.Entries.Count == 0)
            {
                Timesheet.Month = newEntry.Date.Month;
                Timesheet.Year  = newEntry.Date.Year;
                Timesheet.UpdateMonthAndYear(newEntry.Date.Month, newEntry.Date.Year);
            }

            VerifyEntry(newEntry, true);

            InsertEntry(newEntry);
            UnsavedChanges = true;
        }