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 DateTime GetRetryStartTime()
        {
            Random rnd       = new Random();
            int    delay_sec = rnd.Next(Parameter.retry_wait_min_sec, Parameter.retry_wait_max_sec);

            return(CommonFunc.GetZoneTime(TimeZoneId).AddSeconds(delay_sec));
        }
        private void InitailStartTimeDatePicker()
        {
            DateTime currentdate = CommonFunc.GetZoneTime(GlobalVar._timezoneId).Date;
            DateTime yesterdate  = currentdate.AddDays(-1);

            datepicker_startdate.SelectedDate = currentdate;
            datepicker_startdate.BlackoutDates.Add(new CalendarDateRange(DateTime.MinValue, new DateTime(yesterdate.Year, yesterdate.Month, yesterdate.Day)));
        }
        private void AutoFillInDatePicker()
        {
            DateTime currenttime = CommonFunc.GetZoneTime(GlobalVar._timezoneId);
            DateTime date        = CommonFunc.SetZoneTime(GlobalVar._timezoneId,
                                                          currenttime.Date,
                                                          Convert.ToInt32(tb_starttime_hour.Text),
                                                          Convert.ToInt32(tb_starttime_min.Text));

            if (IsPreviousTime(date, currenttime))
            {
                datepicker_startdate.SelectedDate = date.AddDays(1).Date;
            }
            else
            {
                datepicker_startdate.SelectedDate = date.Date;
            }
        }
 private void InitailEndTime()
 {
     tb_endtime_hour.Text = CommonFunc.GetZoneTime(GlobalVar._timezoneId).AddHours(1).Hour.ToString("00");
     tb_endtime_min.Text  = CommonFunc.GetZoneTime(GlobalVar._timezoneId).Minute.ToString("00");
 }
Example #6
0
        private bool IsEndEarlier()
        {
            DateTime currenttime = CommonFunc.GetZoneTime(TimeZoneId);

            return(!IsNearTheEndTime(currenttime));
        }