public void SetDataContextEventScheduleViewModel(Wlst.client.EventSchedule eventSchedule)
 {
     if (eventSchedule == null)
     {
         DataContext = new EventScheduleViewModel();
     }
     else
     {
         DataContext = new EventScheduleViewModel(eventSchedule);
     }
 }
예제 #2
0
        public EventScheduleViewModel(Wlst.client.EventSchedule info)
        {
            this.StartDate    = new DateTime(info.StartDate);
            this.StartHour    = info.StartHour;
            this.StartMinutes = info.StartMinutes;
            if (info.IsCheckNoEndDate)
            {
                this.IsCheckNoEndDate = true;
                this.RepeatTimes      = 1;
            }
            if (info.IsCheckRepeatTime)
            {
                this.IsCheckRepeatTime = true;
                this.RepeatTimes       = info.RepeatTimes;
            }

            this.EveryHours         = 1;
            this.EveryDays          = 1;
            this.EveryMinuters      = 15;
            this.EveryMonths        = 1;
            this.EveryWeeks         = 1;
            this.EveryYearMonth     = 1;
            this.EveryYearMonthDate = 1;
            this.EveryMonthDate     = 1;

            if (info.IsCheckEveryMinute)
            {
                this.IsCheckEveryMinute = true;
                this.EveryMinuters      = info.EveryMinuters;
            }
            else if (info.IsCheckEveryHour)
            {
                this.IsCheckEveryHour = true;
                this.EveryHours       = info.EveryHours;
            }
            else if (info.IsCheckEveryDay)
            {
                this.IsCheckEveryDay = true;
                this.EveryDays       = info.EveryDays;
            }
            else if (info.IsCheckEveryWeek)
            {
                this.IsCheckEveryWeek = true;
                this.EveryWeeks       = info.EveryWeeks;
                this.IsCheckedMon     = info.IsCheckedMon;
                this.IsCheckedTue     = info.IsCheckedTue;
                this.IsCheckedWen     = info.IsCheckedWen;
                this.IsCheckedThr     = info.IsCheckedThr;
                this.IsCheckedFri     = info.IsCheckedFri;
                this.IsCheckedSta     = info.IsCheckedSta;
                this.IsCheckedSun     = info.IsCheckedSun;
            }
            else if (info.IsCheckEveryMonth)
            {
                this.IsCheckEveryMonth = true;
                this.EveryMonths       = info.EveryMonths;
                this.EveryMonthDate    = info.EveryMonthDate;
            }
            else if (info.IsCheckEveryYear)
            {
                this.IsCheckEveryYear   = true;
                this.EveryYearMonth     = info.EveryYearMonth;
                this.EveryYearMonthDate = info.EveryYearMonthDate;
            }
        }