コード例 #1
0
        protected void btnADD_Click1(object sender, EventArgs e)
        {
            SqlConnection cn = new SqlConnection(CadenaConexion);

            cn.Open();
            var cmd = new SqlCommand("Select count(*) from usuario where usuario=@user or email=@email", cn);

            cmd.Parameters.Add("@user", SqlDbType.VarChar).Value  = txtuser.Text;
            cmd.Parameters.Add("@email", SqlDbType.VarChar).Value = txtemail.Text + dlcorreo.SelectedValue;
            cmd.Connection = cn;


            int result = Convert.ToInt32(cmd.ExecuteScalar());

            if (result >= 1)
            {
                MsgBox("ERROR: Usuario ya existe o el correo ya está en uso", this.Page, this);
            }
            else
            {
                UsuarioADO ado = new UsuarioADO();
                Usuario    u   = new Usuario();
                u.nombre   = txtname.Text.ToUpper();
                u.email    = txtemail.Text + dlcorreo.SelectedValue;
                u.usuario1 = txtuser.Text;
                u.pwd      = txtpass.Text;
                u.tipo     = "cliente";
                int    i   = ado.agregarUsuario(u);
                string str = "Usuario Registrado con éxito";

                MsgBox(str, this.Page, this);
            }
        }
コード例 #2
0
 //Contructor de la clase
 public TiendaOnline()
 {
     _datPed    = new PedidosADO();
     _datLinPed = new LinpedsADO();
     _datUsu    = new UsuarioADO();
     _datArt    = new ArticulosADO();
     _datProv   = new ProvinciasADO();
     _datLoc    = new LocalidadesADO();
     _datTv     = new TvADO();
     _datCam    = new CamaraADO();
     _datMem    = new MemoriasADO();
     _datObj    = new ObjetivosADO();
 }
コード例 #3
0
 public NegocioUsuario()
 {
     _dat = new UsuarioADO();
 }
コード例 #4
0
 public UsuarioAplicacao()
 {
     usuarioADO = new UsuarioADO();
 }
コード例 #5
0
ファイル: UsuarioADOTest1.cs プロジェクト: icaroferj/ir-api
 public UsuarioADOTest1() : base()
 {
     usuarioADO = new UsuarioADO(ado);
 }