/// <summary> /// 输入周查课表 /// </summary> private void KBNumSearch() { if (KBNumFlyoutTextBox.Text != "" && KBNumFlyoutTextBox.Text.IndexOf(".") == -1) { try { week = int.Parse(KBNumFlyoutTextBox.Text); HubSectionKBNum.Text = KBNumFlyoutTextBox.Text; KBNumFlyout.Hide(); ResultName = new string[7, 6][]; EmptyClass ec = new EmptyClass(week, forsearchlist); result = new ObservableCollection <ClassListLight>(); ec.getfreetime(result, termresult); showFreeKB(result, showWeekend); } catch (Exception) { Utils.Message("请输入正确的周次"); } } else { Utils.Message("请输入正确的周次"); } }
/// <summary> /// 输入周查课表 /// </summary> private async void KBNumSearch() { if (KBNumFlyoutTextBox.Text != "" && KBNumFlyoutTextBox.Text.IndexOf(".") == -1) { try { week = int.Parse(KBNumFlyoutTextBox.Text); FilterAppBarButton.Label = "第" + KBNumFlyoutTextBox.Text + "周"; KBNumFlyout.Hide(); ResultName = new string[7, 6][]; EmptyClass ec = new EmptyClass(week, forsearchlist); result = new ObservableCollection <ClassListLight>(); //ec.getfreetime(result, termresult); //await ec.getfreetimeasync(result, termresult); await GetData(ec); showFreeKB(result, showWeekend); } catch (Exception) { Utils.Message("请输入正确的周次"); } } else { Utils.Message("请输入正确的周次"); } }
private void KBNumSearchButton_Click(object sender, RoutedEventArgs e) { if (KBNumFlyoutTextBox.Text != "" && KBNumFlyoutTextBox.Text.IndexOf(".") == -1) { HubSectionKBNum.Text = KBNumFlyoutTextBox.Text; appSetting.Values["FreeWeek"] = KBNumFlyoutTextBox.Text; KBNumFlyout.Hide(); } else { Utils.Message("请输入正确的周次"); } }
private void KBNumSearchButton_Click(object sender, RoutedEventArgs e) { if (KBNumFlyoutTextBox.Text != "" && KBNumFlyoutTextBox.Text.IndexOf(".") == -1) { showKB(2, Int16.Parse(KBNumFlyoutTextBox.Text)); HubSectionKBNum.Text = "第" + KBNumFlyoutTextBox.Text + "周"; DateTime now = DateTime.Now; DateTime weekstart = GetWeekFirstDayMon(KBNumFlyoutTextBox.Text == "" ? now : now.AddDays((Int16.Parse(KBNumFlyoutTextBox.Text) - Int16.Parse(appSetting.Values["nowWeek"].ToString())) * 7)); DateTime weekend = GetWeekLastDaySun(KBNumFlyoutTextBox.Text == "" ? now : now.AddDays((Int16.Parse(KBNumFlyoutTextBox.Text) - Int16.Parse(appSetting.Values["nowWeek"].ToString())) * 7)); this.HubSectionKBDate.Text = weekstart.Month + "." + weekstart.Day + "--" + weekend.Month + "." + weekend.Day; KBNumFlyout.Hide(); } else { Utils.Message("请输入正确的周次"); } }