Ir al contenido principal

Entradas

Mostrando entradas de 2012

28/12/2012 LP III

Crear una BD con el nombre BDLPIII y hacer el siguiente modelo de BD 1. Crear un unidad persistente asociando a nuestra base de datos 2. Creamos las clases entidades desde la BD  3. Creamos un Controlador para las Entidades =================================================================== 4. En el index.jsp dentro del cuerpo del documento ira el codigo de nuestro formulario de Logeo < h1 > Autenticacion Segura - Sistema de Venta Licores </ h1 > < form action = " ServletControl " method = " POST " > < table border = " 1 " > < tbody > < tr > < td > Codigo </ td > < td > < input type = " text " name = " txtCodigo " value = " " /> </ td > </ tr > < tr >

26/12/2012 Usnado Isolated Storage en WP 7

Ejemplo para la siguiente pantalla: Descargar código del siguiente Link  Descarga codigo fuente Imports System . IO . IsolatedStorage Imports System . IO Partial Public Class MainPage Inherits PhoneApplicationPage Dim miAlmacen As IsolatedStorageFile = IsolatedStorageFile . GetUserStoreForApplication Dim directorio As String Dim archivo As String Dim fileStream As IsolatedStorageFileStream ' Constructor Public Sub New ( ) InitializeComponent ( ) End Sub Private Sub btnDirectorio_Click ( sender As System . Object , e As System . Windows . RoutedEventArgs ) Handles btnDirectorio . Click directorio = txtDirectorio . Text miAlmacen . CreateDirectory ( directorio ) End Sub Private Sub btnFile_Click ( sender As System . Object , e As System . Windows . RoutedEventArgs ) Handles btnFile . Click archivo = txtFile . Text fileStream = New

21/12/2012 LPIII

public class Persona {     private String codigo;     private String nombres;     private String edad;     public Persona() {     }     public Persona(String codigo, String nombres, String edad) {         this.codigo = codigo;         this.nombres = nombres;         this.edad = edad;     }     public String escribirXML(){         StringBuilder xml = new StringBuilder();         xml.append("<persona>");         xml.append("<atributos cod='" + this.codigo + "'");         xml.append(" nom='" + this.nombres + "'");         xml.append(" eda='" + this.edad + "'");         xml.append(" />");         xml.append("</persona>");         return xml.toString();     } } En el cliente .NET lo leerimos de la siguiente forma. DENTRO DEL EVENTO CLICK DEL BOTON         Dim servicio As New WSOperacionesClient         Dim xmlPersona As String   

Usando INotifyPropertyChanged para un Contedenor en WP 7

Imports System.ComponentModel Public Class NotifySumar     Implements INotifyPropertyChanged     Public Event propiedadChanged As PropertyChangedEventHandler Implements ComponentModel.INotifyPropertyChanged.PropertyChanged     Private Property _num1 As Integer     Private Property _num2 As Integer     Public Property Num1() As String         Get             Return _num1         End Get         Set(ByVal value As String)             _num1 = value             RaiseEvent propiedadChanged(Me, New PropertyChangedEventArgs(" resultadoOperacion "))         End Set     End Property     Public Property Num2() As String         Get             Return _num2         End Get         Set(ByVal value As String)             _num2 = value             RaiseEvent propiedadChanged(Me, New PropertyChangedEventArgs(" resultadoOperacion "))         End Set     End Property     Public Sub INotifyPropertyChanged(ByVal propertyName As String)         RaiseEvent

Ejemplo event ws WP7

   Private Sub btnIngresar_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles btnIngresar.Click         'Dim usu As String = txtusu.Text         'Dim cla As String = txtcla.Password         'If usu = "luis" And cla = "123" Then         '    NavigationService.Navigate(New Uri("/Perfil.xaml?user=" & usu, UriKind.Relative))         'Else         '    MessageBox.Show("Error al Ingresar", "Error", MessageBoxButton.OK)         'End If         Dim servicio As New Service1SoapClient()         servicio.validarUsuarioAsync("", "")         AddHandler servicio.validarUsuarioCompleted, AddressOf Me.validar_usuarioCompleted     End Sub     Sub validar_usuarioCompleted(ByVal sender As Object, ByVal e As validarUsuarioCompletedEventArgs)         Dim resultado As String = e.Result     End Sub

Ejemplo SQL con .NET

