Exemplo n.º 1
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            Boolean check = false;
            String  index = textbox2.Text;

            if ((index[1] == '/') || (index[2] == '/'))
            {
                check = true;
            }
            if ((textbox2.Text != null) && (check == true))
            {
                birthday item = new birthday {
                    Username = "******", Time = textbox2.Text, Name = textbox1.Text
                };
                InsertBirth(item);
                try
                {
                }
                catch (MobileServiceInvalidOperationException e1)
                {
                    MessageBox.Show(e1.Message, "添加信息成功!", MessageBoxButton.OK);
                }
            }
            else
            {
                try
                {
                }
                catch (MobileServiceInvalidOperationException e2)
                {
                    MessageBox.Show(e2.Message, "输入格式错误!", MessageBoxButton.OK);
                }
            }
        }
Exemplo n.º 2
0
 private async void InsertBirth(birthday birth)
 {
     await todoTable.InsertAsync(birth);
 }