private void Button_Confirm_Click(object sender, RoutedEventArgs e)
        {
            temp_currenttime = CommonFunc.GetZoneTime(GlobalVar._timezoneId);
            temp_starttime   = GetStartTime();
            temp_endtime     = GetEndTime();

            if (CheckData())
            {
                for (int i = 0; i < GetRepeatDays(); i++)
                {
                    RecObj recObj = new RecObj
                    {
                        Channel     = GetChannel(),
                        ChannelLink = GetChannelLink(),
                        StartTime   = temp_starttime.AddDays(i),
                        EndTime     = temp_endtime,
                        Duration    = GetDuration(),
                        TimeZoneId  = GlobalVar._timezoneId,
                        Status      = RecObj.RecordStatus.Scheduled,
                        Log         = "",
                        RetryTimes  = 0,
                    };

                    recObj.Initialization();
                    GlobalVar._RecObjs.Add(recObj);
                }

                base.OnCloseDialog(this, true, e);
            }
        }
Example #2
0
        private void AddRetryRecord()
        {
            if (RetryTimes >= Parameter.retry_times_limit)
            {
                return;
            }

            DateTime starttime = GetRetryStartTime();

            if (IsNearTheEndTime(starttime))
            {
                return;
            }

            RecObj recObj = new RecObj
            {
                Channel     = Channel,
                ChannelLink = ChannelLink,
                StartTime   = starttime,
                EndTime     = EndTime,
                Duration    = GetRetryDuration(starttime, EndTime),
                TimeZoneId  = TimeZoneId,
                Status      = RecObj.RecordStatus.WaitForRetry,
                Log         = "",
                RetryTimes  = this.RetryTimes + 1,
            };

            recObj.Initialization();
            GlobalVar._RecObjs.Add(recObj);
        }