예제 #1
0
        // IXmlable Members
        // --------------------------------------------------------------------------
        #region IXmlable Members
        public void FromXml(MonthlyTimesheets monthlyTimesheets, XElement element)
        {
            this.Initialize();
            this.MonthlyTimesheets = monthlyTimesheets;

            this.WeekIndex     = Convert.ToInt32(element.Attribute("weekIndex").Value);
            this.SplitIndex    = Convert.ToInt32(element.Attribute("splitIndex").Value);
            this.TimesheetSent = Convert.ToBoolean(element.Attribute("timesheetSent").Value);

            foreach (XElement timesheetDateElement in element.XPathSelectElements("./timesheetDate"))
            {
                TimesheetDate timesheetDate = new TimesheetDate(this, timesheetDateElement);
                this.Dates.Add(timesheetDate);
            }
        }
예제 #2
0
        // General Methods
        // --------------------------------------------------------------------------
        #region General Methods
        protected virtual void LoadDates(DateTime startDate, DateTime endDate)
        {
            DateTime date = startDate;

            while (date <= endDate)
            {
                TimesheetDate timesheetDate = new TimesheetDate(this, date);
                this.Dates.Add(timesheetDate);
                date = date.AddDays(1);
            }

            // Note: DO NOT kick off the timesheet changed event because the timesheet
            // values have not been initialized. It is the programmer's responsibility
            // to call this event upon initializing the timeseet date values...

            //if (this.TimesheetChangedEvent != null) {
            //   this.TimesheetChangedEvent(this, new TimesheetChangedEventArgs(this));
            //}
        }
예제 #3
0
 public TimesheetDateChangedEventArgs(TimesheetDate timesheetDate)
 {
     this.TimesheetDate = timesheetDate;
 }