private void btnModificar_Click(object sender, RoutedEventArgs e) { if ((!txtNombre.PlaceHolder && cbPais.SelectedIndex != 0 && cbEstado.SelectedIndex != 0 && !txtCiudad.PlaceHolder && !txtCalle.PlaceHolder && !txtCP.PlaceHolder && !txtTelefono.PlaceHolder) && ((rbFisica.IsChecked == true && !txtApellidoPaterno.PlaceHolder && !txtApellidoMaterno.PlaceHolder) || (rbMoral.IsChecked == true))) { TDAService.TDAServiceClient tda = new TDAService.TDAServiceClient(); Clientes c = new Clientes(); if (rbMoral.IsChecked == true) { c.Tipo = true; c.Apellido = null; c.Apellido2 = null; } else if (rbFisica.IsChecked == true) { c.Tipo = false; c.Apellido = txtApellidoPaterno.Text; c.Apellido2 = txtApellidoMaterno.Text; } c.ID = lID; c.Apellido = txtApellidoPaterno.Text; c.Apellido2 = txtApellidoMaterno.Text; c.Nombre = txtNombre.Text; if (txtRFC.PlaceHolder) { c.RFC = null; } else { c.RFC = txtRFC.Text; } ComboBoxItem cbi = (ComboBoxItem)cbPais.Items[cbPais.SelectedIndex]; c.Pais = Convert.ToInt64(cbi.Uid); ComboBoxItem cbi1 = (ComboBoxItem)cbEstado.Items[cbEstado.SelectedIndex]; c.Estado = Convert.ToInt64(cbi1.Uid); c.Ciudad = txtCiudad.Text; if (txtLocalidad.PlaceHolder) { c.Localidad = null; } else { c.Localidad = txtLocalidad.Text; } c.Calle = txtCalle.Text; if (txtNumeroExterior.PlaceHolder) { c.NumeroExterior = null; } else { c.NumeroExterior = txtNumeroExterior.Text; } if (txtNumeroInterior.PlaceHolder) { c.NumeroInterior = null; } else { c.NumeroInterior = txtNumeroInterior.Text; } if (txtColonia.PlaceHolder) { c.Colonia = null; } else { c.Colonia = txtColonia.Text; } c.CP = txtCP.Text; c.Telefono = txtTelefono.Text; if (txtEmail.PlaceHolder) { c.Email = null; } else { c.Email = txtEmail.Text; } if (cbGrupoCliente.SelectedIndex == 0) { c.GrupoCliente = null; } else { ComboBoxItem cbi2 = (ComboBoxItem)cbGrupoCliente.Items[cbGrupoCliente.SelectedIndex]; c.GrupoCliente = Convert.ToInt64(cbi.Uid); } tda.UpdateCliente(c); tda.Close(); this.Close(); } else { MessageBox.Show("Favor de llenar los campos."); } }