private async void DateDialogPrimaryButton_Click(object sender, RoutedEventArgs e) { try { var today = DateTime.Now; var count = Convert.ToInt32(DaysTextBox.Text); if (today.AddDays(count) > Convert.ToDateTime("2120/12/31")) { PopupNotice popupNotice = new PopupNotice("超出了最大范围"); popupNotice.ShowAPopup(); } var res = today.AddDays(count); Add_Picker.Date = Convert.ToDateTime(res); } catch (FormatException e0) { } catch (Exception e1) { MessageDialog message = new MessageDialog("异常类型:" + e1.ToString() + "影响使用的话请及时反馈。", "发生异常!"); await message.ShowAsync(); } DaysTextBox.Text = ""; DateDialog.Hide(); }
public void datecaller() { DateDialog start = new DateDialog("Enter Start Date"); start.ShowDialog(); date1 = start.dateselected; DateDialog end = new DateDialog("Enter End Date"); end.ShowDialog(); date2 = end.dateselected; CustomerSelectDialog custtt = new CustomerSelectDialog("Please Select Customer"); custtt.ShowDialog(); customer = custtt.custselected; GPData.ReportData(date1, date2, customer); }
private void DateDialogCloseButton_Click(object sender, RoutedEventArgs e) { DaysTextBox.Text = ""; DateDialog.Hide(); }
private async void DateChooseBtn_Click(object sender, RoutedEventArgs e) { await DateDialog.ShowAsync(); }