Ejemplo n.º 1
0
        private void SetDefaulValues()
        {
            tbEndAfter.Text    = "1";
            rbEndBy.Checked    = false;
            rbEndAfter.Checked = true;

            using (IDataReader reader = CalendarEntry.GetEventDates(EventId))
            {
                if (reader.Read())
                {
                    dtcDateStart.SelectedDate = (DateTime)reader["StartDate"];
                    dtcDateEnd.SelectedDate   = (DateTime)reader["FinishDate"];
                    dtcTimeStart.SelectedDate = (DateTime)reader["StartDate"];
                    dtcTimeEnd.SelectedDate   = (DateTime)reader["FinishDate"];
                }
                else
                {
                    dtcTimeStart.SelectedDate = UserDateTime.UserNow;
                    dtcTimeEnd.SelectedDate   = UserDateTime.UserNow.AddHours(1);
                }
            }

            for (byte i = 4; i >= 1; i--)
            {
                Pattern = i;
                for (byte j = 2; j >= 1; j--)
                {
                    SubPattern  = j;
                    Frequency   = 5;
                    Weekdays    = (byte)CalendarEntry.GetBitDayOfWeek(UserDateTime.UserNow.DayOfWeek);
                    MonthDay    = (byte)UserDateTime.UserNow.Day;
                    WeekNumber  = (byte)(UserDateTime.UserNow.Day / 7 + 1);
                    MonthNumber = (byte)UserDateTime.UserNow.Month;
                }
            }
        }