• Save
Bantesco.net
Upcoming SlideShare
Loading in...5
×
 

Bantesco.net

on

  • 204 views

BANTESCO

BANTESCO

Statistics

Views

Total Views
204
Views on SlideShare
193
Embed Views
11

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 11

http://daw6a.blogspot.mx 11

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Bantesco.net Bantesco.net Document Transcript

  • BANTESCO.NETBiblioteca de clase.using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;using System.Data;namespace WepTesco{publicclassCliente{publicint Cuenta;publicstring Nombre;publicstring Appaterno;publicstring Apmaterno;publicstring Ife;publicstring Rfc;publicstring Genero;publicstring Calle;publicstring Interior;publicstring Colonia;publicstring Ciudad;publicstring Telefono;publicstring CodigoPostal;public Cliente(){}public Cliente(int idcuenta1, string nombre1, string apellidopaterno1,string apellidomaterno1, string calle1,string interior1, string ife1,string rfc1, string genero1, string ciudad1, string colonia1, stringtelefono1, string cp1){Cuenta = idcuenta1;Nombre = nombre1;Appaterno = apellidopaterno1;Apmaterno= apellidomaterno1;Calle = calle1;Interior = interior1;Ife = ife1;Rfc = rfc1;Genero = genero1;Ciudad = ciudad1;Colonia = colonia1;Telefono = telefono1;CodigoPostal = cp1;}publicDataSet Consulta_Personal(string cadenaconexion){DataSet ds = newDataSet();SqlConnection conexion = newSqlConnection(cadenaconexion);
  • string consultaSQL = "exec pa_ConsultarCliente";SqlCommand comando = newSqlCommand(consultaSQL, conexion);SqlDataAdapter da = newSqlDataAdapter(comando);conexion.Open();da.Fill(ds);conexion.Close();return ds;}publicint RegistrarClientes(string cadenaconexion){SqlConnection conexion = newSqlConnection(cadenaconexion);string consultaSQL = "exec pa_RegistrarCliente " + this.Nombre + "," +this.Appaterno + "," + this.Apmaterno + "," + this.Ife + "," +this.Genero + "," + this.Calle + "," + this.Interior + "," +this.Colonia + "," + this.Ciudad + "," + this.CodigoPostal + "," +this.Telefono + "," + this.Rfc + "";SqlCommand comando = newSqlCommand(consultaSQL, conexion);conexion.Open();int res = comando.ExecuteNonQuery();conexion.Close();return res;}publicint ModificarClientes(string cadenaconexion){SqlConnection conexion = newSqlConnection(cadenaconexion);string consultaSQL = "exec pa_ModificarCliente "+this.Cuenta+","+this.Nombre + "," + this.Appaterno + "," + this.Apmaterno + "," +this.Ife + "," + this.Genero + "," + this.Calle + "," +this.Interior + "," + this.Colonia + "," + this.Ciudad + "," +this.CodigoPostal + "," + this.Telefono + "," + this.Rfc + "";SqlCommand comando = newSqlCommand(consultaSQL, conexion);conexion.Open();int res = comando.ExecuteNonQuery();conexion.Close();return res;}publicint EliminarClientes(string cadenaconexion, int Cuenta){SqlConnection conexion = newSqlConnection(cadenaconexion);string ConsultaSQL = "EXEC pa_EliminarCliente " + Cuenta.ToString();SqlCommand comando = newSqlCommand(ConsultaSQL, conexion);conexion.Open();int res = comando.ExecuteNonQuery();return res;}}}
  • Form consultar clientes.using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using WepTesco;using System.Web.Configuration;namespace BancoWeb{publicpartialclassConsultaClientes : System.Web.UI.Page{protectedvoid Page_Load(object sender, EventArgs e){}protectedvoid btnConsultar_Click(object sender, EventArgs e){Cliente mipersonal = newCliente();DataSet ds = newDataSet();string cadenaconexion =WebConfigurationManager.ConnectionStrings["cadcon"].ConnectionString;ds = mipersonal.Consulta_Personal(cadenaconexion);clientes.DataSource = ds;clientes.DataBind();}protectedvoid clientes_SelectedIndexChanged(object sender, EventArgs e){int fila = clientes.SelectedIndex;string Cuenta = clientes.Rows[fila].Cells[1].Text;Session.Add("Cuenta", Cuenta);}protectedvoid btnEliminar_Click(object sender, EventArgs e){Cliente mipersona = newCliente();string cadenaconexion =WebConfigurationManager.ConnectionStrings["cadcon"].ConnectionString;int Cuenta = Convert.ToInt32(Session["Cuenta"].ToString());mipersona.EliminarClientes(cadenaconexion, Cuenta);}}}Form modifcar,eliminar,registrar clientes.
  • using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using WepTesco;using System.Web.Configuration;namespace BancoWeb{publicpartialclassRegistrarCliente : System.Web.UI.Page{protectedvoid Page_Load(object sender, EventArgs e){carga_datos();}protectedvoid TextBox1_TextChanged(object sender, EventArgs e){}protectedvoid TextBox2_TextChanged(object sender, EventArgs e){}protectedvoid btnRegistrar_Click(object sender, EventArgs e){string nombre = txtnombre.Text;string paterno = txtapp.Text;string materno = txtapm.Text;string Calle = txtcal.Text;string Interior = txtint.Text;string Ife = txtife.Text;string Rfc = txtrfc.Text;string Genero = txtgen.Text;string Ciudad = txtciu.Text;string Colonia = txtcol.Text;string Telefono = txttel.Text;string CodigoPostal = txtcp.Text;string cadenaconexion =WebConfigurationManager.ConnectionStrings["cadcon"].ConnectionString;Cliente mipersonal = newCliente(0, nombre, paterno, materno,Calle,Interior, Ife, Rfc, Genero, Ciudad, Colonia,Telefono,CodigoPostal);int res = mipersonal.RegistrarClientes(cadenaconexion);}
  • protectedvoid Button1_Click(object sender, EventArgs e){int cuentaentero=0;string id = txtid.Text;string nombre = txtnombre.Text;string paterno = txtapp.Text;string materno = txtapm.Text;string Calle = txtcal.Text;string Interior = txtint.Text;string Ife = txtife.Text;string Rfc = txtrfc.Text;string Genero = txtgen.Text;string Ciudad = txtciu.Text;string Colonia = txtcol.Text;string Telefono = txttel.Text;string CodigoPostal = txtcp.Text;cuentaentero=int.Parse(id);string cadenaconexion =WebConfigurationManager.ConnectionStrings["cadcon"].ConnectionString;Cliente mipersonal = newCliente(cuentaentero, nombre, paterno, materno,Calle,Interior, Ife, Rfc, Genero, Ciudad, Colonia,Telefono,CodigoPostal);int mod = mipersonal.ModificarClientes(cadenaconexion);}publicvoid carga_datos(){Cliente mipersonal = newCliente();DataSet ds = newDataSet();string cadenaconexion =WebConfigurationManager.ConnectionStrings["cadcon"].ConnectionString;ds = mipersonal.Consulta_Personal(cadenaconexion);listaid.DataSource = ds.Tables[0];listaid.DataTextField = "Cuenta";listaid.DataBind();}protectedvoid btnModifica_Click(object sender, EventArgs e){int id = Convert.ToInt32(listaid.Text);string nombre = txtnombre.Text;string paterno = txtapp.Text;string materno = txtapm.Text;string Calle = txtcal.Text;string Interior = txtint.Text;string Ife = txtife.Text;string Rfc = txtrfc.Text;string Genero = txtgen.Text;
  • string Ciudad = txtciu.Text;string Colonia = txtcol.Text;string Telefono = txttel.Text;string CodigoPostal = txtcp.Text;string cadenaconexion =WebConfigurationManager.ConnectionStrings["cadcon"].ConnectionString;Cliente mipersonal = newCliente(id,nombre, paterno, materno, Calle,Interior, Ife, Rfc, Genero, Ciudad, Colonia, Telefono, CodigoPostal);int res = mipersonal.ModificarClientes(cadenaconexion);}}}
  • Vista form consulta clientes.
  • VISTA FORM ADMINISTRAR CLIENTES.