Ejemplo n.º 1
0
 protected void btSignup_Click(object sender, EventArgs e)
 {
     GamingHouse.Camadas.BLL.Cliente   bllCliente = new GamingHouse.Camadas.BLL.Cliente();
     GamingHouse.Camadas.Model.Cliente cliente    = new GamingHouse.Camadas.Model.Cliente();
     if (tbName.Text != "" && tbPass.Text != "" && tbCPass.Text != "" && tbRg.Text != "" && tbCpf.Text != "" && tbNasc.Text != "" && tbEmail.Text != "")
     {
         if (tbPass.Text.Equals(tbCPass.Text))
         {
             cliente.nome       = tbName.Text;
             cliente.senha      = tbPass.Text;
             cliente.rg         = tbRg.Text;
             cliente.cpf        = tbCpf.Text;
             cliente.nascimento = Convert.ToDateTime(tbNasc.Text);
             cliente.login      = tbUser.Text;
             cliente.senha      = tbPass.Text;
             cliente.email      = tbEmail.Text;
             bllCliente.Insert(cliente);
             lblMsg.Text = "Registrado com Sucesso.";
         }
         else
         {
             lblMsg.Text = "Senha não Bate com a confirmação.";
         }
     }
     else
     {
         lblMsg.Text = "Todos os campos devem ser Preenchidos.";
     }
     Response.Redirect("Login.aspx");
 }
    protected void btConfirm_Click(object sender, EventArgs e)
    {
        GamingHouse.Camadas.BLL.Cliente   bllCliente = new GamingHouse.Camadas.BLL.Cliente();
        GamingHouse.Camadas.Model.Cliente cliente    = new GamingHouse.Camadas.Model.Cliente();
        try
        {
            cliente.id         = Convert.ToInt32(lblId.Text);
            cliente.nome       = tbName.Text;
            cliente.rg         = tbRg.Text;
            cliente.cpf        = tbCpf.Text;
            cliente.nascimento = Convert.ToDateTime(tbNasc.Text);
            cliente.email      = tbEmail.Text;

            bllCliente.UpdateAdm(cliente);
        }
        catch (Exception)
        {
            lblMsg.Text = "Valores Inválidos.";
        }
        GridView1.DataBind();
    }