private void ModificarCli(object sender, Consultar_ClienteCompletedEventArgs e) { try { if (e.Result.Cedula == null) { MessageBox.Show("El cliente no se encuentra registrado"); NavigationService.Navigate(new Uri("/Clientes/frmConsultarCliente.xaml", UriKind.Relative)); } else { ContentDatosP.Visibility = System.Windows.Visibility.Collapsed; ContentModificarCliente2.Visibility = System.Windows.Visibility.Visible; PageTitle.Text = "MODIFICAR CLIENTE"; lblCedulaCli2.Text = lblCedulaCli.Text.ToUpper(); txtNombres2.Text = e.Result.Nombres_Cliente.ToUpper(); txtPrApellido2.Text = e.Result.Apellido_1.ToUpper(); txtSgApellido2.Text = e.Result.Apellido_2.ToUpper(); } } catch (Exception ex) { MessageBox.Show("Ha ocurrido un error en el sistema"); NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative)); } finally { NavigationService.Navigate(new Uri("/Clientes/frmConsultarCliente.xaml", UriKind.Relative)); } }
private void PoblarCliente(object sender, Consultar_ClienteCompletedEventArgs e) { if (txtUbicacion.Text == "CLIENTE") { txtCedula.Text = e.Result.Cedula.ToUpper(); txtNombres.Text = e.Result.Nombres_Cliente.ToUpper(); txtPrApellido.Text = e.Result.Apellido_1.ToUpper(); txtSgApellido.Text = e.Result.Apellido_2.ToUpper(); txtDir.Text = e.Result.Ubicacion.Direccion.ToUpper(); txtBarrio.Text = e.Result.Ubicacion.Barrio.ToUpper(); txtDepartamento.Text = e.Result.Ubicacion.Ciudad.Departamento.Nombre_Departamento.ToUpper(); txtCiudad.Text = e.Result.Ubicacion.Ciudad.Nombre_Ciudad.ToUpper(); txtTel.Text = e.Result.Ubicacion.Telefono_1.ToUpper(); btnContinuarDatos.Visibility = System.Windows.Visibility.Visible; btnConsultaNueva.Visibility = System.Windows.Visibility.Collapsed; } }
private void ConsultarCliente(object sender, Consultar_ClienteCompletedEventArgs e) { ClienteServiceClient servCliente = new ClienteServiceClient(); try { if (e.Result.Cedula != null) { MessageBox.Show("El cliente ya se encuentra registrado"); NavigationService.Navigate(new Uri("/Clientes/frmRegistrarCliente.xaml", UriKind.Relative)); } else { txtNombres.Focus(); lblCedulaCli.Text = txtCedula.Text; txtNombres.Text = ""; txtPrApellido.Text = ""; txtSgApellido.Text = ""; txtDir.Text = ""; txtBarrio.Text = ""; txtTel.Text = ""; ContentBusq.Visibility = System.Windows.Visibility.Collapsed; ContentDatosP.Visibility = System.Windows.Visibility.Visible; txtNombres.Focus(); } txtCedula.Text = ""; } catch (Exception ex) { MessageBox.Show("Ha ocurrido un error en el sistema"); NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative)); } finally { servCliente.CloseAsync(); } }
private void PoblarCliente(object sender, Consultar_ClienteCompletedEventArgs e) { try { if (e.Result.Cedula == null) { MessageBox.Show("El cliente no se encuentra registrado"); NavigationService.Navigate(new Uri("/Ventas/frmRegistrarVenta.xaml", UriKind.Relative)); } else { ContentInicial.Visibility = System.Windows.Visibility.Collapsed; ContentCliente.Visibility = System.Windows.Visibility.Visible; lblCedulaCli.Text = e.Result.Cedula; txtNombres.Text = e.Result.Nombres_Cliente; txtPrApellido.Text = e.Result.Apellido_1; txtSgApellido.Text = e.Result.Apellido_2; lblDirecciones.Text = ""; foreach (UbicacionBE ubi in e.Result.ListaDirecciones) { lblDirecciones.Text += ubi.Id_Ubicacion + "--" + ubi.Ciudad.Nombre_Ciudad + "--" + ubi.Barrio + "--" + (ubi.Direccion.Length > 20 ? ubi.Direccion.Substring(0, 20) : ubi.Direccion) + "--" + ubi.Telefono_1 + "\n"; } } txtCedula.Text = ""; } catch (Exception ex) { MessageBox.Show("Ha ocurrido un error en el sistema"); NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative)); } finally { btnAceptar.Focus(); } }
private void PoblarCliente(object sender, Consultar_ClienteCompletedEventArgs e) { try { if (e.Result.Cedula == null) { MessageBox.Show("El cliente no se encuentra registrado"); NavigationService.Navigate(new Uri("/Clientes/frmConsultarCliente.xaml", UriKind.Relative)); } else { ContentBusq.Visibility = System.Windows.Visibility.Collapsed; ContentDatosP.Visibility = System.Windows.Visibility.Visible; lblCedulaCli.Text = e.Result.Cedula.ToUpper(); txtNombres.Text = e.Result.Nombres_Cliente.ToUpper(); txtPrApellido.Text = e.Result.Apellido_1.ToUpper(); txtSgApellido.Text = e.Result.Apellido_2.ToUpper(); txtDirecciones.Text = ""; foreach (UbicacionBE ubi in e.Result.ListaDirecciones) { txtDirecciones.Text += ubi.Id_Ubicacion + "--"+ ubi.Ciudad.Nombre_Ciudad + "--" + ubi.Barrio + "--"+ (ubi.Direccion.Length > 20 ? ubi.Direccion.Substring(0,20): ubi.Direccion) + "--" + ubi.Telefono_1 +"\n"; } } txtCedula.Text = ""; } catch (Exception ex) { MessageBox.Show("Ha ocurrido un error en el sistema"); NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative)); } finally { NavigationService.Navigate(new Uri("/Clientes/frmConsultarCliente.xaml", UriKind.Relative)); } }