private void BindlstReecntTimes() { BindControl.BindListBox(lstReecntTimes, new List <KVEntity>()); if (rdoOneTimes.Checked) { if (cbxOneTimesHour.SelectedIndex == 0 || cbxOneTimesMinute.SelectedIndex == 0) { return; } } else { if (cbxMultiTimesMinute.SelectedIndex == 0) { return; } } string cronString = QuartzHelper.GenerateCronExpression(BuildCronExpression()); List <DateTime> list = QuartzHelper.GetNextFireTime(cronString, 8); List <KVEntity> kvList = list.Select(item => new KVEntity { K = item.ToString(), V = item.ToString() }).ToList(); BindControl.BindListBox(lstReecntTimes, kvList); }
private void BindlstReecntTimes() { BindControl.BindListBox(lstRecentTimes, new List <KVEntity>()); if (cbxHour.SelectedIndex == 0 || cbxMinute.SelectedIndex == 0 || chklstMonths.CheckedItems.Count == 0) { return; } string cronString = QuartzHelper.GenerateCronExpression(_cronExpressionEntity); List <DateTime> list = QuartzHelper.GetNextFireTime(cronString, 8); List <KVEntity> kvList = list.Select(item => new KVEntity { K = item.ToString(), V = item.ToString() }).ToList(); BindControl.BindListBox(lstRecentTimes, kvList); }
private void PreviewPalnExcuteTimeFrm_Load(object sender, EventArgs e) { try { lblTaskName.Text = _TaskName; List <DateTime> dateTimeList = QuartzHelper.GetNextFireTime(_CronString, 50); List <KVEntity> list = dateTimeList.Select(item => new KVEntity { K = item.ToString("yyyy-MM-dd HH:mm:ss") }).ToList(); BindControl.BindListBox(lstList, list); } catch (Exception ex) { base.ShowErrorMessage($"Cron表达解析错误,错误信息:[{ex.Message}]"); } }