Пример #1
0
        private void cmdBuscar_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var strNum_Cliente = Interaction.InputBox("Digite el numero de cliente", "Numero de cliente");
                var myCliente = new ClienteEN();
                var valida = new ClienteLN();
                myCliente = valida.ObtenerClientePorID(strNum_Cliente);
                if (myCliente == null)
                {
                    throw new Exception("Cliente no existe");
                }
                else
                {
                    txtNumCliente.Text = myCliente.Num_Cliente;
                    txtNombre.Text = myCliente.Nombre;
                    txtTelefono.Text = myCliente.Telefono;
                    txtDireccion.Text = myCliente.Direccion;
                    radEmpresa.IsChecked = myCliente.Indicador_Empresa;
                    radPersona.IsChecked = myCliente.Indicador_Persona;
                    txtCedJur.Text = myCliente.Cedula_Juridica;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }


        }
Пример #2
0
 private void cmdBorrar_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var strNum_Cliente = Interaction.InputBox("Digite el numero de cliente", "Numero de cliente");
         var myCliente = new ClienteEN();
         var valida = new ClienteLN();
         myCliente = valida.ObtenerClientePorID(strNum_Cliente);
         if (myCliente == null)
         {
             throw new Exception("Cliente no existe");
         }
         else
         {
             valida.EliminarCliente(myCliente);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }