Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 private void InsertDayTypesListViewItem(DayType dayType)
 {
     ListViewItem timesheetDateListViewItem = CreateDayTypesListViewItem(dayType);
     m_dayTypes.Items.Add(timesheetDateListViewItem);
 }
Exemplo n.º 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;
        }
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 6
0
        public int GetDayTypeCount(DayType dayType)
        {
            int count = 0;

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

            return count;
        }