Beispiel #1
0
        // Calculations
        // --------------------------------------------------------------------------
        #region Calculations
        public int GetDayTypeCount(DayType dayType)
        {
            int count = 0;

            // Calculate only VALID TimesheetDates!
            foreach (Timesheet timesheet in this.Timesheets)
            {
                count += timesheet.GetDayTypeCount(dayType);
            }

            return(count);
        }
Beispiel #2
0
        // Calculations
        // --------------------------------------------------------------------------
        #region Calculations
        /// <summary>
        /// Returns the count for the DayType.
        /// </summary>
        /// <param name="dayType">The DayType to query.</param>
        /// <returns>The DayType count found in this Timesheet.</returns>
        /// <remarks>If IsValidDate return false, that date is not included in the final count.</remarks>
        public int GetDayTypeCount(DayType dayType)
        {
            int count = 0;

            // Calculate only VALID TimesheetDates!
            foreach (TimesheetDate timesheetDate in this.Dates.Where(p => p.IsValidDate))
            {
                if (timesheetDate.DayType == dayType)
                {
                    ++count;
                }
            }

            return(count);
        }
Beispiel #3
0
 private void InsertDayTypesListViewItem(DayType dayType)
 {
     ListViewItem timesheetDateListViewItem = CreateDayTypesListViewItem(dayType);
     m_dayTypes.Items.Add(timesheetDateListViewItem);
 }
Beispiel #4
0
        private ListViewItem CreateDayTypesListViewItem(DayType dayType)
        {
            ListViewItem listViewItem = new ListViewItem(dayType.Name);

            listViewItem.ImageIndex = 0;
            listViewItem.SubItems.Add(dayType.Description);

            listViewItem.Tag = dayType;

            return listViewItem;
        }
 public TimesheetDate(Timesheet timesheet, DateTime date, decimal billableHours, DayType dayType, string notes)
 {
     this.Timesheet     = timesheet;
     this.Date          = date;
     this.BillableHours = billableHours;
     this.DayType       = dayType;
     this.Notes         = notes;
 }
        public int GetDayTypeCount(DayType dayType)
        {
            int count = 0;

            // Calculate only VALID TimesheetDates!
            foreach (MonthlyTimesheets monthlyTimesheet in this.MonthlyTimesheets) {
                count += monthlyTimesheet.GetDayTypeCount(dayType);
            }

            return count;
        }