Exemplo n.º 1
0
        void loadMembers()
        {
            Wcf_GetdataClient client = new Wcf_GetdataClient();

            client.GetAllMemberCompleted += new EventHandler <GetAllMemberCompletedEventArgs>(client_GetAllMemberCompleted);
            client.GetAllMemberAsync();
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 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
            });
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
 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);
         }
     }
 }