Pasar de capa negocio a windows form

Páginas: 2 (492 palabras) Publicado: 14 de junio de 2011
Pasando de Clase Negocio a FORM en C# (Básico)
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
usingSystem.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CapaNegocio;
using CapaDatos;
using System.Collections.Generic;public partial class ManRegiones : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
cargarDatos();}
else
{
cargarDatos();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Region reg = new Region();reg.IdRegion = "";
reg.NombreAbreviado = txtAbrev.Text;
reg.Nombre = txtNombre.Text;

int x = RegionNeg.agregarRegion(reg);

if (x > 0)
{Label5.Text = "Region agregada";
}
else
{
Label5.Text = "Imposible agregar, vuelva a intentar";
}
limpiarCampos();
cargarDatos();
}public void limpiarCampos()
{
Label4.Text = "";
txtAbrev.Text = "";
txtNombre.Text = "";
}

//ANTES DE CARGAR DATOS LEA EN EL ÚLTIMO PUNTO

publicvoid cargarDatos()
{
List regiones = RegionNeg.seleccionarRegiones();
IEnumerator it = regiones.GetEnumerator();
DataTable dt = new DataTable();dt.Columns.Add("ID Region");
dt.Columns.Add("Nombre abreviado");
dt.Columns.Add("Nombre");

while (it.MoveNext())
{
DataRow dr = dt.NewRow();
dr[0]= it.Current.IdRegion;
dr[1] = it.Current.NombreAbreviado;
dr[2] = it.Current.Nombre;

dt.Rows.Add(dr);
}
GridView1.DataSource = dt;...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Pasos para isntalar windows xp, forma tradicional.
  • formando capas
  • PASO A PASO ESTRUCTURA DE NEGOCIO
  • pasos de negocio
  • formas de negociar
  • Instalacion de windows xp paso a paso
  • Instalar windows xp paso paso
  • Instalacion De Windows Xp Paso A Paso

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS