void loadMembers()
        {
            Wcf_GetdataClient client = new Wcf_GetdataClient();

            client.GetAllMemberCompleted += new EventHandler <GetAllMemberCompletedEventArgs>(client_GetAllMemberCompleted);
            client.GetAllMemberAsync();
        }
        private void SearchText_TextChanged(object sender, TextChangedEventArgs e)
        {
            Wcf_GetdataClient client = new Wcf_GetdataClient();

            client.SearchCompleted += new EventHandler <SearchCompletedEventArgs>(client_SearchCompleted);
            client.SearchAsync(SearchText.Text);
        }
Beispiel #3
0
        private void CreateBtn_Click(object sender, RoutedEventArgs e)
        {
            Wcf_GetdataClient client = new Wcf_GetdataClient();

            client.CreateMemberCompleted += new EventHandler <AsyncCompletedEventArgs>(client_CreateMemberCompleted);
            client.CreateMemberAsync(new Member()
            {
                Account    = Account.Text,
                Password   = Password.Text,
                ChName     = ChName.Text,
                NickName   = NickName.Text,
                Email      = Email.Text,
                CreateTime = DateTime.Now
            });
        }
        private void InsertBtn_Click(object sender, RoutedEventArgs e)
        {
            Wcf_GetdataClient client = new Wcf_GetdataClient();

            client.EditCompleted += new EventHandler <AsyncCompletedEventArgs>(client_EditCompleted);
            client.EditAsync(new Member()
            {
                Account  = Account.Text,
                Password = Password.Text,
                ChName   = ChName.Text,
                NickName = NickName.Text,
                Email    = Email.Text,
            });
            this.DialogResult = true;
        }
 private void DeleteBtn_Click(object sender, RoutedEventArgs e)
 {
     if (dataGrid1.SelectedItem == null)
     {
         MessageBox.Show("請選擇欲刪除的項目", "錯誤", MessageBoxButton.OK);
     }
     else
     {
         Member           deleteMember = this.dataGrid1.SelectedItem as Member;
         MessageBoxResult result       = MessageBox.Show("確定刪除" + deleteMember.ChName + "?", "", MessageBoxButton.OKCancel);
         if (result == MessageBoxResult.OK)
         {
             Wcf_GetdataClient client = new Wcf_GetdataClient();
             client.DeleteCompleted += new EventHandler <AsyncCompletedEventArgs>(client_DeleteCompleted);
             client.DeleteAsync(deleteMember.ID);
         }
     }
 }