El Libro del Día: 2014-08-07
Titulo: Windows Phone 8 Development Internals
Autor: Andrew Whitechapel, Sean McKenna
Editorial: Microsoft
Nro Paginas: 1046
Capítulos:
Part I CORE FEATURES
Chapter 1 Vision and architecture
Chapter 2 App model and navigation
Chapter 3 UI visuals and touch
Chapter 4 Data binding and MVVM
Chapter 5 Phone and media services
Chapter 6 Sensors
Chapter 7 Web connectivity
Chapter 8 Web services and the cloud
Chapter 9 Background agents
Chapter 10 Local storage and databases
Part II WINDOWS PHONE 7 TO WINDOWS PHONE 8
Chapter 11 App publication
Chapter 12 Profiling and diagnostics
Chapter 13 Porting to Windows Phone 8 and multitargeting
Chapter 14 Tiles and notifications
Chapter 15 Contacts and calendar
Chapter 16 Camera and photos
Chapter 17 Networking and proximity
Chapter 18 Location and maps
Part III NEW WINDOWS PHONE 8 FEATURES
Chapter 19 Speech
Chapter 20 The Wallet
Chapter 21 Monetizing your app
Chapter 22 Enterprise apps
Part IV NATIVE DEVELOPMENT AND WINDOWS PHONE 8
CONVERGENCE
Chapter 23 Native development
Chapter 24 Windows 8 convergence
Chapter 25 Games and Direct3D
Descarga:
WindowsPhone_8_Development_Internals
Blog de Luis Dueñas dedicado a la difusión del Desarrollo en Microsoft .NET, Visual Studio, WinForms, WebForms, MVC, ASP .NET, jQuery, AJAX, HTML5, JavaScript, Móviles, etc. Encontrarás Libros, Demos, Artículos Técnicos, Entrenamiento.
jueves, 7 de agosto de 2014
El Libro del Día: Windows Phone 8 Development Internals
Etiquetas:
Agents,
Andrew Whitechapel,
Camera,
Contacts,
Games,
Internals,
Libros,
Local Storage,
Maps,
Microsoft,
Monetizing,
Multitargeting,
MVVM,
Notifications,
Profiling,
Sean McKenna,
Sensors,
Speech,
Tiles,
Windows Phone
miércoles, 6 de agosto de 2014
El Demo del Día: Paginar, Ordenar y Filtrar en el Control Web DataList
Paginar, Ordenar y Filtrar en el Control Web DataList
Requerimientos
Se desea crear una Aplicación Web que permita listar los datos de los empleados que cumpla con lo siguiente:
- Presente en forma de ficha la información del código, apellido, nombre y fecha de nacimiento del empleado.
- Muestre en la ficha la foto del empleado la cual se encuentra en un carpeta "Empleados" donde el nombre del archivo esta compuesto por el código del empleado y la extensión jpg. Para los archivos que no se encuentren se usará el archivo No.jpg.
- Las fichas deben tener fondo gris claro, pero al pasar el mouse el estilo de la ficha cambiara a fondo amarillo.
- La información debe estar paginada (por defecto mostrar 6 registros de empleados), mediante botones de desplazamiento y enlaces con números de paginas.
- Se debe permitir ordenar los registros por cualquier campo en forma ascendente y descendente.
- Se debe permitir filtrar los registros por cualquier campo ingresando el dato buscado.
Solución
Usaremos el control DataList con Plantilla de Datos para poder presentar en forma de ficha la información del empleado y mostrarla en varias columnas. Ademas agregaremos botones y enlaces para paginar, combos para seleccionar los criterios de ordenación y filtro de registros.
Nota: En este caso si podemos deshabilitar el ViewState del DataList ya que no hay ningun control dentro de la plantilla que haga PostBack, es decir enviaremos el minimo HTML al navegador en el cliente.
Crear el Procedimiento Almacenado en la Base de Datos de SQL Server
Usaremos la tabla Empleados (Employees) de Northwind:
Create Procedure [dbo].[uspEmployeesListar]
As
Select EmployeeID,LastName,FirstName,
IsNull(BirthDate,'1/1/1900') As BirthDate
From Employees Order By 1
Crear una Librería de Clases con las Entidades del Negocio
Crear un proyecto de tipo Librería de Clases en C# llamado: "Northwind.Librerias.EntidadesNegocio" y modificar el código de la clase como sigue:
using System;
namespace Northwind.Librerias.EntidadesNegocio
{
public class beEmpleado
{
public int IdEmpleado { get; set; }
public string Apellido { get; set; }
public string Nombre { get; set; }
public string NombreCompleto
{
get
{
return (String.Format("{0} {1}",Nombre,Apellido));
}
}
public DateTime FechaNacimiento { get; set; }
}
}
Crear una Librería de Acceso a Datos
Crear un proyecto de tipo Librería de Clases en C# llamado: "Northwind.Librerias.AccesoDatos" y modificar el código de la clase como sigue:
using System;
using System.Data; //CommandType
using System.Data.SqlClient; //SqlConnection, SqlCommand, SqlDataReader
using System.Collections.Generic; //List
using Northwind.Librerias.EntidadesNegocio; //beEmpleado
namespace Northwind.Librerias.AccesoDatos
{
public class daEmpleado
{
public List<beEmpleado> listar(SqlConnection con)
{
List<beEmpleado> lbeEmpleado = null;
SqlCommand cmd = new SqlCommand("uspEmployeesListar", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader drd = cmd.ExecuteReader(CommandBehavior.SingleResult);
if (drd != null)
{
lbeEmpleado = new List<beEmpleado>();
int posIdEmpleado = drd.GetOrdinal("EmployeeID");
int posApellido = drd.GetOrdinal("LastName");
int posNombre = drd.GetOrdinal("FirstName");
int posFechaNacimiento = drd.GetOrdinal("BirthDate");
beEmpleado obeEmpleado;
while (drd.Read())
{
obeEmpleado = new beEmpleado();
obeEmpleado.IdEmpleado = drd.GetInt32(posIdEmpleado);
obeEmpleado.Apellido = drd.GetString(posApellido);
obeEmpleado.Nombre = drd.GetString(posNombre);
obeEmpleado.FechaNacimiento = drd.GetDateTime(posFechaNacimiento);
lbeEmpleado.Add(obeEmpleado);
}
drd.Close();
}
return (lbeEmpleado);
}
}
}
Nota: Hay que hacer una referencia a la Librería de Entidades del Negocio.
Crear una Librería de Reglas del Negocio
Crear un proyecto de tipo Librería de Clases en C# llamado: "Northwind.Librerias.ReglasNegocio" y modificar el código de la clase como sigue:
using System;
using System.Configuration; //ConfigurationManager
namespace Northwind.Librerias.ReglasNegocio
{
public class brGeneral
{
//Propiedad
public string Conexion { get; set; }
//Constructor
public brGeneral()
{
Conexion = ConfigurationManager.ConnectionStrings["conNW"].ConnectionString;
}
}
}
Nota: Hay que hacer una referencia a la Librería de Entidades del Negocio, a la Librería de Acceso a Datos y a System.Configuration.
Agregar otra clase llamada: "brEmpleado" y escribir el siguiente código:
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Northwind.Librerias.EntidadesNegocio;
using Northwind.Librerias.AccesoDatos;
namespace Northwind.Librerias.ReglasNegocio
{
public class brEmpleado:brGeneral //Herencia
{
public List<beEmpleado> listar()
{
List<beEmpleado> lbeEmpleado = null;
using (SqlConnection con = new SqlConnection(Conexion))
{
try
{
con.Open();
daEmpleado odaEmpleado = new daEmpleado();
lbeEmpleado = odaEmpleado.listar(con);
}
catch (SqlException ex)
{
//Capturar el error y grabar un Log
}
} //con.Close(); con.Dispose(); con = null;
return (lbeEmpleado);
}
}
}
Nota: La clase "brEmpleado" hereda de la clase "brGeneral" la cadena de conexión para no pasarla como parámetro en cada método de la clase o en el constructor de cada clase se hace una sola vez.
Crear una Librería de Código de Usuario para Web
Crear un proyecto de tipo Librería de Clases en C# llamado: "General.Librerias.CodigoUsuarioWeb" y modificar el código de la clase como sigue:
using System;
using System.Collections.Generic;
using System.IO; //File
using System.Web; //HttpContext
namespace General.Librerias.CodigoUsuarioWeb
{
public class Imagen
{
public static string obtenerUrl(int id, string carpeta)
{
string archivo = HttpContext.Current.Server.MapPath
(String.Format("../Imagenes/{0}/{1}.jpg", carpeta, id));
string url = String.Format("../Imagenes/{0}/{1}.jpg", carpeta, id);
if (!File.Exists(archivo)) url = String.Format("../Imagenes/{0}/No.jpg", carpeta);
return (url);
}
}
}
Nota: Como esta librería va a ser usada por paginas web hay que hacer referencia a: "System.Web"
Crear la Aplicación Web en ASP .NET Web Form
Crear un "Nuevo Sitio web vacío de ASP .NET" en C# llamado "Demo14" y crear las siguientes carpetas:
- Estilos: Para el archivo de hoja de estilo (CSS).
- Imagenes. Dentro crear otra carpeta llamada "Empleados" y adjuntar los archivos con las fotos de los empleados: 1.jpg, 2.jpg, 3.jpg, ... y No.jpg.
- Paginas: Para contener la pagina de lista de empleados.
Crear el Archivo de Hoja de Estilo (CSS)
Seleccionar la carpeta "Estilos" y agregar un archivo de hoja de estilos con el nombre de: "ACME.css" y modificar el código como sigue:
Escribir el siguiente código C# en la página:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Northwind.Librerias.EntidadesNegocio; //beEmpleado
using Northwind.Librerias.ReglasNegocio; //brEmpleado
using System.Reflection; //PropertyInfo
public partial class Paginas_ListaEmpleados : System.Web.UI.Page
{
private List<beEmpleado> lbeEmpleado;
private int registrosPagina = 6;
private int indicePaginaActual;
private int indiceUltimaPagina;
protected void Page_Load(object sender, EventArgs e)
{
txtPosicion.Attributes.Add("style", "text-align:center");
if (!Page.IsPostBack)
{
brEmpleado obrEmpleado = new brEmpleado();
lbeEmpleado = obrEmpleado.listar();
Session["Empleados"] = lbeEmpleado;
Session["Todo"] = lbeEmpleado;
calcularPaginacion();
enlazarDataList();
cargarListaCampos();
}
else
{
indicePaginaActual = (int)ViewState["indicePaginaActual"];
indiceUltimaPagina = (int)ViewState["indiceUltimaPagina"];
}
crearEnlacesPaginas();
}
private void calcularPaginacion()
{
indiceUltimaPagina = (lbeEmpleado.Count / registrosPagina);
if (lbeEmpleado.Count % registrosPagina == 0)
indiceUltimaPagina--;
ViewState["indicePaginaActual"] = indicePaginaActual;
ViewState["indiceUltimaPagina"] = indiceUltimaPagina;
}
private void cargarListaCampos()
{
ddlCriterio.Items.Add(new ListItem("Todo", ""));
PropertyInfo[] propiedades = lbeEmpleado[0].
GetType().GetProperties();
foreach (PropertyInfo propiedad in propiedades)
{
ddlCampo.Items.Add(new ListItem
(propiedad.Name, propiedad.Name));
ddlCriterio.Items.Add(new ListItem
(propiedad.Name, propiedad.Name));
}
}
private void crearEnlacesPaginas()
{
celdaPaginas.Controls.Clear();
LinkButton lbn;
for (int i = 0; i <= indiceUltimaPagina; i++)
{
lbn = new LinkButton();
lbn.Text = (i + 1).ToString();
lbn.Click += new EventHandler(paginar);
celdaPaginas.Controls.Add(lbn);
celdaPaginas.Controls.Add(new LiteralControl(" "));
}
}
private void paginar(object sender, EventArgs e)
{
LinkButton lbn = (LinkButton)sender;
indicePaginaActual = int.Parse(lbn.Text) - 1;
ViewState["indicePaginaActual"] = indicePaginaActual;
enlazarDataList();
}
private void enlazarDataList()
{
indicePaginaActual = (int)ViewState["indicePaginaActual"];
indiceUltimaPagina = (int)ViewState["indiceUltimaPagina"];
lbeEmpleado = (List<beEmpleado>)Session["Empleados"];
List<beEmpleado> lbeFiltro = new List<beEmpleado>();
int inicio = indicePaginaActual * registrosPagina;
int fin = (indicePaginaActual * registrosPagina) + registrosPagina;
for (int i = inicio; i < fin; i++)
{
if (i < lbeEmpleado.Count) lbeFiltro.Add(lbeEmpleado[i]);
else break;
}
dlsEmpleado.DataSource = lbeFiltro;
dlsEmpleado.DataBind();
lblRegistros.Text = lbeEmpleado.Count.ToString();
txtPosicion.Text = String.Format("{0} de {1}", indicePaginaActual + 1,
indiceUltimaPagina + 1);
}
protected void ordenarCampo(object sender, EventArgs e)
{
string campo = ddlCampo.SelectedValue;
int orden = int.Parse(ddlOrden.SelectedValue);
lbeEmpleado = (List<beEmpleado>)Session["Empleados"];
if (orden.Equals(0)) lbeEmpleado = lbeEmpleado.OrderBy
(x => x.GetType().GetProperty(campo).GetValue(x, null)).ToList<beEmpleado>();
else lbeEmpleado = lbeEmpleado.OrderByDescending
(x => x.GetType().GetProperty(campo).GetValue(x, null)).ToList<beEmpleado>();
Session["Empleados"] = lbeEmpleado;
enlazarDataList();
}
protected void filtrarCriterio(object sender, EventArgs e)
{
string campo = ddlCriterio.SelectedValue;
lbeEmpleado = (List<beEmpleado>)Session["Todo"];
if (!campo.Equals(""))
{
string tipo = lbeEmpleado[0].GetType().GetProperty(campo).
PropertyType.ToString().ToLower();
if (tipo.Contains("datetime"))
{
string[] fechaNac = txtDato.Text.Split('-');
txtDato.Text = fechaNac[2] + "/" + fechaNac[1] + "/" + fechaNac[0];
}
lbeEmpleado = lbeEmpleado.FindAll(x => x.GetType().GetProperty(campo).
GetValue(x, null).ToString().ToLower().Contains(txtDato.Text.ToLower()));
}
celdaBotones.Visible = (lbeEmpleado.Count > 0);
Session["Empleados"] = lbeEmpleado;
indicePaginaActual = 0;
ViewState["indicePaginaActual"] = indicePaginaActual;
calcularPaginacion();
enlazarDataList();
crearEnlacesPaginas();
}
protected void btnPrimero_Click(object sender, EventArgs e)
{
indicePaginaActual = 0;
ViewState["indicePaginaActual"] = indicePaginaActual;
enlazarDataList();
}
protected void btnAnterior_Click(object sender, EventArgs e)
{
indicePaginaActual = (int)ViewState["indicePaginaActual"];
if (indicePaginaActual > 0) indicePaginaActual--;
ViewState["indicePaginaActual"] = indicePaginaActual;
enlazarDataList();
}
protected void btnSiguiente_Click(object sender, EventArgs e)
{
indicePaginaActual = (int)ViewState["indicePaginaActual"];
indiceUltimaPagina = (int)ViewState["indiceUltimaPagina"];
if (indicePaginaActual < indiceUltimaPagina) indicePaginaActual++;
ViewState["indicePaginaActual"] = indicePaginaActual;
enlazarDataList();
}
protected void btnUltimo_Click(object sender, EventArgs e)
{
indiceUltimaPagina = (int)ViewState["indiceUltimaPagina"];
indicePaginaActual = indiceUltimaPagina;
ViewState["indicePaginaActual"] = indicePaginaActual;
enlazarDataList();
}
protected void cambiarControlBusqueda(object sender, EventArgs e)
{
string campo = ddlCriterio.SelectedValue;
txtDato.Text = "";
if (campo.Equals("")) txtDato.TextMode = TextBoxMode.SingleLine;
else
{
lbeEmpleado = (List<beEmpleado>)Session["Empleados"];
string tipo = lbeEmpleado[0].GetType().GetProperty(campo).
PropertyType.ToString().ToLower();
if (tipo.Contains("int")) txtDato.TextMode = TextBoxMode.Number;
else
{
if (tipo.Contains("datetime")) txtDato.TextMode = TextBoxMode.Date;
else txtDato.TextMode = TextBoxMode.SingleLine;
}
}
enlazarDataList();
}
}
Nota: Por defecto los registrosPorPagina está configurado a 6 y usamos Reflection para cargar dinamicamente los combos con los nombres de las propiedades del objeto empleado.
Modificar el Archivo Web.Config para especificar la cadena de conexión a Northwind
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="conNW" providerName="SQLServer" connectionString="uid=UsuarioNW;pwd=123456;
data source=DSOFT\Sqlexpress; database=Northwind"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
</configuration>
Probar la Pagina Web
Guardar el Sitio Web, clic derecho a la Pagina "ListaEmpleados.aspx" y seleccionar "Ver en el explorador".
Probar ir a cualquier pagina usando los Links con los números de paginas o con los botones, por ejemplo si estamos en la ultima ya no podemos avanzar a la siguiente o si estamos en la primera ya no podemos retroceder.
Seleccionar un criterio del combo "Ordenar Por", luego seleccionar el "Tipo de Orden" (ascendente o descendente) y clic al botón "Ordenar", ver como los registros se ordenan por el campo seleccionado.
Seleccionar un criterio del combo "Filtrar Por", luego ingresar un dato en "Dato Filtrar" y clic al botón "Filtrar", ver como solo aparecen los registros que cumplen con el criterio, se muestra la cantidad de registros encontrados y como varia los números de paginas.
Comentario Final
En esta demostración hemos visto como podemos paginar, ordenar y filtrar usando el control DataList y sin usar ViewState para dicho control para minimizar el HTML enviado al navegador. Mas bien hemos usado el ViewState (y no Session) para almacenar y recuperar el "indicePaginaActual" y el "indiceUltimaPagina" ya que al hacer PostBack se pierden los valores de las variables.
Descarga:
Demo14_Paginar_Ordenar_Filtrar_DataList
Requerimientos
Se desea crear una Aplicación Web que permita listar los datos de los empleados que cumpla con lo siguiente:
- Presente en forma de ficha la información del código, apellido, nombre y fecha de nacimiento del empleado.
- Muestre en la ficha la foto del empleado la cual se encuentra en un carpeta "Empleados" donde el nombre del archivo esta compuesto por el código del empleado y la extensión jpg. Para los archivos que no se encuentren se usará el archivo No.jpg.
- Las fichas deben tener fondo gris claro, pero al pasar el mouse el estilo de la ficha cambiara a fondo amarillo.
- La información debe estar paginada (por defecto mostrar 6 registros de empleados), mediante botones de desplazamiento y enlaces con números de paginas.
- Se debe permitir ordenar los registros por cualquier campo en forma ascendente y descendente.
- Se debe permitir filtrar los registros por cualquier campo ingresando el dato buscado.
Solución
Usaremos el control DataList con Plantilla de Datos para poder presentar en forma de ficha la información del empleado y mostrarla en varias columnas. Ademas agregaremos botones y enlaces para paginar, combos para seleccionar los criterios de ordenación y filtro de registros.
Nota: En este caso si podemos deshabilitar el ViewState del DataList ya que no hay ningun control dentro de la plantilla que haga PostBack, es decir enviaremos el minimo HTML al navegador en el cliente.
Crear el Procedimiento Almacenado en la Base de Datos de SQL Server
Usaremos la tabla Empleados (Employees) de Northwind:
Create Procedure [dbo].[uspEmployeesListar]
As
Select EmployeeID,LastName,FirstName,
IsNull(BirthDate,'1/1/1900') As BirthDate
From Employees Order By 1
Crear una Librería de Clases con las Entidades del Negocio
Crear un proyecto de tipo Librería de Clases en C# llamado: "Northwind.Librerias.EntidadesNegocio" y modificar el código de la clase como sigue:
using System;
namespace Northwind.Librerias.EntidadesNegocio
{
public class beEmpleado
{
public int IdEmpleado { get; set; }
public string Apellido { get; set; }
public string Nombre { get; set; }
public string NombreCompleto
{
get
{
return (String.Format("{0} {1}",Nombre,Apellido));
}
}
public DateTime FechaNacimiento { get; set; }
}
}
Crear una Librería de Acceso a Datos
Crear un proyecto de tipo Librería de Clases en C# llamado: "Northwind.Librerias.AccesoDatos" y modificar el código de la clase como sigue:
using System;
using System.Data; //CommandType
using System.Data.SqlClient; //SqlConnection, SqlCommand, SqlDataReader
using System.Collections.Generic; //List
using Northwind.Librerias.EntidadesNegocio; //beEmpleado
namespace Northwind.Librerias.AccesoDatos
{
public class daEmpleado
{
public List<beEmpleado> listar(SqlConnection con)
{
List<beEmpleado> lbeEmpleado = null;
SqlCommand cmd = new SqlCommand("uspEmployeesListar", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader drd = cmd.ExecuteReader(CommandBehavior.SingleResult);
if (drd != null)
{
lbeEmpleado = new List<beEmpleado>();
int posIdEmpleado = drd.GetOrdinal("EmployeeID");
int posApellido = drd.GetOrdinal("LastName");
int posNombre = drd.GetOrdinal("FirstName");
int posFechaNacimiento = drd.GetOrdinal("BirthDate");
beEmpleado obeEmpleado;
while (drd.Read())
{
obeEmpleado = new beEmpleado();
obeEmpleado.IdEmpleado = drd.GetInt32(posIdEmpleado);
obeEmpleado.Apellido = drd.GetString(posApellido);
obeEmpleado.Nombre = drd.GetString(posNombre);
obeEmpleado.FechaNacimiento = drd.GetDateTime(posFechaNacimiento);
lbeEmpleado.Add(obeEmpleado);
}
drd.Close();
}
return (lbeEmpleado);
}
}
}
Nota: Hay que hacer una referencia a la Librería de Entidades del Negocio.
Crear una Librería de Reglas del Negocio
Crear un proyecto de tipo Librería de Clases en C# llamado: "Northwind.Librerias.ReglasNegocio" y modificar el código de la clase como sigue:
using System;
using System.Configuration; //ConfigurationManager
namespace Northwind.Librerias.ReglasNegocio
{
public class brGeneral
{
//Propiedad
public string Conexion { get; set; }
//Constructor
public brGeneral()
{
Conexion = ConfigurationManager.ConnectionStrings["conNW"].ConnectionString;
}
}
}
Nota: Hay que hacer una referencia a la Librería de Entidades del Negocio, a la Librería de Acceso a Datos y a System.Configuration.
Agregar otra clase llamada: "brEmpleado" y escribir el siguiente código:
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Northwind.Librerias.EntidadesNegocio;
using Northwind.Librerias.AccesoDatos;
namespace Northwind.Librerias.ReglasNegocio
{
public class brEmpleado:brGeneral //Herencia
{
public List<beEmpleado> listar()
{
List<beEmpleado> lbeEmpleado = null;
using (SqlConnection con = new SqlConnection(Conexion))
{
try
{
con.Open();
daEmpleado odaEmpleado = new daEmpleado();
lbeEmpleado = odaEmpleado.listar(con);
}
catch (SqlException ex)
{
//Capturar el error y grabar un Log
}
} //con.Close(); con.Dispose(); con = null;
return (lbeEmpleado);
}
}
}
Nota: La clase "brEmpleado" hereda de la clase "brGeneral" la cadena de conexión para no pasarla como parámetro en cada método de la clase o en el constructor de cada clase se hace una sola vez.
Crear una Librería de Código de Usuario para Web
Crear un proyecto de tipo Librería de Clases en C# llamado: "General.Librerias.CodigoUsuarioWeb" y modificar el código de la clase como sigue:
using System;
using System.Collections.Generic;
using System.IO; //File
using System.Web; //HttpContext
namespace General.Librerias.CodigoUsuarioWeb
{
public class Imagen
{
public static string obtenerUrl(int id, string carpeta)
{
string archivo = HttpContext.Current.Server.MapPath
(String.Format("../Imagenes/{0}/{1}.jpg", carpeta, id));
string url = String.Format("../Imagenes/{0}/{1}.jpg", carpeta, id);
if (!File.Exists(archivo)) url = String.Format("../Imagenes/{0}/No.jpg", carpeta);
return (url);
}
}
}
Nota: Como esta librería va a ser usada por paginas web hay que hacer referencia a: "System.Web"
Crear la Aplicación Web en ASP .NET Web Form
Crear un "Nuevo Sitio web vacío de ASP .NET" en C# llamado "Demo14" y crear las siguientes carpetas:
- Estilos: Para el archivo de hoja de estilo (CSS).
- Imagenes. Dentro crear otra carpeta llamada "Empleados" y adjuntar los archivos con las fotos de los empleados: 1.jpg, 2.jpg, 3.jpg, ... y No.jpg.
- Paginas: Para contener la pagina de lista de empleados.
Crear el Archivo de Hoja de Estilo (CSS)
Seleccionar la carpeta "Estilos" y agregar un archivo de hoja de estilos con el nombre de: "ACME.css" y modificar el código como sigue:
body {
background-color:aqua;
}
.Titulo {
background-color:black;
color:white;
text-transform:uppercase;
font-size:xx-large;
font-weight:bold;
}
.Subtitulo {
background-color:white;
color:blue;
text-transform:capitalize;
font-size:x-large;
font-weight:bold;
}
.MarcarTabla {
background-color: lightgray;
cursor:default;
border:solid;
border-color:lightgray;
}
.MarcarTabla:hover {
background-color: yellow;
cursor:pointer;
border:solid;
border-color:black;
}
Crear la Pagina ASP .NET como un Formulario Web Form
Seleccionar la carpeta "Paginas" y agregar un Formulario Web Form llamado: "ListaEmpleados.aspx", para empezar a diseñar la pagina hay que hacer referencia a las Librerías de Negocio (que copia todas sus dependencias) y la Librería de Código de Usuario Web.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ListaEmpleados.aspx.cs" Inherits="Paginas_ListaEmpleados" %>
<%@ Import Namespace="Northwind.Librerias.EntidadesNegocio" %>
<%@ Import Namespace="General.Librerias.CodigoUsuarioWeb" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link href="../Estilos/ACME.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%">
<tr>
<td class="Titulo" colspan="5">Paginar, Ordenar y Filtrar en el DataList</td>
</tr>
<tr>
<td class="Subtitulo" colspan="5">Lista de Empleados</td>
</tr>
<tr>
<td style="width:10%">Ordenar Por: </td>
<td style="width:20%">
<asp:DropDownList ID="ddlCampo" runat="server" />
</td>
<td style="width:10%">Tipo Orden: </td>
<td style="width:20%">
<asp:DropDownList ID="ddlOrden" runat="server">
<asp:ListItem Value="0">Ascendente</asp:ListItem>
<asp:ListItem Value="1">Descendente</asp:ListItem>
</asp:DropDownList>
</td>
<td style="width:40%">
<asp:Button ID="btnOrdenar" Text="Ordenar"
OnClick="ordenarCampo" runat="server"/>
</td>
</tr>
<tr>
<td style="width:10%">Filtrar Por: </td>
<td style="width:20%">
<asp:DropDownList ID="ddlCriterio" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="cambiarControlBusqueda" />
</td>
<td style="width:10%">Dato Filtrar: </td>
<td style="width:20%">
<asp:TextBox ID="txtDato" Width="130" runat="server" />
</td>
<td style="width:40%">
<asp:Button ID="btnFiltrar" Text="Filtrar" OnClick="filtrarCriterio" runat="server"/>
</td>
</tr>
<tr>
<td colspan="5" class="Subtitulo">Registros encontrados:
<asp:Label ID="lblRegistros" Text="0" runat="server"/>
</td>
</tr>
<tr>
<td colspan="5">
<asp:DataList ID="dlsEmpleado" runat="server" EnableViewState="False"
RepeatColumns="3" CellPadding="15" CellSpacing="15"
RepeatDirection="Horizontal">
RepeatDirection="Horizontal">
<ItemTemplate>
<table class="MarcarTabla">
<tr>
<td>
<table>
<tr>
<td style="width:80px">Código :</td>
<td style="width:100px">
<%#((beEmpleado)Container.DataItem).IdEmpleado%>
</td>
</tr>
<tr>
<td style="width:80px">Apellido :</td>
<td style="width:100px">
<%#((beEmpleado)Container.DataItem).Apellido%>
</td>
</tr>
<tr>
<td style="width:80px">Nombre :</td>
<td style="width:100px">
<%#((beEmpleado)Container.DataItem).Nombre%>
</td>
</tr>
<tr>
<td style="width:80px">Fecha Nac :</td>
<td style="width:100px">
<%#((beEmpleado)Container.DataItem).FechaNacimiento.
ToShortDateString()%>
</td>
</tr>
</table>
</td>
<td>
<img src='<%#Imagen.obtenerUrl(((beEmpleado)Container.DataItem).
IdEmpleado,"Empleados")%>' width="120" height="80" alt="Foto"
title="<%#((beEmpleado)Container.DataItem).NombreCompleto%>"/>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
<tr>
<td id="celdaBotones" style="text-align:center" colspan="5" runat="server">
<asp:Button ID="btnPrimero" Text="<<" Width="50"
runat="server" OnClick="btnPrimero_Click" />
<asp:Button ID="btnAnterior" Text="<" Width="50"
runat="server" OnClick="btnAnterior_Click" />
<asp:TextBox ID="txtPosicion" Width="100" ReadOnly="true" runat="server" />
<asp:Button ID="btnSiguiente" Text=">" Width="50"
runat="server" OnClick="btnSiguiente_Click" />
<asp:Button ID="btnUltimo" Text=">>" Width="50"
runat="server" OnClick="btnUltimo_Click" />
</td>
</tr>
<tr>
<td id="celdaPaginas" style="text-align:center" colspan="5" runat="server">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
El diseño de la pagina se mostrará como en la siguiente figura:
Escribir el siguiente código C# en la página:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Northwind.Librerias.EntidadesNegocio; //beEmpleado
using Northwind.Librerias.ReglasNegocio; //brEmpleado
using System.Reflection; //PropertyInfo
public partial class Paginas_ListaEmpleados : System.Web.UI.Page
{
private List<beEmpleado> lbeEmpleado;
private int registrosPagina = 6;
private int indicePaginaActual;
private int indiceUltimaPagina;
protected void Page_Load(object sender, EventArgs e)
{
txtPosicion.Attributes.Add("style", "text-align:center");
if (!Page.IsPostBack)
{
brEmpleado obrEmpleado = new brEmpleado();
lbeEmpleado = obrEmpleado.listar();
Session["Empleados"] = lbeEmpleado;
Session["Todo"] = lbeEmpleado;
calcularPaginacion();
enlazarDataList();
cargarListaCampos();
}
else
{
indicePaginaActual = (int)ViewState["indicePaginaActual"];
indiceUltimaPagina = (int)ViewState["indiceUltimaPagina"];
}
crearEnlacesPaginas();
}
private void calcularPaginacion()
{
indiceUltimaPagina = (lbeEmpleado.Count / registrosPagina);
if (lbeEmpleado.Count % registrosPagina == 0)
indiceUltimaPagina--;
ViewState["indicePaginaActual"] = indicePaginaActual;
ViewState["indiceUltimaPagina"] = indiceUltimaPagina;
}
private void cargarListaCampos()
{
ddlCriterio.Items.Add(new ListItem("Todo", ""));
PropertyInfo[] propiedades = lbeEmpleado[0].
GetType().GetProperties();
foreach (PropertyInfo propiedad in propiedades)
{
ddlCampo.Items.Add(new ListItem
(propiedad.Name, propiedad.Name));
ddlCriterio.Items.Add(new ListItem
(propiedad.Name, propiedad.Name));
}
}
private void crearEnlacesPaginas()
{
celdaPaginas.Controls.Clear();
LinkButton lbn;
for (int i = 0; i <= indiceUltimaPagina; i++)
{
lbn = new LinkButton();
lbn.Text = (i + 1).ToString();
lbn.Click += new EventHandler(paginar);
celdaPaginas.Controls.Add(lbn);
celdaPaginas.Controls.Add(new LiteralControl(" "));
}
}
private void paginar(object sender, EventArgs e)
{
LinkButton lbn = (LinkButton)sender;
indicePaginaActual = int.Parse(lbn.Text) - 1;
ViewState["indicePaginaActual"] = indicePaginaActual;
enlazarDataList();
}
private void enlazarDataList()
{
indicePaginaActual = (int)ViewState["indicePaginaActual"];
indiceUltimaPagina = (int)ViewState["indiceUltimaPagina"];
lbeEmpleado = (List<beEmpleado>)Session["Empleados"];
List<beEmpleado> lbeFiltro = new List<beEmpleado>();
int inicio = indicePaginaActual * registrosPagina;
int fin = (indicePaginaActual * registrosPagina) + registrosPagina;
for (int i = inicio; i < fin; i++)
{
if (i < lbeEmpleado.Count) lbeFiltro.Add(lbeEmpleado[i]);
else break;
}
dlsEmpleado.DataSource = lbeFiltro;
dlsEmpleado.DataBind();
lblRegistros.Text = lbeEmpleado.Count.ToString();
txtPosicion.Text = String.Format("{0} de {1}", indicePaginaActual + 1,
indiceUltimaPagina + 1);
}
protected void ordenarCampo(object sender, EventArgs e)
{
string campo = ddlCampo.SelectedValue;
int orden = int.Parse(ddlOrden.SelectedValue);
lbeEmpleado = (List<beEmpleado>)Session["Empleados"];
if (orden.Equals(0)) lbeEmpleado = lbeEmpleado.OrderBy
(x => x.GetType().GetProperty(campo).GetValue(x, null)).ToList<beEmpleado>();
else lbeEmpleado = lbeEmpleado.OrderByDescending
(x => x.GetType().GetProperty(campo).GetValue(x, null)).ToList<beEmpleado>();
Session["Empleados"] = lbeEmpleado;
enlazarDataList();
}
protected void filtrarCriterio(object sender, EventArgs e)
{
string campo = ddlCriterio.SelectedValue;
lbeEmpleado = (List<beEmpleado>)Session["Todo"];
if (!campo.Equals(""))
{
string tipo = lbeEmpleado[0].GetType().GetProperty(campo).
PropertyType.ToString().ToLower();
if (tipo.Contains("datetime"))
{
string[] fechaNac = txtDato.Text.Split('-');
txtDato.Text = fechaNac[2] + "/" + fechaNac[1] + "/" + fechaNac[0];
}
lbeEmpleado = lbeEmpleado.FindAll(x => x.GetType().GetProperty(campo).
GetValue(x, null).ToString().ToLower().Contains(txtDato.Text.ToLower()));
}
celdaBotones.Visible = (lbeEmpleado.Count > 0);
Session["Empleados"] = lbeEmpleado;
indicePaginaActual = 0;
ViewState["indicePaginaActual"] = indicePaginaActual;
calcularPaginacion();
enlazarDataList();
crearEnlacesPaginas();
}
protected void btnPrimero_Click(object sender, EventArgs e)
{
indicePaginaActual = 0;
ViewState["indicePaginaActual"] = indicePaginaActual;
enlazarDataList();
}
protected void btnAnterior_Click(object sender, EventArgs e)
{
indicePaginaActual = (int)ViewState["indicePaginaActual"];
if (indicePaginaActual > 0) indicePaginaActual--;
ViewState["indicePaginaActual"] = indicePaginaActual;
enlazarDataList();
}
protected void btnSiguiente_Click(object sender, EventArgs e)
{
indicePaginaActual = (int)ViewState["indicePaginaActual"];
indiceUltimaPagina = (int)ViewState["indiceUltimaPagina"];
if (indicePaginaActual < indiceUltimaPagina) indicePaginaActual++;
ViewState["indicePaginaActual"] = indicePaginaActual;
enlazarDataList();
}
protected void btnUltimo_Click(object sender, EventArgs e)
{
indiceUltimaPagina = (int)ViewState["indiceUltimaPagina"];
indicePaginaActual = indiceUltimaPagina;
ViewState["indicePaginaActual"] = indicePaginaActual;
enlazarDataList();
}
protected void cambiarControlBusqueda(object sender, EventArgs e)
{
string campo = ddlCriterio.SelectedValue;
txtDato.Text = "";
if (campo.Equals("")) txtDato.TextMode = TextBoxMode.SingleLine;
else
{
lbeEmpleado = (List<beEmpleado>)Session["Empleados"];
string tipo = lbeEmpleado[0].GetType().GetProperty(campo).
PropertyType.ToString().ToLower();
if (tipo.Contains("int")) txtDato.TextMode = TextBoxMode.Number;
else
{
if (tipo.Contains("datetime")) txtDato.TextMode = TextBoxMode.Date;
else txtDato.TextMode = TextBoxMode.SingleLine;
}
}
enlazarDataList();
}
}
Nota: Por defecto los registrosPorPagina está configurado a 6 y usamos Reflection para cargar dinamicamente los combos con los nombres de las propiedades del objeto empleado.
Modificar el Archivo Web.Config para especificar la cadena de conexión a Northwind
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="conNW" providerName="SQLServer" connectionString="uid=UsuarioNW;pwd=123456;
data source=DSOFT\Sqlexpress; database=Northwind"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
</configuration>
Probar la Pagina Web
Guardar el Sitio Web, clic derecho a la Pagina "ListaEmpleados.aspx" y seleccionar "Ver en el explorador".
Probar ir a cualquier pagina usando los Links con los números de paginas o con los botones, por ejemplo si estamos en la ultima ya no podemos avanzar a la siguiente o si estamos en la primera ya no podemos retroceder.
Seleccionar un criterio del combo "Ordenar Por", luego seleccionar el "Tipo de Orden" (ascendente o descendente) y clic al botón "Ordenar", ver como los registros se ordenan por el campo seleccionado.
Seleccionar un criterio del combo "Filtrar Por", luego ingresar un dato en "Dato Filtrar" y clic al botón "Filtrar", ver como solo aparecen los registros que cumplen con el criterio, se muestra la cantidad de registros encontrados y como varia los números de paginas.
Comentario Final
En esta demostración hemos visto como podemos paginar, ordenar y filtrar usando el control DataList y sin usar ViewState para dicho control para minimizar el HTML enviado al navegador. Mas bien hemos usado el ViewState (y no Session) para almacenar y recuperar el "indicePaginaActual" y el "indiceUltimaPagina" ya que al hacer PostBack se pierden los valores de las variables.
Descarga:
Demo14_Paginar_Ordenar_Filtrar_DataList
Etiquetas:
C#,
CSS,
Data Templates,
DataList,
Demos,
Filtrar,
Lduenas,
Librerías,
LinkButton,
Listas de Objetos,
Ordenar,
Paginar,
Plantilla de Datos,
Reflection,
ViewState,
Web Control,
WebForms
El Libro del Día: Pro C# 5.0 and the .NET 4.5 Framework
El Libro del Día: 2014-08-06
Titulo: Pro C# 5.0 and the .NET 4.5 Framework (6th Edition)
Autor: Andrew Troelsen
Editorial: Apress
Nro Paginas: 1534
Capítulos:
Part I: Introducing C# and .NET Platform
Chapter 1: The Philosophy of .NET
Chapter 2: Building C# Applications
Part II: Core C# Programming
Chapter 3: Core C# Programming Constructs, Part I
Chapter 4: Core C# Programming Constructs, Part II
Part III: Object-Oriented Programming with C#
Chapter 5: Understanding Encapsulation
Chapter 6: Understanding Inheritance and Polymorphism
Chapter 7: Understanding Structured Exception Handling
Chapter 8: Working with Interfaces
Part IV: Advanced C# Programming
Chapter 9: Collections and Generics
Chapter 10: Delegates, Events, and Lambda Expressions
Chapter 11: Advanced C# Language Features
Chapter 12: LINQ to Objects
Chapter 13: Understanding Object Lifetime
Part V: Programming with .NET Assemblies
Chapter 14: Building and Configuring Class Libraries
Chapter 15: Type Reflection, Late Binding, and Attribute-Based Programming
Chapter 16: Dynamic Types and the Dynamic Language Runtime
Chapter 17: Processes, AppDomains, and Object Contexts
Chapter 18: Understanding CIL and the Role of Dynamic Assemblies
Part VI: Introducing the .NET Base Class Libraries
Chapter 19: Multithreaded, Parallel, and Async Programming
Chapter 20: File I/O and Object Serialization
Chapter 21: ADO.NET Part I: The Connected Layer
Chapter 22: ADO.NET Part II: The Disconnected Layer
Chapter 23: ADO.NET Part III: The Entity Framework
Chapter 24: Introducing LINQ to XML
Chapter 25: Introducing Windows Communication Foundation
Chapter 26: Introducing Windows Workflow Foundation
Part VII: Windows Presentation Foundation
Chapter 27: Introducing Windows Presentation Foundation and XAML
Chapter 28: Programming with WPF Controls
Chapter 29: WPF Graphics Rendering Services
Chapter 30: WPF Resources, Animations, and Styles
Chapter 31: Dependency Properties, Routed Events, and Templates
Part VIII: ASP.NET Web Forms
Chapter 32: Introducing ASP.NET Web Forms
Chapter 33: ASP.NET Web Controls, Master Pages, and Themes
Chapter 34: ASP.NET State Management Techniques
Descarga:
Pro_C#5.0_.NET4.5_Framework
Titulo: Pro C# 5.0 and the .NET 4.5 Framework (6th Edition)
Autor: Andrew Troelsen
Editorial: Apress
Nro Paginas: 1534
Capítulos:
Part I: Introducing C# and .NET Platform
Chapter 1: The Philosophy of .NET
Chapter 2: Building C# Applications
Part II: Core C# Programming
Chapter 3: Core C# Programming Constructs, Part I
Chapter 4: Core C# Programming Constructs, Part II
Part III: Object-Oriented Programming with C#
Chapter 5: Understanding Encapsulation
Chapter 6: Understanding Inheritance and Polymorphism
Chapter 7: Understanding Structured Exception Handling
Chapter 8: Working with Interfaces
Part IV: Advanced C# Programming
Chapter 9: Collections and Generics
Chapter 10: Delegates, Events, and Lambda Expressions
Chapter 11: Advanced C# Language Features
Chapter 12: LINQ to Objects
Chapter 13: Understanding Object Lifetime
Part V: Programming with .NET Assemblies
Chapter 14: Building and Configuring Class Libraries
Chapter 15: Type Reflection, Late Binding, and Attribute-Based Programming
Chapter 16: Dynamic Types and the Dynamic Language Runtime
Chapter 17: Processes, AppDomains, and Object Contexts
Chapter 18: Understanding CIL and the Role of Dynamic Assemblies
Part VI: Introducing the .NET Base Class Libraries
Chapter 19: Multithreaded, Parallel, and Async Programming
Chapter 20: File I/O and Object Serialization
Chapter 21: ADO.NET Part I: The Connected Layer
Chapter 22: ADO.NET Part II: The Disconnected Layer
Chapter 23: ADO.NET Part III: The Entity Framework
Chapter 24: Introducing LINQ to XML
Chapter 25: Introducing Windows Communication Foundation
Chapter 26: Introducing Windows Workflow Foundation
Part VII: Windows Presentation Foundation
Chapter 27: Introducing Windows Presentation Foundation and XAML
Chapter 28: Programming with WPF Controls
Chapter 29: WPF Graphics Rendering Services
Chapter 30: WPF Resources, Animations, and Styles
Chapter 31: Dependency Properties, Routed Events, and Templates
Part VIII: ASP.NET Web Forms
Chapter 32: Introducing ASP.NET Web Forms
Chapter 33: ASP.NET Web Controls, Master Pages, and Themes
Chapter 34: ASP.NET State Management Techniques
Descarga:
Pro_C#5.0_.NET4.5_Framework
Etiquetas:
.NET Framework,
ADO .NET,
Andrew Troelsen,
Apress,
ASP .NET,
C#,
Collections,
Delegates,
DLR,
Encapsulation,
Generics,
Inheritance,
Interfaces,
Libros,
LINQ,
OOP,
Polymorphism,
Reflection,
WCF,
WPF
martes, 5 de agosto de 2014
El Libro del Día: Professional ASP.NET MVC 4
El Libro del Día: 2014-08-05
Titulo: Professional ASP.NET MVC 4
Autor: Jon Galloway, Phil Haack, Brad Wilson, K. Scott Allen
Editorial: Wrox
Nro Paginas: 507
Capítulos:
CHAPTER 1 Getting Started
CHAPTER 2 Controllers
CHAPTER 3 Views
CHAPTER 4 Models
CHAPTER 5 Forms and HTML Helpers
CHAPTER 6 Data Annotations and Validation
CHAPTER 7 Membership, Authorization, and Security
CHAPTER 8 Ajax
CHAPTER 9 Routing
CHAPTER 10 NuGet
CHAPTER 11 ASP.NET Web API
CHAPTER 12 Dependency Injection
CHAPTER 13 Unit Testing
CHAPTER 14 Extending MVC
CHAPTER 15 Advanced Topics
CHAPTER 16 Real-World ASP.NET MVC: Building the NuGet.org Website
Descarga:
Professional_ASPNET_MVC4
Titulo: Professional ASP.NET MVC 4
Autor: Jon Galloway, Phil Haack, Brad Wilson, K. Scott Allen
Editorial: Wrox
Nro Paginas: 507
Capítulos:
CHAPTER 1 Getting Started
CHAPTER 2 Controllers
CHAPTER 3 Views
CHAPTER 4 Models
CHAPTER 5 Forms and HTML Helpers
CHAPTER 6 Data Annotations and Validation
CHAPTER 7 Membership, Authorization, and Security
CHAPTER 8 Ajax
CHAPTER 9 Routing
CHAPTER 10 NuGet
CHAPTER 11 ASP.NET Web API
CHAPTER 12 Dependency Injection
CHAPTER 13 Unit Testing
CHAPTER 14 Extending MVC
CHAPTER 15 Advanced Topics
CHAPTER 16 Real-World ASP.NET MVC: Building the NuGet.org Website
Descarga:
Professional_ASPNET_MVC4
Etiquetas:
AJAX,
ASP .NET,
Brad Wilson,
Controllers,
Data Annotations,
Dependency Injection,
HTML Helpers,
Jon Galloway,
K. Scott Allen,
Libros,
Models,
MVC 4,
NuGet,
Phil Haack,
Routing,
Security,
Validation,
Views,
Web API,
Wrox
lunes, 4 de agosto de 2014
El Libro del Día: C# 5.0 All In One For Dummies
El Libro del Día: 2014-08-04
Titulo: C# 5.0 All In One For Dummies
Autor: Bill Sempf, Chuck Sphar, Stephen Randy Davis
Editorial: Wiley
Nro Paginas: 843
Capítulos:
Book I: The Basics of C# Programming
Chapter 1: Creating Your First C# Console Application
Chapter 2: Living with Variability - Declaring Value-Type Variables
Chapter 3: Pulling Strings
Chapter 4: Smooth Operators
Chapter 5: Getting into the Program Flow
Chapter 6: Lining Up Your Ducks with Collections
Chapter 7: Stepping through Collections
Chapter 8: Buying Generic
Chapter 9: Some Exceptional Exceptions
Book II: Object-Oriented C# Programming
Chapter 1: Object-Oriented Programming - What’s It All About?
Chapter 2: Showing Some Class
Chapter 3: We Have Our Methods
Chapter 4: Let Me Say This about this
Chapter 5: Holding a Class Responsible
Chapter 6: Inheritance: Is That All I Get?
Chapter 7: Poly-what-ism?
Chapter 8: Interfacing with the Interface
Chapter 9: Delegating Those Important Events
Chapter 10: Can I Use Your Namespace in the Library?
Chapter 11: Improving Productivity with Named and Optional Parameters
Book III: Designing for C#
Chapter 1: Writing Secure Code
Chapter 2: Accessing Data
Chapter 3: Fishing the FileStream
Chapter 4: Accessing the Internet
Chapter 5: Creating Images
Chapter 6: Programming Dynamically
Chapter 7: Helping Out with Interop
Book IV: A Tour of Visual Studio
Chapter 1: Getting Started with Visual Studio
Chapter 2: Using the Interface
Chapter 3: Customizing Visual Studio
Chapter 4: Transforming Text Templates
Book V: Windows Development with WPF
Chapter 1: Introducing WPF
Chapter 2: Understanding the Basics of WPF
Chapter 3: Data Binding in WPF
Chapter 4: Practical WPF
Book VI: Web Development with ASP.NET
Chapter 1: Looking at How ASP.NET Works with C#
Chapter 2: Building Web Applications
Chapter 3: Controlling Your Development Experience
Chapter 4: Leveraging the .NET Framework
Chapter 5: Digging into Web Construction
Book VII: Service-Oriented Development
Chapter 1: Getting Acquainted with Web Services
Chapter 2: Building Web Services with ASMX
Chapter 3: Building Web Services with WCF
Chapter 4: Building Web Services with REST
Descarga:
C#5.0_AllInOne_ForDummies
Titulo: C# 5.0 All In One For Dummies
Autor: Bill Sempf, Chuck Sphar, Stephen Randy Davis
Editorial: Wiley
Nro Paginas: 843
Capítulos:
Book I: The Basics of C# Programming
Chapter 1: Creating Your First C# Console Application
Chapter 2: Living with Variability - Declaring Value-Type Variables
Chapter 3: Pulling Strings
Chapter 4: Smooth Operators
Chapter 5: Getting into the Program Flow
Chapter 6: Lining Up Your Ducks with Collections
Chapter 7: Stepping through Collections
Chapter 8: Buying Generic
Chapter 9: Some Exceptional Exceptions
Book II: Object-Oriented C# Programming
Chapter 1: Object-Oriented Programming - What’s It All About?
Chapter 2: Showing Some Class
Chapter 3: We Have Our Methods
Chapter 4: Let Me Say This about this
Chapter 5: Holding a Class Responsible
Chapter 6: Inheritance: Is That All I Get?
Chapter 7: Poly-what-ism?
Chapter 8: Interfacing with the Interface
Chapter 9: Delegating Those Important Events
Chapter 10: Can I Use Your Namespace in the Library?
Chapter 11: Improving Productivity with Named and Optional Parameters
Book III: Designing for C#
Chapter 1: Writing Secure Code
Chapter 2: Accessing Data
Chapter 3: Fishing the FileStream
Chapter 4: Accessing the Internet
Chapter 5: Creating Images
Chapter 6: Programming Dynamically
Chapter 7: Helping Out with Interop
Book IV: A Tour of Visual Studio
Chapter 1: Getting Started with Visual Studio
Chapter 2: Using the Interface
Chapter 3: Customizing Visual Studio
Chapter 4: Transforming Text Templates
Book V: Windows Development with WPF
Chapter 1: Introducing WPF
Chapter 2: Understanding the Basics of WPF
Chapter 3: Data Binding in WPF
Chapter 4: Practical WPF
Book VI: Web Development with ASP.NET
Chapter 1: Looking at How ASP.NET Works with C#
Chapter 2: Building Web Applications
Chapter 3: Controlling Your Development Experience
Chapter 4: Leveraging the .NET Framework
Chapter 5: Digging into Web Construction
Book VII: Service-Oriented Development
Chapter 1: Getting Acquainted with Web Services
Chapter 2: Building Web Services with ASMX
Chapter 3: Building Web Services with WCF
Chapter 4: Building Web Services with REST
Descarga:
C#5.0_AllInOne_ForDummies
Etiquetas:
ASP .NET,
Bill Sempf,
C#,
Chuck Sphar,
Collections,
Console,
Events,
For Dummies,
Generic,
Interfaces,
Interop,
Libros,
OOP,
Operators,
Stephen Randy Davis,
Strings,
Variables,
WCF,
Wiley,
WPF
domingo, 3 de agosto de 2014
El Libro del Día: Professional jQuery
El Libro del Día: 2014-08-03
Titulo: Professional jQuery
Autor: Cesar Otero
Editorial: Wrox
Nro Paginas: 338
Capítulos:
PART I JQUERY FUNDAMENTALS
CHAPTER 1 Getting Started
CHAPTER 2 JavaScript Primer
CHAPTER 3 The jQuery Core
CHAPTER 4 DOM Element Selection and Manipulation
CHAPTER 5 Event Handling
CHAPTER 6 HTML Forms, Data, and Ajax
CHAPTER 7 Animations and Effects
PART II APPLIED JQUERY
CHAPTER 8 jQuery UI Part I - Making Things Look Slick
CHAPTER 9 jQuery UI Part II - Mouse Interactions
CHAPTER 10 Writing Effective jQuery Code
CHAPTER 11 jQuery Templates
CHAPTER 12 Writing jQuery Plugins
CHAPTER 13 Advanced Asynchronous Programming with jQuery Deferred
CHAPTER 14 Unit Testing with QUnit
APPENDIX Plugins Used In this Book
Descarga:
Professional_jQuery
Titulo: Professional jQuery
Autor: Cesar Otero
Editorial: Wrox
Nro Paginas: 338
Capítulos:
PART I JQUERY FUNDAMENTALS
CHAPTER 1 Getting Started
CHAPTER 2 JavaScript Primer
CHAPTER 3 The jQuery Core
CHAPTER 4 DOM Element Selection and Manipulation
CHAPTER 5 Event Handling
CHAPTER 6 HTML Forms, Data, and Ajax
CHAPTER 7 Animations and Effects
PART II APPLIED JQUERY
CHAPTER 8 jQuery UI Part I - Making Things Look Slick
CHAPTER 9 jQuery UI Part II - Mouse Interactions
CHAPTER 10 Writing Effective jQuery Code
CHAPTER 11 jQuery Templates
CHAPTER 12 Writing jQuery Plugins
CHAPTER 13 Advanced Asynchronous Programming with jQuery Deferred
CHAPTER 14 Unit Testing with QUnit
APPENDIX Plugins Used In this Book
Descarga:
Professional_jQuery
Etiquetas:
AJAX,
Animations,
Asynchronous,
Cesar Otero,
DOM,
Effects,
Forms,
HTML,
Javascript,
jQuery,
jQuery UI,
Libros,
Plugins,
Professional,
QUnit,
Templates,
Wrox
sábado, 2 de agosto de 2014
El Libro del Día: Pro ASP.NET MVC 4
El Libro del Día: 2014-08-02
Titulo: Pro ASP.NET MVC 4 (4th Edition)
Autor: Adam Freeman
Editorial: Apress
Nro Paginas: 738
Capítulos:
Part 1: Introducing ASP.NET MVC 4
Chapter 1: What’s the Big Idea?
Chapter 2: Your First MVC Application
Chapter 3: The MVC Pattern
Chapter 4: Essential Language Features
Chapter 5: Working with Razor
Chapter 6: Essential Tools for MVC
Chapter 7: SportsStore - A Real Application
Chapter 8: SportsStore: Navigation
Chapter 9: SportsStore: Completing the Cart
Chapter 10: SportsStore: Administration
Chapter 11: SportsStore: Security & Finishing Touches
Part 2: ASP.NET MVC 4 in Detail
Chapter 12: Overview of MVC Projects
Chapter 13: URL Routing
Chapter 14: Advanced Routing Features
Chapter 15: Controllers and Actions
Chapter 16: Filters
Chapter 17: Controller Extensibility
Chapter 18: Views
Chapter 19: Helper Methods
Chapter 20: Templated Helper Methods
Chapter 21: URL and Ajax Helper Methods
Chapter 22: Model Binding
Chapter 23: Model Validation
Chapter 24: Bundles and Display Modes
Chapter 25: Web API
Chapter 26: Deployment
Descarga:
Pro_ASPNET_MVC4
Titulo: Pro ASP.NET MVC 4 (4th Edition)
Autor: Adam Freeman
Editorial: Apress
Nro Paginas: 738
Capítulos:
Part 1: Introducing ASP.NET MVC 4
Chapter 1: What’s the Big Idea?
Chapter 2: Your First MVC Application
Chapter 3: The MVC Pattern
Chapter 4: Essential Language Features
Chapter 5: Working with Razor
Chapter 6: Essential Tools for MVC
Chapter 7: SportsStore - A Real Application
Chapter 8: SportsStore: Navigation
Chapter 9: SportsStore: Completing the Cart
Chapter 10: SportsStore: Administration
Chapter 11: SportsStore: Security & Finishing Touches
Part 2: ASP.NET MVC 4 in Detail
Chapter 12: Overview of MVC Projects
Chapter 13: URL Routing
Chapter 14: Advanced Routing Features
Chapter 15: Controllers and Actions
Chapter 16: Filters
Chapter 17: Controller Extensibility
Chapter 18: Views
Chapter 19: Helper Methods
Chapter 20: Templated Helper Methods
Chapter 21: URL and Ajax Helper Methods
Chapter 22: Model Binding
Chapter 23: Model Validation
Chapter 24: Bundles and Display Modes
Chapter 25: Web API
Chapter 26: Deployment
Descarga:
Pro_ASPNET_MVC4
Etiquetas:
Actions,
Adam Freeman,
AJAX,
Apress,
ASP .NET,
Bundles,
Controllers,
Deployment,
Filters,
Helpers,
Libros,
Model Binding,
Model Validation,
MVC 4,
Razor,
SportsStore,
URL Routing,
Views,
Web API
Suscribirse a:
Entradas (Atom)







