Exemplo n.º 1
0
        private async void BirthDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            if (PersonalBirthday.Text == "未设置")
            {
                MessageDialog AboutDialog = new MessageDialog("您还没有设置生日哦,赶紧去设置吧。", "提示");
                await AboutDialog.ShowAsync();

                BirthDialog.Hide();
            }
            else
            {
                try
                {
                    DateTime birthday  = Convert.ToDateTime(PersonalBirthday.Text);
                    string   Tip       = "";
                    string   _birthday = birthday.ToString("yyyy-MM-dd");
                    All.Current.conn.Insert(new DataTemple()
                    {
                        Schedule_name = "出生日", CalculatedDate = CustomData.Calculator(_birthday), Date = _birthday, BgColor = "#fffbb612", TintOpacity = 0.7, IsTop = "0", AddTime = ""
                    });
                    localSettings.Values["出生日" + _birthday] = Tip;
                    MainPage.Current.MyNav.SelectedItem     = MainPage.Current.MyNav.MenuItems[0];
                    Frame.Navigate(typeof(All));
                    PopupNotice popupNotice = new PopupNotice("添加成功");
                    popupNotice.ShowAPopup();
                }
                catch
                {
                    MessageDialog AboutDialog = new MessageDialog("您已经添加过了哦。", "提示");
                    await AboutDialog.ShowAsync();
                }
            }
        }
Exemplo n.º 2
0
 private async void BirthCreate_Tapped(object sender, TappedRoutedEventArgs e)
 {
     await BirthDialog.ShowAsync();
 }
Exemplo n.º 3
0
 private void BirthDialogCloseButton_Click(object sender, RoutedEventArgs e)
 {
     BirthDialog.Hide();
 }