1. Agregamos en el Web.Config el siguiente Key <connectionStrings>       <add name="SQLServerConnection" connectionString="data source=.\SQL2005; Initial Catalog=NOMBRE_BDR; User id=sa; password=sa" providerName="System.Data.SqlClient"/>        </connectionStrings> 2. Para recuperar la cadena de conexion hacemos la siguiente linea, dentro del metodo que lo usara  ConnectionStringSettings ConnectionStringSettings = ConfigurationManager.ConnectionStrings["SQLServerConnection"]; String CadenaConexion = ConnectionStringSettings.ConnectionString;            3. agregamos el siguiente fragmento de codigo para hacer uso de un Procedimiento almacenado, ejemplo si tiene 3 parametros de entrada nuestro SP:             SqlParameter[] par = new SqlParameter[3];             par[0] = new SqlParameter("@PAR1", System.Data.SqlDbType.VarChar, 20);             par[0].Value = VALOR1;             par[1] = new SqlParameter(&q

JSF

<navigation-rule>         <from-view-id>/login.jsp</from-view-id>         <navigation-case>             <from-outcome>ok</from-outcome>             <to-view-id>/saludo.jsp</to-view-id>         </navigation-case>  </navigation-rule>

DAM 2

codigo clase instalar toolkit, para poder ver las transformaciones hechas en blend http://silverlight.codeplex.com/releases/ Despues de instalar, vamos a nuestro proyecto WP 7.1, click dereco referencias, agregar referencia y buscamos la referencia Microsoft.phone.controls.toolkit Ejemplo de pagginacion con Evento MOUSE http://dl.dropbox.com/u/50075634/PhoneAppPag_pagg.rar

Ejemplo MVC - DAO - JPA

ControladorProducto if(opcion.equals("delete")) {                               int codigo = Integer.parseInt(request.getParameter("codigo"));                               ProductoDAO pDao = new ProductoDAO();                                             if (pDao.eliminarProducto(codigo)) {                     request.setAttribute("RPTA", "Se elimini exitosamente");                     RequestDispatcher dispatcher = request.getRequestDispatcher("listarProducto.jsp");                     dispatcher.forward(request, response);                 } else {                     request.setAttribute("RPTA", "No se pudo eliminar el producto, intente otra vez");                     RequestDispatcher dispatcher = request.getRequestDispatcher("listarProducto.jsp");                     dispatcher.forward(request, response);                   } //////////////////////////////////// ProductoDAO  public b

LPII semana

index.jsp dentro del body <div align="center">             <form method="POST" action="ControladorUsuario">                 <input type="hidden" name="opc" value="login" />                 <table border="1">                                       <tbody>                         <tr>                             <td>Codigo</td>                             <td><input type="text" name="txtCodigo" value="" /></td>                         </tr>                         <tr>                             <td>Password</td>                             <td><input type="text" name="txtClave" value="" /></td>                         </tr>                         <tr>                             <td><input type="submit"

LP III semana 1 clase 2

Jovenes descargar Backup de BD y codigo, hacer que funcione la web Descargar Backup Descargar Codigo Driver SQLJDBC para sql server 2005 a + Diapos JDBC Script USE [BD_VENTAS] GO /****** Object:  Table [dbo].[TUsuario]    Script Date: 11/12/2012 21:41:35 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[TUsuario]( [Codigo] [varchar](10) NULL, [Clave] [int] NULL, [Nombres] [varchar](50) NULL, [Perfil] [char](1) NULL ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object:  Table [dbo].[TProducto]    Script Date: 11/12/2012 21:41:35 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[TProducto]( [Codigo] [int] NULL, [Descripcion] [varchar](50) NULL, [Stock] [int] NULL, [Precio] [decimal](18, 2) NULL ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object:  Table [dbo].[TDetPedido]    Script Date: 11/12/2012 21:41:35 ******/ SET ANSI_NULLS

BD LPIII

Hacer la siguiente BD

Crear aplicación móvil J2ME desde cero con NetBeans

Todos los ejemplos hechos en este blog son para emuladores o dispositivos que soporten configuración CLCD-1.1 y perfil MIDP-2.0 hacia adelante y los ejemplos serán desarrollados en el IDE Netbeans. 1. INTRODUCCIÓN Veremos como crear una aplicación móvil J2ME en NetBeans, esto sera indiferente de la versión NetBeans que estes usando; el proceso es similar en todas las versiones (6.x, 7.x, etc.). Aprenderemos a crear proyectos, paquetes, Midlets y clases.