private void btnDeletePhone_Click(object sender, RoutedEventArgs e) { if (dgCustomerPhone.SelectedItem == null) { MessageBox.Show("Lütfen Gridden silinecek Telefon adresini seçiniz."); return; } CustomerPhoneContract customerPhone = new CustomerPhoneContract(); customerPhone = dgCustomerPhone.SelectedItem as CustomerPhoneContract; var connect = new Connector.Banking.GenericConnect <CustomerPhoneResponse>(); var request = new Types.Banking.CustomerPhoneRequest(); request.customerPhone = customerPhone; request.MethodName = "DelCustomerPhone"; var response = connect.Execute(request); if (response.IsSuccess == true) { MessageBox.Show("Telefon numarası silme işlemi başarı ile gerçekleştirildi."); this.Close(); return; } else { MessageBox.Show("Telefon numarası silme işlemi başarısız oldu."); return; } }
private void GetCustomerPhone(CustomerPhoneContract customerPhone) { customerPhones = new List <CustomerPhoneContract>(); var connect = new Connector.Banking.GenericConnect <CustomerPhoneResponse>(); var request = new Types.Banking.CustomerPhoneRequest(); request.customerPhone = customerPhone; request.MethodName = "GetCustomerPhone"; var response = connect.Execute(request); if (response.IsSuccess == true) { foreach (var item in response.customerPhones) { customerPhones.Add(item); } dgCustomerPhone.ItemsSource = response.customerPhones; dgCustomerPhone.Items.Refresh(); return; } else { return; } }
private void btnSavePhone_Click(object sender, RoutedEventArgs e) { if (txtPhoneId.Text != "") {//güncelleme if (txtPhoneAddress.Text == "") { MessageBox.Show("Telefon adresi boş geçilemez", "Message", MessageBoxButton.OK, MessageBoxImage.Error); txtPhoneAddress.Focus(); return; } _customerPhone.Id = Convert.ToInt32(txtPhoneId.Text); _customerPhone.Phone = txtPhoneAddress.Text; var connect = new Connector.Banking.GenericConnect <CustomerPhoneResponse>(); var request = new Types.Banking.CustomerPhoneRequest(); request.customerPhone = _customerPhone; request.MethodName = "UpdCustomerPhone"; var response = connect.Execute(request); if (response.IsSuccess == true) { MessageBox.Show("Telefon güncelleme işlemi başarı ile gerçekleştirildi."); this.Close(); return; } else { MessageBox.Show("Telefon güncelleme işlemi başarısız oldu."); return; } } else {//yeni if (txtPhoneAddress.Text == "") { MessageBox.Show("Telefon adresi boş geçilemez", "Message", MessageBoxButton.OK, MessageBoxImage.Error); txtPhoneAddress.Focus(); return; } _customerPhone.Phone = txtPhoneAddress.Text; var connect = new Connector.Banking.GenericConnect <CustomerPhoneResponse>(); var request = new Types.Banking.CustomerPhoneRequest(); request.customerPhone = _customerPhone; request.MethodName = "AddCustomerPhone"; var response = connect.Execute(request); if (response.IsSuccess == true) { MessageBox.Show("Telefon ekleme işlemi başarı ile gerçekleştirildi."); this.Close(); return; } else { MessageBox.Show("Telefon ekleme işlemi başarısız oldu."); return; } } }